@omnitron-dev/prism 0.3.1 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +68 -2
- package/THIRD-PARTY-NOTICES.txt +26 -0
- package/dist/accessibility/index.js +2 -0
- package/dist/accessibility/index.js.map +1 -1
- package/dist/auth/index.d.ts +4 -0
- package/dist/auth/index.d.ts.map +1 -0
- package/dist/auth/index.js +4 -0
- package/dist/auth/index.js.map +1 -0
- package/dist/blocks/auth-block/guards.d.ts +3 -2
- package/dist/blocks/auth-block/guards.d.ts.map +1 -1
- package/dist/blocks/dashboard-block/dashboard-block.d.ts.map +1 -1
- package/dist/blocks/dashboard-block/types.d.ts +4 -2
- package/dist/blocks/dashboard-block/types.d.ts.map +1 -1
- package/dist/blocks/dashboard-block/use-dashboard-block.d.ts +2 -2
- package/dist/blocks/dashboard-block/use-dashboard-block.d.ts.map +1 -1
- package/dist/blocks/data-grid-block/data-grid-block.d.ts.map +1 -1
- package/dist/blocks/data-grid-block/types.d.ts +3 -0
- package/dist/blocks/data-grid-block/types.d.ts.map +1 -1
- package/dist/blocks/index.js +80 -255
- package/dist/blocks/index.js.map +1 -1
- package/dist/chunk-2AB7VGPW.js +447 -0
- package/dist/chunk-2AB7VGPW.js.map +1 -0
- package/dist/{chunk-LOY2NPCO.js → chunk-2E67PQ4T.js} +3 -3
- package/dist/{chunk-LOY2NPCO.js.map → chunk-2E67PQ4T.js.map} +1 -1
- package/dist/chunk-2KG2NI73.js +84 -0
- package/dist/chunk-2KG2NI73.js.map +1 -0
- package/dist/chunk-2UYRW6X3.js +44 -0
- package/dist/chunk-2UYRW6X3.js.map +1 -0
- package/dist/chunk-36C5H56C.js +208 -0
- package/dist/chunk-36C5H56C.js.map +1 -0
- package/dist/chunk-36FOXX25.js +73 -0
- package/dist/chunk-36FOXX25.js.map +1 -0
- package/dist/{chunk-52PQL67Q.js → chunk-3VSM7NZG.js} +18 -15
- package/dist/chunk-3VSM7NZG.js.map +1 -0
- package/dist/{chunk-GUGTDURV.js → chunk-4B2LTPK2.js} +2 -2
- package/dist/{chunk-GUGTDURV.js.map → chunk-4B2LTPK2.js.map} +1 -1
- package/dist/chunk-4HUGZJKU.js +108 -0
- package/dist/chunk-4HUGZJKU.js.map +1 -0
- package/dist/{chunk-PXXPLHIY.js → chunk-4Q5L7LDG.js} +3 -3
- package/dist/{chunk-PXXPLHIY.js.map → chunk-4Q5L7LDG.js.map} +1 -1
- package/dist/{chunk-BRDWQVRT.js → chunk-4R7EZ7GQ.js} +3 -2
- package/dist/chunk-4R7EZ7GQ.js.map +1 -0
- package/dist/chunk-6IANOSMD.js +185 -0
- package/dist/chunk-6IANOSMD.js.map +1 -0
- package/dist/{chunk-YHE7HXSG.js → chunk-7ATBURW2.js} +3 -3
- package/dist/{chunk-YHE7HXSG.js.map → chunk-7ATBURW2.js.map} +1 -1
- package/dist/{chunk-7G5D5PTC.js → chunk-AATAOOSF.js} +4 -4
- package/dist/{chunk-7G5D5PTC.js.map → chunk-AATAOOSF.js.map} +1 -1
- package/dist/chunk-AKLRKCYH.js +128 -0
- package/dist/chunk-AKLRKCYH.js.map +1 -0
- package/dist/chunk-CT46KJOR.js +133 -0
- package/dist/chunk-CT46KJOR.js.map +1 -0
- package/dist/{chunk-LSPFFEJT.js → chunk-D4GFAJAZ.js} +298 -3900
- package/dist/chunk-D4GFAJAZ.js.map +1 -0
- package/dist/{chunk-BJE2AKD4.js → chunk-D5J3KW6Q.js} +3 -2
- package/dist/chunk-D5J3KW6Q.js.map +1 -0
- package/dist/chunk-DEPJRTVT.js +3 -0
- package/dist/{chunk-FU52GL2E.js.map → chunk-DEPJRTVT.js.map} +1 -1
- package/dist/{chunk-472SOF76.js → chunk-DHTYHUYI.js} +85 -107
- package/dist/chunk-DHTYHUYI.js.map +1 -0
- package/dist/{chunk-FF5RF32O.js → chunk-E7WM2RXA.js} +3 -2
- package/dist/chunk-E7WM2RXA.js.map +1 -0
- package/dist/chunk-F6RZ7LW6.js +1271 -0
- package/dist/chunk-F6RZ7LW6.js.map +1 -0
- package/dist/chunk-FOGY3HA4.js +217 -0
- package/dist/chunk-FOGY3HA4.js.map +1 -0
- package/dist/chunk-G2GANYMW.js +139 -0
- package/dist/chunk-G2GANYMW.js.map +1 -0
- package/dist/chunk-I6DILPFE.js +293 -0
- package/dist/chunk-I6DILPFE.js.map +1 -0
- package/dist/{chunk-HOXFSQUV.js → chunk-IRYU3NTG.js} +2 -2
- package/dist/{chunk-HOXFSQUV.js.map → chunk-IRYU3NTG.js.map} +1 -1
- package/dist/chunk-JTIUGPW5.js +284 -0
- package/dist/chunk-JTIUGPW5.js.map +1 -0
- package/dist/{chunk-GUFHFEPZ.js → chunk-JZBSPDED.js} +2 -2
- package/dist/{chunk-GUFHFEPZ.js.map → chunk-JZBSPDED.js.map} +1 -1
- package/dist/{chunk-PFT2BNYO.js → chunk-KPY7TA4D.js} +5 -5
- package/dist/{chunk-PFT2BNYO.js.map → chunk-KPY7TA4D.js.map} +1 -1
- package/dist/{chunk-GMIE6III.js → chunk-LFWKGNCX.js} +50 -623
- package/dist/chunk-LFWKGNCX.js.map +1 -0
- package/dist/chunk-LH4ZZZYB.js +37 -0
- package/dist/chunk-LH4ZZZYB.js.map +1 -0
- package/dist/chunk-NFJ7CPG3.js +13 -0
- package/dist/chunk-NFJ7CPG3.js.map +1 -0
- package/dist/chunk-NFPOIHD4.js +3 -0
- package/dist/{chunk-JSQTYDPG.js.map → chunk-NFPOIHD4.js.map} +1 -1
- package/dist/{chunk-XIXSSI3B.js → chunk-NJM5AVBM.js} +3 -2
- package/dist/chunk-NJM5AVBM.js.map +1 -0
- package/dist/{chunk-4Z5DE5GK.js → chunk-NSNM53WI.js} +133 -115
- package/dist/chunk-NSNM53WI.js.map +1 -0
- package/dist/chunk-NTREGTG7.js +31 -0
- package/dist/chunk-NTREGTG7.js.map +1 -0
- package/dist/{chunk-ADG4HZEP.js → chunk-OKJA6SJM.js} +4 -4
- package/dist/chunk-OKJA6SJM.js.map +1 -0
- package/dist/{chunk-SU3LVQ7N.js → chunk-Q6JDNFSG.js} +11 -226
- package/dist/chunk-Q6JDNFSG.js.map +1 -0
- package/dist/chunk-RPOGINR5.js +115 -0
- package/dist/chunk-RPOGINR5.js.map +1 -0
- package/dist/{chunk-KQ67XB6T.js → chunk-RSWVYIXK.js} +151 -114
- package/dist/chunk-RSWVYIXK.js.map +1 -0
- package/dist/chunk-SSEHL5VP.js +110 -0
- package/dist/chunk-SSEHL5VP.js.map +1 -0
- package/dist/chunk-TEIGUOWN.js +523 -0
- package/dist/chunk-TEIGUOWN.js.map +1 -0
- package/dist/{chunk-AYYFMTMI.js → chunk-TJ7DHXUX.js} +2 -2
- package/dist/{chunk-AYYFMTMI.js.map → chunk-TJ7DHXUX.js.map} +1 -1
- package/dist/{chunk-75FQ5IW3.js → chunk-TZHWYT34.js} +3 -3
- package/dist/{chunk-75FQ5IW3.js.map → chunk-TZHWYT34.js.map} +1 -1
- package/dist/chunk-TZWHELY4.js +45 -0
- package/dist/chunk-TZWHELY4.js.map +1 -0
- package/dist/{chunk-OKTLA23Q.js → chunk-UEINJFLS.js} +6 -6
- package/dist/chunk-UEINJFLS.js.map +1 -0
- package/dist/chunk-URFQX3I6.js +129 -0
- package/dist/chunk-URFQX3I6.js.map +1 -0
- package/dist/chunk-VG6FOMOH.js +187 -0
- package/dist/chunk-VG6FOMOH.js.map +1 -0
- package/dist/{chunk-PGHEP4JD.js → chunk-VQVVHMPG.js} +3 -3
- package/dist/{chunk-PGHEP4JD.js.map → chunk-VQVVHMPG.js.map} +1 -1
- package/dist/{chunk-DRFNMZLG.js → chunk-VUKOT432.js} +3 -2
- package/dist/chunk-VUKOT432.js.map +1 -0
- package/dist/chunk-WD4N72DL.js +315 -0
- package/dist/chunk-WD4N72DL.js.map +1 -0
- package/dist/chunk-XBYMG4QK.js +119 -0
- package/dist/chunk-XBYMG4QK.js.map +1 -0
- package/dist/chunk-YHM6GIHV.js +3 -0
- package/dist/chunk-YHM6GIHV.js.map +1 -0
- package/dist/{chunk-SNZK5X6F.js → chunk-Z2AN43YU.js} +4 -2
- package/dist/chunk-Z2AN43YU.js.map +1 -0
- package/dist/chunk-ZNWHMQRM.js +171 -0
- package/dist/chunk-ZNWHMQRM.js.map +1 -0
- package/dist/{chunk-YSIG2XYH.js → chunk-ZRJYQN6Y.js} +2 -2
- package/dist/{chunk-YSIG2XYH.js.map → chunk-ZRJYQN6Y.js.map} +1 -1
- package/dist/{chunk-AD4W7HYC.js → chunk-ZYI3MHLE.js} +3 -2
- package/dist/chunk-ZYI3MHLE.js.map +1 -0
- package/dist/cli/index.js +59 -421
- package/dist/cli/index.js.map +1 -1
- package/dist/components/admin-filters/admin-data-table.d.ts +7 -1
- package/dist/components/admin-filters/admin-data-table.d.ts.map +1 -1
- package/dist/components/admin-filters/filter-toolbar.d.ts.map +1 -1
- package/dist/components/admin-filters/index.js +8 -0
- package/dist/components/admin-filters/index.js.map +1 -0
- package/dist/components/alert/alert.d.ts.map +1 -1
- package/dist/components/alert/index.js +5 -0
- package/dist/components/alert/index.js.map +1 -0
- package/dist/components/animate/index.js +5 -0
- package/dist/components/animate/index.js.map +1 -0
- package/dist/components/breadcrumbs/breadcrumbs.d.ts.map +1 -1
- package/dist/components/breadcrumbs/index.js +4 -0
- package/dist/components/breadcrumbs/index.js.map +1 -0
- package/dist/components/card/index.js +4 -0
- package/dist/components/card/index.js.map +1 -0
- package/dist/components/chart/chart.d.ts.map +1 -1
- package/dist/components/chart/index.css +52 -0
- package/dist/components/chart/index.css.map +1 -0
- package/dist/components/chart/index.js +5 -0
- package/dist/components/chart/index.js.map +1 -0
- package/dist/components/chart/types.d.ts +3 -1
- package/dist/components/chart/types.d.ts.map +1 -1
- package/dist/components/chart/use-chart.d.ts.map +1 -1
- package/dist/components/command-palette/command-palette.d.ts +3 -1
- package/dist/components/command-palette/command-palette.d.ts.map +1 -1
- package/dist/components/command-palette/index.js +4 -0
- package/dist/components/command-palette/index.js.map +1 -0
- package/dist/components/confirm-dialog/index.js +4 -0
- package/dist/components/confirm-dialog/index.js.map +1 -0
- package/dist/components/date-input/date-input.d.ts +1 -0
- package/dist/components/date-input/date-input.d.ts.map +1 -1
- package/dist/components/date-input/index.d.ts +0 -1
- package/dist/components/date-input/index.d.ts.map +1 -1
- package/dist/components/doc-layout/index.js +5 -4
- package/dist/components/doc-layout/index.js.map +1 -1
- package/dist/components/editor/index.js +4 -3
- package/dist/components/editor/index.js.map +1 -1
- package/dist/components/emoji-picker/index.js +2 -1
- package/dist/components/emoji-picker/index.js.map +1 -1
- package/dist/components/empty-content/empty-content.d.ts.map +1 -1
- package/dist/components/empty-content/index.js +4 -0
- package/dist/components/empty-content/index.js.map +1 -0
- package/dist/components/error-boundary/index.js +6 -0
- package/dist/components/error-boundary/index.js.map +1 -0
- package/dist/components/index.css +13 -10
- package/dist/components/index.css.map +1 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +47 -21
- package/dist/components/index.js.map +1 -1
- package/dist/components/knowledge-graph/edge-labels.d.ts.map +1 -1
- package/dist/components/knowledge-graph/index.js +18 -16
- package/dist/components/knowledge-graph/index.js.map +1 -1
- package/dist/components/label/index.js +5 -0
- package/dist/components/label/index.js.map +1 -0
- package/dist/components/label/label.d.ts.map +1 -1
- package/dist/components/loading-screen/index.js +4 -0
- package/dist/components/loading-screen/index.js.map +1 -0
- package/dist/components/map/MapPointPicker.d.ts.map +1 -1
- package/dist/components/map/index.js +2 -1
- package/dist/components/map/index.js.map +1 -1
- package/dist/components/navigation-progress/index.js +4 -0
- package/dist/components/navigation-progress/index.js.map +1 -0
- package/dist/components/page-content/index.js +4 -0
- package/dist/components/page-content/index.js.map +1 -0
- package/dist/components/popover/index.js +4 -0
- package/dist/components/popover/index.js.map +1 -0
- package/dist/components/research/diagram.d.ts.map +1 -1
- package/dist/components/research/index.js +6 -4
- package/dist/components/research/index.js.map +1 -1
- package/dist/components/research-editor/extensions.d.ts +1 -1
- package/dist/components/research-editor/index.js +11 -10
- package/dist/components/research-editor/index.js.map +1 -1
- package/dist/components/research-editor/math-navigation.d.ts +2 -2
- package/dist/components/research-editor/math-navigation.d.ts.map +1 -1
- package/dist/components/scroll-to-top/index.js +4 -0
- package/dist/components/scroll-to-top/index.js.map +1 -0
- package/dist/components/search-input/index.js +7 -0
- package/dist/components/search-input/index.js.map +1 -0
- package/dist/components/search-input/search-input.d.ts +3 -1
- package/dist/components/search-input/search-input.d.ts.map +1 -1
- package/dist/components/skeleton/index.js +4 -0
- package/dist/components/skeleton/index.js.map +1 -0
- package/dist/components/snackbar/index.js +6 -0
- package/dist/components/snackbar/index.js.map +1 -0
- package/dist/components/stepper/index.js +4 -0
- package/dist/components/stepper/index.js.map +1 -0
- package/dist/components/table/index.d.ts +1 -0
- package/dist/components/table/index.d.ts.map +1 -1
- package/dist/components/table/index.js +5 -0
- package/dist/components/table/index.js.map +1 -0
- package/dist/components/table/table-viewport.d.ts +13 -0
- package/dist/components/table/table-viewport.d.ts.map +1 -0
- package/dist/components/table/table.d.ts +3 -1
- package/dist/components/table/table.d.ts.map +1 -1
- package/dist/components/tabs/index.js +6 -0
- package/dist/components/tabs/index.js.map +1 -0
- package/dist/components/tabs/tabs.d.ts +12 -1
- package/dist/components/tabs/tabs.d.ts.map +1 -1
- package/dist/core/index.js +12 -10
- package/dist/core/index.js.map +1 -1
- package/dist/forms/index.js +2 -0
- package/dist/forms/index.js.map +1 -1
- package/dist/hooks/index.js +14 -12
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/use-config-from-query.d.ts +2 -0
- package/dist/hooks/use-config-from-query.d.ts.map +1 -1
- package/dist/hooks/use-image-dimensions.d.ts.map +1 -1
- package/dist/hooks/use-keyboard-shortcut.d.ts.map +1 -1
- package/dist/hooks/use-scroll-position.d.ts.map +1 -1
- package/dist/hooks/use-window-size.d.ts.map +1 -1
- package/dist/icons/context.d.ts.map +1 -1
- package/dist/icons/index.js +3 -2
- package/dist/icons/index.js.map +1 -1
- package/dist/index.css +13 -10
- package/dist/index.css.map +1 -1
- package/dist/index.js +57 -31
- package/dist/index.js.map +1 -1
- package/dist/internal/research-parser.js +3 -0
- package/dist/internal/research-parser.js.map +1 -0
- package/dist/layouts/core/header-section.d.ts +1 -0
- package/dist/layouts/core/header-section.d.ts.map +1 -1
- package/dist/layouts/dashboard/layout.d.ts +3 -1
- package/dist/layouts/dashboard/layout.d.ts.map +1 -1
- package/dist/layouts/dashboard/sidenav.d.ts.map +1 -1
- package/dist/layouts/index.js +9 -8
- package/dist/layouts/index.js.map +1 -1
- package/dist/netron/index.js +2 -1
- package/dist/netron/index.js.map +1 -1
- package/dist/registry/index.js +1 -1
- package/dist/state/create-store.d.ts.map +1 -1
- package/dist/state/index.js +3 -2
- package/dist/state/index.js.map +1 -1
- package/dist/state/settings-version.d.ts.map +1 -1
- package/dist/theme/components/Chip.d.ts.map +1 -1
- package/dist/theme/components/Dialog.d.ts.map +1 -1
- package/dist/theme/components/TextField.d.ts.map +1 -1
- package/dist/theme/components/index.d.ts.map +1 -1
- package/dist/theme/components/theme-utils.d.ts +2 -2
- package/dist/theme/components/theme-utils.d.ts.map +1 -1
- package/dist/theme/index.js +8 -6
- package/dist/theme/index.js.map +1 -1
- package/dist/theme/palette/overrides.d.ts +1 -0
- package/dist/theme/palette/overrides.d.ts.map +1 -1
- package/dist/theme/semantic-surface.d.ts +8 -0
- package/dist/theme/semantic-surface.d.ts.map +1 -0
- package/dist/types/index.js +2 -2
- package/dist/ui/index.js +6 -5
- package/dist/ui/index.js.map +1 -1
- package/dist/utils/async-lock.d.ts.map +1 -1
- package/package.json +143 -37
- package/dist/chunk-472SOF76.js.map +0 -1
- package/dist/chunk-4Z5DE5GK.js.map +0 -1
- package/dist/chunk-52PQL67Q.js.map +0 -1
- package/dist/chunk-AD4W7HYC.js.map +0 -1
- package/dist/chunk-ADG4HZEP.js.map +0 -1
- package/dist/chunk-BJE2AKD4.js.map +0 -1
- package/dist/chunk-BRDWQVRT.js.map +0 -1
- package/dist/chunk-DRFNMZLG.js.map +0 -1
- package/dist/chunk-FF5RF32O.js.map +0 -1
- package/dist/chunk-FU52GL2E.js +0 -3
- package/dist/chunk-GMIE6III.js.map +0 -1
- package/dist/chunk-JSQTYDPG.js +0 -3
- package/dist/chunk-KQ67XB6T.js.map +0 -1
- package/dist/chunk-LSPFFEJT.js.map +0 -1
- package/dist/chunk-OKTLA23Q.js.map +0 -1
- package/dist/chunk-SNZK5X6F.js.map +0 -1
- package/dist/chunk-SU3LVQ7N.js.map +0 -1
- package/dist/chunk-XIXSSI3B.js.map +0 -1
|
@@ -1,15 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useState, useRef, useEffect, useId, useMemo, useCallback, Component } from 'react';
|
|
3
|
-
import InputBase from '@mui/material/InputBase';
|
|
4
|
-
import InputAdornment from '@mui/material/InputAdornment';
|
|
5
|
-
import Tooltip from '@mui/material/Tooltip';
|
|
6
|
-
import Box8 from '@mui/material/Box';
|
|
7
|
-
import { useTheme, alpha } from '@mui/material/styles';
|
|
8
|
-
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
9
|
-
import Stack from '@mui/material/Stack';
|
|
10
|
-
import Typography3 from '@mui/material/Typography';
|
|
1
|
+
import { useId, useMemo, useRef, useCallback, useState, useEffect } from 'react';
|
|
11
2
|
import { useFormContext, Controller } from 'react-hook-form';
|
|
12
3
|
import TextField from '@mui/material/TextField';
|
|
4
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
13
5
|
import MenuItem from '@mui/material/MenuItem';
|
|
14
6
|
import Checkbox from '@mui/material/Checkbox';
|
|
15
7
|
import FormControlLabel from '@mui/material/FormControlLabel';
|
|
@@ -21,311 +13,26 @@ import Radio from '@mui/material/Radio';
|
|
|
21
13
|
import RadioGroup from '@mui/material/RadioGroup';
|
|
22
14
|
import Autocomplete from '@mui/material/Autocomplete';
|
|
23
15
|
import Chip from '@mui/material/Chip';
|
|
16
|
+
import Box6 from '@mui/material/Box';
|
|
24
17
|
import Rating from '@mui/material/Rating';
|
|
25
18
|
import Slider from '@mui/material/Slider';
|
|
19
|
+
import Typography2 from '@mui/material/Typography';
|
|
26
20
|
import { DatePicker } from '@mui/x-date-pickers/DatePicker';
|
|
27
21
|
import dayjs from 'dayjs';
|
|
28
22
|
import { TimePicker } from '@mui/x-date-pickers/TimePicker';
|
|
29
23
|
import { DateTimePicker } from '@mui/x-date-pickers/DateTimePicker';
|
|
30
24
|
import FormGroup from '@mui/material/FormGroup';
|
|
31
25
|
import { useDropzone } from 'react-dropzone';
|
|
32
|
-
import
|
|
26
|
+
import Stack from '@mui/material/Stack';
|
|
27
|
+
import IconButton from '@mui/material/IconButton';
|
|
33
28
|
import Avatar from '@mui/material/Avatar';
|
|
29
|
+
import { useTheme, alpha } from '@mui/material/styles';
|
|
30
|
+
import InputAdornment from '@mui/material/InputAdornment';
|
|
34
31
|
import Menu from '@mui/material/Menu';
|
|
35
32
|
import ListItemIcon from '@mui/material/ListItemIcon';
|
|
36
33
|
import ListItemText from '@mui/material/ListItemText';
|
|
37
|
-
import Button from '@mui/material/Button';
|
|
38
|
-
import Collapse from '@mui/material/Collapse';
|
|
39
34
|
|
|
40
|
-
|
|
41
|
-
return /* @__PURE__ */ jsx(SearchIcon, { sx: { fontSize: size } });
|
|
42
|
-
}
|
|
43
|
-
function ClearIcon() {
|
|
44
|
-
return /* @__PURE__ */ jsx(CloseIcon, { sx: { fontSize: 16 } });
|
|
45
|
-
}
|
|
46
|
-
function SearchInput({
|
|
47
|
-
value: controlledValue,
|
|
48
|
-
onChange,
|
|
49
|
-
placeholder = "Search...",
|
|
50
|
-
debounce = 0,
|
|
51
|
-
compact = false,
|
|
52
|
-
fullWidth = true,
|
|
53
|
-
width,
|
|
54
|
-
minWidth,
|
|
55
|
-
clearTooltip = "Clear",
|
|
56
|
-
autoFocus,
|
|
57
|
-
onFocus,
|
|
58
|
-
onBlur,
|
|
59
|
-
onKeyDown,
|
|
60
|
-
sx,
|
|
61
|
-
ref
|
|
62
|
-
}) {
|
|
63
|
-
const theme = useTheme();
|
|
64
|
-
const [localValue, setLocalValue] = useState(controlledValue ?? "");
|
|
65
|
-
const timerRef = useRef(void 0);
|
|
66
|
-
useEffect(() => {
|
|
67
|
-
if (controlledValue !== void 0) {
|
|
68
|
-
setLocalValue(controlledValue);
|
|
69
|
-
}
|
|
70
|
-
}, [controlledValue]);
|
|
71
|
-
const displayValue = controlledValue !== void 0 && debounce === 0 ? controlledValue : localValue;
|
|
72
|
-
const handleChange = (e) => {
|
|
73
|
-
const val = e.target.value;
|
|
74
|
-
setLocalValue(val);
|
|
75
|
-
if (debounce > 0) {
|
|
76
|
-
clearTimeout(timerRef.current);
|
|
77
|
-
timerRef.current = setTimeout(() => onChange?.(val), debounce);
|
|
78
|
-
} else {
|
|
79
|
-
onChange?.(val);
|
|
80
|
-
}
|
|
81
|
-
};
|
|
82
|
-
const handleClear = () => {
|
|
83
|
-
setLocalValue("");
|
|
84
|
-
clearTimeout(timerRef.current);
|
|
85
|
-
onChange?.("");
|
|
86
|
-
};
|
|
87
|
-
useEffect(() => () => clearTimeout(timerRef.current), []);
|
|
88
|
-
const py = compact ? 0.625 : 0.75;
|
|
89
|
-
const px = compact ? 1.25 : 1.5;
|
|
90
|
-
const inputPy = compact ? "3px" : "4px";
|
|
91
|
-
return /* @__PURE__ */ jsx(
|
|
92
|
-
InputBase,
|
|
93
|
-
{
|
|
94
|
-
ref,
|
|
95
|
-
fullWidth,
|
|
96
|
-
placeholder,
|
|
97
|
-
value: displayValue,
|
|
98
|
-
onChange: handleChange,
|
|
99
|
-
autoFocus,
|
|
100
|
-
onFocus,
|
|
101
|
-
onBlur,
|
|
102
|
-
onKeyDown,
|
|
103
|
-
startAdornment: /* @__PURE__ */ jsx(InputAdornment, { position: "start", sx: { color: "text.disabled", mr: compact ? 0.75 : 1 }, children: /* @__PURE__ */ jsx(SearchIcon2, { size: compact ? 16 : 18 }) }),
|
|
104
|
-
endAdornment: displayValue ? /* @__PURE__ */ jsx(InputAdornment, { position: "end", children: /* @__PURE__ */ jsx(Tooltip, { title: clearTooltip, children: /* @__PURE__ */ jsx(
|
|
105
|
-
Box8,
|
|
106
|
-
{
|
|
107
|
-
component: "button",
|
|
108
|
-
type: "button",
|
|
109
|
-
onClick: handleClear,
|
|
110
|
-
sx: {
|
|
111
|
-
p: 0.25,
|
|
112
|
-
border: "none",
|
|
113
|
-
background: "none",
|
|
114
|
-
cursor: "pointer",
|
|
115
|
-
color: "text.disabled",
|
|
116
|
-
display: "flex",
|
|
117
|
-
alignItems: "center",
|
|
118
|
-
borderRadius: "50%",
|
|
119
|
-
"&:hover": { color: "text.secondary" }
|
|
120
|
-
},
|
|
121
|
-
children: /* @__PURE__ */ jsx(ClearIcon, {})
|
|
122
|
-
}
|
|
123
|
-
) }) }) : null,
|
|
124
|
-
sx: {
|
|
125
|
-
px,
|
|
126
|
-
py,
|
|
127
|
-
borderRadius: 1,
|
|
128
|
-
fontSize: "0.875rem",
|
|
129
|
-
bgcolor: alpha(theme.palette.grey[500], 0.08),
|
|
130
|
-
transition: theme.transitions.create(["background-color"], {
|
|
131
|
-
duration: theme.transitions.duration.shorter
|
|
132
|
-
}),
|
|
133
|
-
"&:hover": {
|
|
134
|
-
bgcolor: alpha(theme.palette.grey[500], 0.12)
|
|
135
|
-
},
|
|
136
|
-
"&.Mui-focused": {
|
|
137
|
-
bgcolor: alpha(theme.palette.grey[500], 0.16)
|
|
138
|
-
},
|
|
139
|
-
"& .MuiInputBase-input": {
|
|
140
|
-
py: inputPy,
|
|
141
|
-
px: 0,
|
|
142
|
-
overflow: "visible",
|
|
143
|
-
"&::placeholder": {
|
|
144
|
-
opacity: 0.64
|
|
145
|
-
}
|
|
146
|
-
},
|
|
147
|
-
...width != null && { width },
|
|
148
|
-
...minWidth != null && { minWidth },
|
|
149
|
-
...!fullWidth && { width: width ?? "auto" },
|
|
150
|
-
...Array.isArray(sx) ? Object.assign({}, ...sx) : sx
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
);
|
|
154
|
-
}
|
|
155
|
-
function IconWrapper({ icon, color = "primary.main", size = 64 }) {
|
|
156
|
-
return /* @__PURE__ */ jsx(
|
|
157
|
-
Box8,
|
|
158
|
-
{
|
|
159
|
-
sx: {
|
|
160
|
-
width: size,
|
|
161
|
-
height: size,
|
|
162
|
-
borderRadius: "50%",
|
|
163
|
-
display: "flex",
|
|
164
|
-
alignItems: "center",
|
|
165
|
-
justifyContent: "center",
|
|
166
|
-
bgcolor: (theme) => {
|
|
167
|
-
const parts = color.split(".");
|
|
168
|
-
let resolved = theme.palette;
|
|
169
|
-
for (const part of parts) {
|
|
170
|
-
resolved = resolved?.[part];
|
|
171
|
-
}
|
|
172
|
-
return typeof resolved === "string" ? alpha(resolved, 0.08) : alpha(theme.palette.primary.main, 0.08);
|
|
173
|
-
}
|
|
174
|
-
},
|
|
175
|
-
children: icon
|
|
176
|
-
}
|
|
177
|
-
);
|
|
178
|
-
}
|
|
179
|
-
function EmptyContent({
|
|
180
|
-
illustration,
|
|
181
|
-
icon,
|
|
182
|
-
iconColor = "primary.main",
|
|
183
|
-
iconSize = 64,
|
|
184
|
-
title = "No data",
|
|
185
|
-
description,
|
|
186
|
-
action,
|
|
187
|
-
actions,
|
|
188
|
-
maxWidth = 400,
|
|
189
|
-
filled = false,
|
|
190
|
-
sx,
|
|
191
|
-
illustrationSx,
|
|
192
|
-
slotProps,
|
|
193
|
-
compact = false
|
|
194
|
-
}) {
|
|
195
|
-
const visual = icon ? /* @__PURE__ */ jsx(IconWrapper, { icon, color: iconColor, size: iconSize }) : illustration ? /* @__PURE__ */ jsx(Box8, { sx: illustrationSx, children: illustration }) : null;
|
|
196
|
-
const allActions = [...actions ?? [], ...action ? [action] : []];
|
|
197
|
-
return /* @__PURE__ */ jsx(
|
|
198
|
-
Stack,
|
|
199
|
-
{
|
|
200
|
-
sx: {
|
|
201
|
-
alignItems: "center",
|
|
202
|
-
justifyContent: "center",
|
|
203
|
-
textAlign: "center",
|
|
204
|
-
py: compact ? 4 : 8,
|
|
205
|
-
px: 2,
|
|
206
|
-
// Default non-compact behavior: vertically center inside the
|
|
207
|
-
// available "main content" area. Two complementary anchors:
|
|
208
|
-
// * `flex: 1, alignSelf: 'stretch'` — when the parent IS a
|
|
209
|
-
// flex column with explicit height (DashboardLayout main,
|
|
210
|
-
// full-height page wrappers), EmptyContent grows to fill
|
|
211
|
-
// the column and the inner `justifyContent: center` puts
|
|
212
|
-
// the message in the middle of that column.
|
|
213
|
-
// * `minHeight: calc(100vh - 240px)` — fallback for the
|
|
214
|
-
// common case where the page wrapper is just a content-
|
|
215
|
-
// sized `<Stack>` or `<Box>`. 240px is the typical
|
|
216
|
-
// vertical chrome (header ~64 + breadcrumbs ~60 + page
|
|
217
|
-
// padding ~80 + a small margin), so this leaves enough
|
|
218
|
-
// space below the breadcrumbs for the message to sit at
|
|
219
|
-
// the optical center of the visible viewport.
|
|
220
|
-
//
|
|
221
|
-
// `compact` keeps the inline-sized behavior for callers that
|
|
222
|
-
// drop EmptyContent inside a card cell or sidebar.
|
|
223
|
-
// `filled` is the explicit "fill my parent" mode and shares
|
|
224
|
-
// the same fallback so the visual is consistent.
|
|
225
|
-
...!compact && {
|
|
226
|
-
flex: 1,
|
|
227
|
-
alignSelf: "stretch",
|
|
228
|
-
minHeight: "calc(100vh - 240px)"
|
|
229
|
-
},
|
|
230
|
-
...filled && { height: "100%" },
|
|
231
|
-
...sx
|
|
232
|
-
},
|
|
233
|
-
children: /* @__PURE__ */ jsxs(
|
|
234
|
-
Box8,
|
|
235
|
-
{
|
|
236
|
-
sx: {
|
|
237
|
-
maxWidth,
|
|
238
|
-
display: "flex",
|
|
239
|
-
flexDirection: "column",
|
|
240
|
-
alignItems: "center",
|
|
241
|
-
gap: compact ? 1.5 : 2.5
|
|
242
|
-
},
|
|
243
|
-
children: [
|
|
244
|
-
visual,
|
|
245
|
-
/* @__PURE__ */ jsxs(Stack, { spacing: 0.5, sx: {
|
|
246
|
-
alignItems: "center"
|
|
247
|
-
}, children: [
|
|
248
|
-
title && /* @__PURE__ */ jsx(
|
|
249
|
-
Typography3,
|
|
250
|
-
{
|
|
251
|
-
variant: compact ? "subtitle1" : "h6",
|
|
252
|
-
sx: {
|
|
253
|
-
color: "text.secondary",
|
|
254
|
-
fontWeight: 600,
|
|
255
|
-
...slotProps?.title
|
|
256
|
-
},
|
|
257
|
-
children: title
|
|
258
|
-
}
|
|
259
|
-
),
|
|
260
|
-
description && /* @__PURE__ */ jsx(
|
|
261
|
-
Typography3,
|
|
262
|
-
{
|
|
263
|
-
variant: "body2",
|
|
264
|
-
sx: {
|
|
265
|
-
color: "text.disabled",
|
|
266
|
-
lineHeight: 1.6,
|
|
267
|
-
...slotProps?.description
|
|
268
|
-
},
|
|
269
|
-
children: description
|
|
270
|
-
}
|
|
271
|
-
)
|
|
272
|
-
] }),
|
|
273
|
-
allActions.length > 0 && /* @__PURE__ */ jsx(
|
|
274
|
-
Stack,
|
|
275
|
-
{
|
|
276
|
-
direction: "row",
|
|
277
|
-
spacing: 1,
|
|
278
|
-
sx: { mt: compact ? 0.5 : 1, flexWrap: "wrap", justifyContent: "center", ...slotProps?.actions },
|
|
279
|
-
children: allActions.map((a, i) => /* @__PURE__ */ jsx(Box8, { children: a }, i))
|
|
280
|
-
}
|
|
281
|
-
)
|
|
282
|
-
]
|
|
283
|
-
}
|
|
284
|
-
)
|
|
285
|
-
}
|
|
286
|
-
);
|
|
287
|
-
}
|
|
288
|
-
function SearchEmptyContent({
|
|
289
|
-
query,
|
|
290
|
-
...props
|
|
291
|
-
}) {
|
|
292
|
-
return /* @__PURE__ */ jsx(
|
|
293
|
-
EmptyContent,
|
|
294
|
-
{
|
|
295
|
-
title: "No results found",
|
|
296
|
-
description: query ? `Your search for "${query}" did not match any results.` : "Try adjusting your search criteria.",
|
|
297
|
-
...props
|
|
298
|
-
}
|
|
299
|
-
);
|
|
300
|
-
}
|
|
301
|
-
function LoadingEmptyContent({ ...props }) {
|
|
302
|
-
return /* @__PURE__ */ jsx(
|
|
303
|
-
EmptyContent,
|
|
304
|
-
{
|
|
305
|
-
title: "Loading...",
|
|
306
|
-
illustration: /* @__PURE__ */ jsx(
|
|
307
|
-
Box8,
|
|
308
|
-
{
|
|
309
|
-
sx: {
|
|
310
|
-
width: 64,
|
|
311
|
-
height: 64,
|
|
312
|
-
borderRadius: "50%",
|
|
313
|
-
border: "3px solid",
|
|
314
|
-
borderColor: "divider",
|
|
315
|
-
borderTopColor: "primary.main",
|
|
316
|
-
animation: "spin 1s linear infinite",
|
|
317
|
-
"@keyframes spin": {
|
|
318
|
-
from: { transform: "rotate(0deg)" },
|
|
319
|
-
to: { transform: "rotate(360deg)" }
|
|
320
|
-
}
|
|
321
|
-
}
|
|
322
|
-
}
|
|
323
|
-
),
|
|
324
|
-
compact: true,
|
|
325
|
-
...props
|
|
326
|
-
}
|
|
327
|
-
);
|
|
328
|
-
}
|
|
35
|
+
// src/components/field/field-text.tsx
|
|
329
36
|
function FieldText({
|
|
330
37
|
name,
|
|
331
38
|
helperText,
|
|
@@ -984,7 +691,7 @@ function FieldRating({
|
|
|
984
691
|
const hasHelper = !!(error?.message || helperText);
|
|
985
692
|
return /* @__PURE__ */ jsxs(FormControl8, { error: !!error, ...formControlProps, children: [
|
|
986
693
|
label && /* @__PURE__ */ jsx(FormLabel6, { id: labelId, sx: { mb: 1 }, children: label }),
|
|
987
|
-
/* @__PURE__ */ jsxs(
|
|
694
|
+
/* @__PURE__ */ jsxs(Box6, { sx: { display: "flex", alignItems: "center", gap: 1 }, children: [
|
|
988
695
|
/* @__PURE__ */ jsx(
|
|
989
696
|
Rating,
|
|
990
697
|
{
|
|
@@ -1003,7 +710,7 @@ function FieldRating({
|
|
|
1003
710
|
}
|
|
1004
711
|
),
|
|
1005
712
|
showValue && /* @__PURE__ */ jsxs(
|
|
1006
|
-
|
|
713
|
+
Box6,
|
|
1007
714
|
{
|
|
1008
715
|
component: "span",
|
|
1009
716
|
sx: {
|
|
@@ -1056,9 +763,9 @@ function FieldSlider({
|
|
|
1056
763
|
render: ({ field, fieldState: { error } }) => {
|
|
1057
764
|
const hasHelper = !!(error?.message || helperText);
|
|
1058
765
|
return /* @__PURE__ */ jsxs(FormControl8, { error: !!error, fullWidth: true, ...formControlProps, children: [
|
|
1059
|
-
(label || showValue) && /* @__PURE__ */ jsxs(
|
|
766
|
+
(label || showValue) && /* @__PURE__ */ jsxs(Box6, { sx: { display: "flex", justifyContent: "space-between", alignItems: "center", mb: 1 }, children: [
|
|
1060
767
|
label && /* @__PURE__ */ jsx(FormLabel6, { id: labelId, children: label }),
|
|
1061
|
-
showValue && /* @__PURE__ */ jsx(
|
|
768
|
+
showValue && /* @__PURE__ */ jsx(Typography2, { variant: "body2", sx: {
|
|
1062
769
|
color: "text.secondary"
|
|
1063
770
|
}, children: displayValue(field.value ?? (Array.isArray(other.defaultValue) ? [min, max] : min)) })
|
|
1064
771
|
] }),
|
|
@@ -1344,7 +1051,7 @@ function FieldMultiCheckbox({
|
|
|
1344
1051
|
children: label
|
|
1345
1052
|
}
|
|
1346
1053
|
),
|
|
1347
|
-
/* @__PURE__ */ jsx(
|
|
1054
|
+
/* @__PURE__ */ jsx(Box6, { ...slotProps?.container, children: /* @__PURE__ */ jsx(FormGroup, { row, ...other, children: options.map((option) => /* @__PURE__ */ jsx(
|
|
1348
1055
|
FormControlLabel,
|
|
1349
1056
|
{
|
|
1350
1057
|
label: option.label,
|
|
@@ -1413,7 +1120,7 @@ function FieldMultiSwitch({
|
|
|
1413
1120
|
children: label
|
|
1414
1121
|
}
|
|
1415
1122
|
),
|
|
1416
|
-
/* @__PURE__ */ jsx(
|
|
1123
|
+
/* @__PURE__ */ jsx(Box6, { ...slotProps?.container, children: /* @__PURE__ */ jsx(FormGroup, { row, ...other, children: options.map((option) => /* @__PURE__ */ jsx(
|
|
1417
1124
|
FormControlLabel,
|
|
1418
1125
|
{
|
|
1419
1126
|
label: option.label,
|
|
@@ -1524,9 +1231,9 @@ function FieldCode({
|
|
|
1524
1231
|
}
|
|
1525
1232
|
};
|
|
1526
1233
|
const hasHelper = !!(error?.message || helperText);
|
|
1527
|
-
return /* @__PURE__ */ jsxs(
|
|
1234
|
+
return /* @__PURE__ */ jsxs(Box6, { role: "group", "aria-label": `${name} code input`, ...slotProps?.wrapper, children: [
|
|
1528
1235
|
/* @__PURE__ */ jsx(
|
|
1529
|
-
|
|
1236
|
+
Box6,
|
|
1530
1237
|
{
|
|
1531
1238
|
sx: {
|
|
1532
1239
|
display: "flex",
|
|
@@ -1627,7 +1334,7 @@ function UploadPlaceholder({ isDragActive, disabled }) {
|
|
|
1627
1334
|
},
|
|
1628
1335
|
children: [
|
|
1629
1336
|
/* @__PURE__ */ jsx(
|
|
1630
|
-
|
|
1337
|
+
Box6,
|
|
1631
1338
|
{
|
|
1632
1339
|
component: "span",
|
|
1633
1340
|
sx: {
|
|
@@ -1644,10 +1351,10 @@ function UploadPlaceholder({ isDragActive, disabled }) {
|
|
|
1644
1351
|
children: "\u{1F4C1}"
|
|
1645
1352
|
}
|
|
1646
1353
|
),
|
|
1647
|
-
/* @__PURE__ */ jsx(
|
|
1354
|
+
/* @__PURE__ */ jsx(Typography2, { variant: "body2", component: "span", children: isDragActive ? "Drop files here" : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1648
1355
|
"Drag & drop files here, or",
|
|
1649
1356
|
" ",
|
|
1650
|
-
/* @__PURE__ */ jsx(
|
|
1357
|
+
/* @__PURE__ */ jsx(Typography2, { component: "span", variant: "body2", sx: { color: "primary.main", textDecoration: "underline" }, children: "browse" })
|
|
1651
1358
|
] }) })
|
|
1652
1359
|
]
|
|
1653
1360
|
}
|
|
@@ -1660,7 +1367,7 @@ function FilePreview({ files, thumbnail, onRemove }) {
|
|
|
1660
1367
|
const fileName = getFileName(file);
|
|
1661
1368
|
const fileSize = file instanceof File ? formatFileSize(file.size) : "";
|
|
1662
1369
|
return /* @__PURE__ */ jsxs(
|
|
1663
|
-
|
|
1370
|
+
Box6,
|
|
1664
1371
|
{
|
|
1665
1372
|
sx: {
|
|
1666
1373
|
p: 1,
|
|
@@ -1674,7 +1381,7 @@ function FilePreview({ files, thumbnail, onRemove }) {
|
|
|
1674
1381
|
},
|
|
1675
1382
|
children: [
|
|
1676
1383
|
previewUrl && /* @__PURE__ */ jsx(
|
|
1677
|
-
|
|
1384
|
+
Box6,
|
|
1678
1385
|
{
|
|
1679
1386
|
component: "img",
|
|
1680
1387
|
src: previewUrl,
|
|
@@ -1688,14 +1395,14 @@ function FilePreview({ files, thumbnail, onRemove }) {
|
|
|
1688
1395
|
}
|
|
1689
1396
|
}
|
|
1690
1397
|
),
|
|
1691
|
-
/* @__PURE__ */ jsxs(
|
|
1692
|
-
/* @__PURE__ */ jsx(
|
|
1693
|
-
fileSize && /* @__PURE__ */ jsx(
|
|
1398
|
+
/* @__PURE__ */ jsxs(Box6, { sx: { flexGrow: 1, minWidth: 0 }, children: [
|
|
1399
|
+
/* @__PURE__ */ jsx(Typography2, { variant: "body2", noWrap: true, children: fileName }),
|
|
1400
|
+
fileSize && /* @__PURE__ */ jsx(Typography2, { variant: "caption", sx: {
|
|
1694
1401
|
color: "text.secondary"
|
|
1695
1402
|
}, children: fileSize })
|
|
1696
1403
|
] }),
|
|
1697
1404
|
onRemove && /* @__PURE__ */ jsx(
|
|
1698
|
-
|
|
1405
|
+
IconButton,
|
|
1699
1406
|
{
|
|
1700
1407
|
size: "small",
|
|
1701
1408
|
onClick: () => onRemove(file),
|
|
@@ -1712,8 +1419,8 @@ function FilePreview({ files, thumbnail, onRemove }) {
|
|
|
1712
1419
|
}
|
|
1713
1420
|
function RejectionFiles({ rejections }) {
|
|
1714
1421
|
if (rejections.length === 0) return null;
|
|
1715
|
-
return /* @__PURE__ */ jsx(
|
|
1716
|
-
|
|
1422
|
+
return /* @__PURE__ */ jsx(Box6, { sx: { mt: 2 }, children: rejections.map(({ file, errors }) => /* @__PURE__ */ jsxs(
|
|
1423
|
+
Box6,
|
|
1717
1424
|
{
|
|
1718
1425
|
sx: {
|
|
1719
1426
|
p: 1,
|
|
@@ -1724,8 +1431,8 @@ function RejectionFiles({ rejections }) {
|
|
|
1724
1431
|
borderColor: "error.light"
|
|
1725
1432
|
},
|
|
1726
1433
|
children: [
|
|
1727
|
-
/* @__PURE__ */ jsx(
|
|
1728
|
-
errors.map((error) => /* @__PURE__ */ jsx(
|
|
1434
|
+
/* @__PURE__ */ jsx(Typography2, { variant: "body2", color: "error", children: file.name }),
|
|
1435
|
+
errors.map((error) => /* @__PURE__ */ jsx(Typography2, { variant: "caption", color: "error", children: error.message }, error.code))
|
|
1729
1436
|
]
|
|
1730
1437
|
},
|
|
1731
1438
|
file.name
|
|
@@ -1785,9 +1492,9 @@ function FieldUploadInner({
|
|
|
1785
1492
|
});
|
|
1786
1493
|
const hasError = !!error;
|
|
1787
1494
|
const hasFiles = files.length > 0;
|
|
1788
|
-
return /* @__PURE__ */ jsxs(
|
|
1495
|
+
return /* @__PURE__ */ jsxs(Box6, { ...slotProps?.wrapper, children: [
|
|
1789
1496
|
/* @__PURE__ */ jsxs(
|
|
1790
|
-
|
|
1497
|
+
Box6,
|
|
1791
1498
|
{
|
|
1792
1499
|
...getRootProps(),
|
|
1793
1500
|
sx: {
|
|
@@ -1814,8 +1521,8 @@ function FieldUploadInner({
|
|
|
1814
1521
|
),
|
|
1815
1522
|
/* @__PURE__ */ jsx(RejectionFiles, { rejections }),
|
|
1816
1523
|
/* @__PURE__ */ jsx(FilePreview, { files, thumbnail, onRemove: handleRemove }),
|
|
1817
|
-
hasFiles && multiple && onRemoveAll && /* @__PURE__ */ jsx(
|
|
1818
|
-
|
|
1524
|
+
hasFiles && multiple && onRemoveAll && /* @__PURE__ */ jsx(Box6, { sx: { mt: 1, textAlign: "right" }, children: /* @__PURE__ */ jsx(
|
|
1525
|
+
Typography2,
|
|
1819
1526
|
{
|
|
1820
1527
|
component: "button",
|
|
1821
1528
|
variant: "caption",
|
|
@@ -1902,9 +1609,9 @@ function FieldUploadBoxInner({
|
|
|
1902
1609
|
});
|
|
1903
1610
|
const previewUrl = value ? getPreviewUrl(value) : null;
|
|
1904
1611
|
const hasError = !!error;
|
|
1905
|
-
return /* @__PURE__ */ jsxs(
|
|
1612
|
+
return /* @__PURE__ */ jsxs(Box6, { children: [
|
|
1906
1613
|
/* @__PURE__ */ jsxs(
|
|
1907
|
-
|
|
1614
|
+
Box6,
|
|
1908
1615
|
{
|
|
1909
1616
|
...getRootProps(),
|
|
1910
1617
|
sx: {
|
|
@@ -1930,7 +1637,7 @@ function FieldUploadBoxInner({
|
|
|
1930
1637
|
children: [
|
|
1931
1638
|
/* @__PURE__ */ jsx("input", { ...getInputProps() }),
|
|
1932
1639
|
!previewUrl && /* @__PURE__ */ jsx(
|
|
1933
|
-
|
|
1640
|
+
Typography2,
|
|
1934
1641
|
{
|
|
1935
1642
|
sx: {
|
|
1936
1643
|
fontSize: size / 3,
|
|
@@ -2005,9 +1712,9 @@ function FieldUploadAvatarInner({
|
|
|
2005
1712
|
});
|
|
2006
1713
|
const previewUrl = value ? getPreviewUrl(value) : null;
|
|
2007
1714
|
const hasError = !!error;
|
|
2008
|
-
return /* @__PURE__ */ jsxs(
|
|
1715
|
+
return /* @__PURE__ */ jsxs(Box6, { sx: { display: "inline-flex", flexDirection: "column", alignItems: "center" }, children: [
|
|
2009
1716
|
/* @__PURE__ */ jsxs(
|
|
2010
|
-
|
|
1717
|
+
Box6,
|
|
2011
1718
|
{
|
|
2012
1719
|
...getRootProps(),
|
|
2013
1720
|
sx: {
|
|
@@ -2036,11 +1743,11 @@ function FieldUploadAvatarInner({
|
|
|
2036
1743
|
height: "100%",
|
|
2037
1744
|
bgcolor: "background.neutral"
|
|
2038
1745
|
},
|
|
2039
|
-
children: !previewUrl && /* @__PURE__ */ jsx(
|
|
1746
|
+
children: !previewUrl && /* @__PURE__ */ jsx(Typography2, { sx: { fontSize: size / 4, color: "text.disabled" }, children: "\u{1F4F7}" })
|
|
2040
1747
|
}
|
|
2041
1748
|
),
|
|
2042
1749
|
/* @__PURE__ */ jsxs(
|
|
2043
|
-
|
|
1750
|
+
Box6,
|
|
2044
1751
|
{
|
|
2045
1752
|
className: "upload-overlay",
|
|
2046
1753
|
sx: {
|
|
@@ -2056,8 +1763,8 @@ function FieldUploadAvatarInner({
|
|
|
2056
1763
|
transition: theme.transitions.create("opacity")
|
|
2057
1764
|
},
|
|
2058
1765
|
children: [
|
|
2059
|
-
/* @__PURE__ */ jsx(
|
|
2060
|
-
/* @__PURE__ */ jsx(
|
|
1766
|
+
/* @__PURE__ */ jsx(Typography2, { sx: { fontSize: size / 6 }, children: "\u{1F4F7}" }),
|
|
1767
|
+
/* @__PURE__ */ jsx(Typography2, { variant: "caption", children: previewUrl ? "Update" : "Upload" })
|
|
2061
1768
|
]
|
|
2062
1769
|
}
|
|
2063
1770
|
)
|
|
@@ -2240,7 +1947,7 @@ function FieldPhone({
|
|
|
2240
1947
|
input: {
|
|
2241
1948
|
startAdornment: !hideCountrySelect && /* @__PURE__ */ jsxs(InputAdornment, { position: "start", children: [
|
|
2242
1949
|
/* @__PURE__ */ jsx(
|
|
2243
|
-
|
|
1950
|
+
IconButton,
|
|
2244
1951
|
{
|
|
2245
1952
|
ref: anchorRef,
|
|
2246
1953
|
onClick: handleOpenMenu,
|
|
@@ -2252,7 +1959,7 @@ function FieldPhone({
|
|
|
2252
1959
|
"aria-expanded": menuOpen,
|
|
2253
1960
|
sx: { mr: -0.5 },
|
|
2254
1961
|
children: /* @__PURE__ */ jsx(
|
|
2255
|
-
|
|
1962
|
+
Box6,
|
|
2256
1963
|
{
|
|
2257
1964
|
component: "span",
|
|
2258
1965
|
sx: {
|
|
@@ -2267,7 +1974,7 @@ function FieldPhone({
|
|
|
2267
1974
|
}
|
|
2268
1975
|
),
|
|
2269
1976
|
/* @__PURE__ */ jsx(
|
|
2270
|
-
|
|
1977
|
+
Typography2,
|
|
2271
1978
|
{
|
|
2272
1979
|
variant: "body2",
|
|
2273
1980
|
sx: {
|
|
@@ -2563,7 +2270,7 @@ function FieldCountrySelect({
|
|
|
2563
2270
|
isOptionEqualToValue: (option, value) => option.code === value.code,
|
|
2564
2271
|
renderOption: (props, option) => {
|
|
2565
2272
|
const { key, ...optionProps } = props;
|
|
2566
|
-
return /* @__PURE__ */ jsxs(
|
|
2273
|
+
return /* @__PURE__ */ jsxs(Box6, { component: "li", sx: { "& > span": { mr: 1.5, flexShrink: 0 } }, ...optionProps, children: [
|
|
2567
2274
|
/* @__PURE__ */ jsx("span", { style: { fontSize: "1.25rem" }, children: option.flag }),
|
|
2568
2275
|
option.label,
|
|
2569
2276
|
" (",
|
|
@@ -2815,287 +2522,7 @@ var Field = {
|
|
|
2815
2522
|
/** Headless editor field with render prop */
|
|
2816
2523
|
CustomEditor: FieldCustomEditor
|
|
2817
2524
|
};
|
|
2818
|
-
function parseStackFrame(line) {
|
|
2819
|
-
const patterns = [
|
|
2820
|
-
// Named function with file: at functionName (file:line:col)
|
|
2821
|
-
// Also covers the bundler-rewritten form `(file?v=hash:line:col)`: the
|
|
2822
|
-
// lazy `(.+?)` swallows the query string, which `cleanFilePath` strips.
|
|
2823
|
-
/at\s+(?:async\s+)?([^\s(]+)\s+\((.+?):(\d+):(\d+)\)/,
|
|
2824
|
-
// Anonymous at file: at file:line:col
|
|
2825
|
-
/at\s+(.+?):(\d+):(\d+)/
|
|
2826
|
-
];
|
|
2827
|
-
for (const pattern of patterns) {
|
|
2828
|
-
const match = line.match(pattern);
|
|
2829
|
-
if (match) {
|
|
2830
|
-
const [, funcOrFile, file, lineStr, colStr] = match;
|
|
2831
|
-
const hasFile = colStr !== void 0;
|
|
2832
|
-
const functionName = hasFile ? funcOrFile : null;
|
|
2833
|
-
const filePath = hasFile ? file : funcOrFile;
|
|
2834
|
-
const lineNumber = parseInt(hasFile ? lineStr : file, 10);
|
|
2835
|
-
const columnNumber = parseInt(hasFile ? colStr : lineStr, 10);
|
|
2836
|
-
const isAppCode = !filePath.includes("node_modules") && filePath.includes("src/");
|
|
2837
|
-
return {
|
|
2838
|
-
functionName: functionName || null,
|
|
2839
|
-
filePath: cleanFilePath(filePath),
|
|
2840
|
-
lineNumber: isNaN(lineNumber) ? null : lineNumber,
|
|
2841
|
-
columnNumber: isNaN(columnNumber) ? null : columnNumber,
|
|
2842
|
-
isAppCode
|
|
2843
|
-
};
|
|
2844
|
-
}
|
|
2845
|
-
}
|
|
2846
|
-
return null;
|
|
2847
|
-
}
|
|
2848
|
-
function cleanFilePath(path) {
|
|
2849
|
-
const cleaned = path.replace(/\?.*$/, "");
|
|
2850
|
-
const srcIndex = cleaned.indexOf("/src/");
|
|
2851
|
-
if (srcIndex !== -1) {
|
|
2852
|
-
return cleaned.slice(srcIndex + 1);
|
|
2853
|
-
}
|
|
2854
|
-
const parts = cleaned.split("/");
|
|
2855
|
-
if (parts.length > 3) {
|
|
2856
|
-
return parts.slice(-3).join("/");
|
|
2857
|
-
}
|
|
2858
|
-
return cleaned;
|
|
2859
|
-
}
|
|
2860
|
-
function parseStackTrace(stack) {
|
|
2861
|
-
if (!stack) {
|
|
2862
|
-
return { primary: null, frames: [], raw: "" };
|
|
2863
|
-
}
|
|
2864
|
-
const lines = stack.split("\n");
|
|
2865
|
-
const frames = [];
|
|
2866
|
-
for (const line of lines) {
|
|
2867
|
-
const frame = parseStackFrame(line.trim());
|
|
2868
|
-
if (frame) {
|
|
2869
|
-
frames.push(frame);
|
|
2870
|
-
}
|
|
2871
|
-
}
|
|
2872
|
-
const primary = frames.find((f) => f.isAppCode) ?? frames[0] ?? null;
|
|
2873
|
-
return { primary, frames, raw: stack };
|
|
2874
|
-
}
|
|
2875
|
-
function getErrorLocation(error) {
|
|
2876
|
-
const parsed = parseStackTrace(error.stack);
|
|
2877
|
-
const { primary } = parsed;
|
|
2878
|
-
if (!primary) {
|
|
2879
|
-
return "Unknown location";
|
|
2880
|
-
}
|
|
2881
|
-
const parts = [];
|
|
2882
|
-
if (primary.functionName) {
|
|
2883
|
-
parts.push(`in ${primary.functionName}`);
|
|
2884
|
-
}
|
|
2885
|
-
if (primary.filePath) {
|
|
2886
|
-
const location = primary.lineNumber ? `${primary.filePath}:${primary.lineNumber}` : primary.filePath;
|
|
2887
|
-
parts.push(`(${location})`);
|
|
2888
|
-
}
|
|
2889
|
-
return parts.join(" ") || "Unknown location";
|
|
2890
|
-
}
|
|
2891
|
-
function DefaultErrorFallback({
|
|
2892
|
-
error,
|
|
2893
|
-
parsedStack,
|
|
2894
|
-
resetErrorBoundary,
|
|
2895
|
-
sx,
|
|
2896
|
-
showDetails
|
|
2897
|
-
}) {
|
|
2898
|
-
const [expanded, setExpanded] = useState(false);
|
|
2899
|
-
const [copied, setCopied] = useState(false);
|
|
2900
|
-
const shouldShowDetails = showDetails ?? (typeof process !== "undefined" && process.env.NODE_ENV === "development");
|
|
2901
|
-
const handleCopyStack = async () => {
|
|
2902
|
-
try {
|
|
2903
|
-
const text = [
|
|
2904
|
-
`Error: ${error.message}`,
|
|
2905
|
-
`Location: ${getErrorLocation(error)}`,
|
|
2906
|
-
"",
|
|
2907
|
-
"Stack Trace:",
|
|
2908
|
-
parsedStack.raw
|
|
2909
|
-
].join("\n");
|
|
2910
|
-
await navigator.clipboard.writeText(text);
|
|
2911
|
-
setCopied(true);
|
|
2912
|
-
setTimeout(() => setCopied(false), 2e3);
|
|
2913
|
-
} catch {
|
|
2914
|
-
}
|
|
2915
|
-
};
|
|
2916
|
-
return /* @__PURE__ */ jsxs(
|
|
2917
|
-
Box8,
|
|
2918
|
-
{
|
|
2919
|
-
sx: {
|
|
2920
|
-
display: "flex",
|
|
2921
|
-
flexDirection: "column",
|
|
2922
|
-
alignItems: "center",
|
|
2923
|
-
justifyContent: "center",
|
|
2924
|
-
minHeight: 200,
|
|
2925
|
-
p: 3,
|
|
2926
|
-
textAlign: "center",
|
|
2927
|
-
...sx
|
|
2928
|
-
},
|
|
2929
|
-
children: [
|
|
2930
|
-
/* @__PURE__ */ jsx(Typography3, { variant: "h6", color: "error", gutterBottom: true, children: "Something went wrong" }),
|
|
2931
|
-
/* @__PURE__ */ jsx(
|
|
2932
|
-
Typography3,
|
|
2933
|
-
{
|
|
2934
|
-
variant: "body2",
|
|
2935
|
-
sx: {
|
|
2936
|
-
color: "text.secondary",
|
|
2937
|
-
mb: 1,
|
|
2938
|
-
maxWidth: 400
|
|
2939
|
-
},
|
|
2940
|
-
children: error.message || "An unexpected error occurred"
|
|
2941
|
-
}
|
|
2942
|
-
),
|
|
2943
|
-
shouldShowDetails && parsedStack.primary && /* @__PURE__ */ jsxs(
|
|
2944
|
-
Typography3,
|
|
2945
|
-
{
|
|
2946
|
-
variant: "caption",
|
|
2947
|
-
sx: {
|
|
2948
|
-
color: "text.secondary",
|
|
2949
|
-
mb: 2,
|
|
2950
|
-
fontFamily: "monospace"
|
|
2951
|
-
},
|
|
2952
|
-
children: [
|
|
2953
|
-
parsedStack.primary.filePath,
|
|
2954
|
-
parsedStack.primary.lineNumber && `:${parsedStack.primary.lineNumber}`,
|
|
2955
|
-
parsedStack.primary.functionName && ` (${parsedStack.primary.functionName})`
|
|
2956
|
-
]
|
|
2957
|
-
}
|
|
2958
|
-
),
|
|
2959
|
-
/* @__PURE__ */ jsxs(Box8, { sx: { display: "flex", gap: 1, mb: 2 }, children: [
|
|
2960
|
-
/* @__PURE__ */ jsx(Button, { variant: "outlined", onClick: resetErrorBoundary, children: "Try Again" }),
|
|
2961
|
-
shouldShowDetails && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2962
|
-
/* @__PURE__ */ jsx(
|
|
2963
|
-
IconButton3,
|
|
2964
|
-
{
|
|
2965
|
-
size: "small",
|
|
2966
|
-
onClick: () => setExpanded(!expanded),
|
|
2967
|
-
"aria-label": expanded ? "Hide stack trace" : "Show stack trace",
|
|
2968
|
-
"aria-expanded": expanded,
|
|
2969
|
-
sx: {
|
|
2970
|
-
transform: expanded ? "rotate(180deg)" : "rotate(0deg)",
|
|
2971
|
-
transition: "transform 0.2s"
|
|
2972
|
-
},
|
|
2973
|
-
children: /* @__PURE__ */ jsx(ChevronDownIcon, {})
|
|
2974
|
-
}
|
|
2975
|
-
),
|
|
2976
|
-
/* @__PURE__ */ jsx(IconButton3, { size: "small", onClick: handleCopyStack, title: "Copy error details", children: /* @__PURE__ */ jsx(CopyIcon, { fontSize: "small" }) }),
|
|
2977
|
-
copied && /* @__PURE__ */ jsx(
|
|
2978
|
-
Typography3,
|
|
2979
|
-
{
|
|
2980
|
-
variant: "caption",
|
|
2981
|
-
sx: {
|
|
2982
|
-
color: "success.main",
|
|
2983
|
-
alignSelf: "center"
|
|
2984
|
-
},
|
|
2985
|
-
children: "Copied!"
|
|
2986
|
-
}
|
|
2987
|
-
)
|
|
2988
|
-
] })
|
|
2989
|
-
] }),
|
|
2990
|
-
shouldShowDetails && /* @__PURE__ */ jsx(Collapse, { in: expanded, children: /* @__PURE__ */ jsx(
|
|
2991
|
-
Box8,
|
|
2992
|
-
{
|
|
2993
|
-
sx: {
|
|
2994
|
-
mt: 1,
|
|
2995
|
-
p: 2,
|
|
2996
|
-
// Theme-aware: `grey.100` is a light value in both modes,
|
|
2997
|
-
// which put dark text on a near-white block in dark mode.
|
|
2998
|
-
bgcolor: "action.hover",
|
|
2999
|
-
borderRadius: 1,
|
|
3000
|
-
maxWidth: 600,
|
|
3001
|
-
maxHeight: 300,
|
|
3002
|
-
overflow: "auto",
|
|
3003
|
-
textAlign: "left"
|
|
3004
|
-
},
|
|
3005
|
-
children: /* @__PURE__ */ jsx(Typography3, { variant: "caption", component: "pre", sx: { fontFamily: "monospace", m: 0 }, children: parsedStack.frames.map((frame, i) => /* @__PURE__ */ jsxs(
|
|
3006
|
-
Box8,
|
|
3007
|
-
{
|
|
3008
|
-
component: "span",
|
|
3009
|
-
sx: {
|
|
3010
|
-
display: "block",
|
|
3011
|
-
color: frame.isAppCode ? "error.main" : "text.secondary",
|
|
3012
|
-
fontWeight: frame.isAppCode ? 600 : 400
|
|
3013
|
-
},
|
|
3014
|
-
children: [
|
|
3015
|
-
frame.functionName || "(anonymous)",
|
|
3016
|
-
" at ",
|
|
3017
|
-
frame.filePath || "unknown",
|
|
3018
|
-
frame.lineNumber && `:${frame.lineNumber}`
|
|
3019
|
-
]
|
|
3020
|
-
},
|
|
3021
|
-
i
|
|
3022
|
-
)) })
|
|
3023
|
-
}
|
|
3024
|
-
) })
|
|
3025
|
-
]
|
|
3026
|
-
}
|
|
3027
|
-
);
|
|
3028
|
-
}
|
|
3029
|
-
var ErrorBoundary = class extends Component {
|
|
3030
|
-
constructor(props) {
|
|
3031
|
-
super(props);
|
|
3032
|
-
this.state = {
|
|
3033
|
-
hasError: false,
|
|
3034
|
-
error: null,
|
|
3035
|
-
errorInfo: null
|
|
3036
|
-
};
|
|
3037
|
-
}
|
|
3038
|
-
static getDerivedStateFromError(error) {
|
|
3039
|
-
return {
|
|
3040
|
-
hasError: true,
|
|
3041
|
-
error
|
|
3042
|
-
};
|
|
3043
|
-
}
|
|
3044
|
-
componentDidCatch(error, errorInfo) {
|
|
3045
|
-
const parsedStack = parseStackTrace(error.stack);
|
|
3046
|
-
this.setState({ errorInfo });
|
|
3047
|
-
this.props.onError?.(error, errorInfo, parsedStack);
|
|
3048
|
-
}
|
|
3049
|
-
componentDidUpdate(prevProps) {
|
|
3050
|
-
const { resetKeys } = this.props;
|
|
3051
|
-
const { hasError } = this.state;
|
|
3052
|
-
if (hasError && resetKeys) {
|
|
3053
|
-
const previous = prevProps.resetKeys;
|
|
3054
|
-
const hasKeyChanged = previous === void 0 || previous.length !== resetKeys.length || resetKeys.some((key, index) => key !== previous[index]);
|
|
3055
|
-
if (hasKeyChanged) {
|
|
3056
|
-
this.resetErrorBoundary();
|
|
3057
|
-
}
|
|
3058
|
-
}
|
|
3059
|
-
}
|
|
3060
|
-
resetErrorBoundary = () => {
|
|
3061
|
-
this.props.onReset?.();
|
|
3062
|
-
this.setState({
|
|
3063
|
-
hasError: false,
|
|
3064
|
-
error: null,
|
|
3065
|
-
errorInfo: null
|
|
3066
|
-
});
|
|
3067
|
-
};
|
|
3068
|
-
render() {
|
|
3069
|
-
const { hasError, error, errorInfo } = this.state;
|
|
3070
|
-
const { children, fallback, sx, showDetails } = this.props;
|
|
3071
|
-
if (hasError && error) {
|
|
3072
|
-
const parsedStack = parseStackTrace(error.stack);
|
|
3073
|
-
const fallbackProps = {
|
|
3074
|
-
error,
|
|
3075
|
-
errorInfo,
|
|
3076
|
-
parsedStack,
|
|
3077
|
-
resetErrorBoundary: this.resetErrorBoundary
|
|
3078
|
-
};
|
|
3079
|
-
if (typeof fallback === "function") {
|
|
3080
|
-
return fallback(fallbackProps);
|
|
3081
|
-
}
|
|
3082
|
-
if (fallback) {
|
|
3083
|
-
return fallback;
|
|
3084
|
-
}
|
|
3085
|
-
return /* @__PURE__ */ jsx(DefaultErrorFallback, { ...fallbackProps, sx, showDetails });
|
|
3086
|
-
}
|
|
3087
|
-
return children;
|
|
3088
|
-
}
|
|
3089
|
-
};
|
|
3090
|
-
function useErrorBoundary() {
|
|
3091
|
-
const [, setError] = useState(null);
|
|
3092
|
-
return (error) => {
|
|
3093
|
-
setError(() => {
|
|
3094
|
-
throw error;
|
|
3095
|
-
});
|
|
3096
|
-
};
|
|
3097
|
-
}
|
|
3098
2525
|
|
|
3099
|
-
export {
|
|
3100
|
-
//# sourceMappingURL=chunk-
|
|
3101
|
-
//# sourceMappingURL=chunk-
|
|
2526
|
+
export { Field, FieldAutocomplete, FieldCheckbox, FieldCode, FieldCountrySelect, FieldCustomEditor, FieldDatePicker, FieldDateTimePicker, FieldEditor, FieldMultiCheckbox, FieldMultiSelect, FieldMultiSwitch, FieldNumber, FieldPhone, FieldRadio, FieldRating, FieldSelect, FieldSlider, FieldSwitch, FieldText, FieldTimePicker, FieldUpload, FieldUploadAvatar, FieldUploadBox, clampNumber, createNumberInputHandlers, parseNumber, roundToDecimals, transformForDisplay, transformOnBlur, transformOnChange };
|
|
2527
|
+
//# sourceMappingURL=chunk-LFWKGNCX.js.map
|
|
2528
|
+
//# sourceMappingURL=chunk-LFWKGNCX.js.map
|