@solostylist/ui-kit 1.0.225 → 1.0.226
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/{ArrowUpward-BMKLosZj.js → ArrowUpward-DONVUi9Q.js} +1 -1
- package/dist/{ButtonBase-Bo6ysVGS.js → ButtonBase-BDefit5I.js} +100 -99
- package/dist/{ChevronRight-OLNOfW9P.js → ChevronRight-cBbrlMYh.js} +1 -1
- package/dist/{Close-Bj2HYB9Q.js → Close-DRS0T6Yu.js} +1 -1
- package/dist/{Collapse-CnXmaDqT.js → Collapse-Dtji6IrM.js} +4 -3
- package/dist/{ContentCopy-Br2p19dq.js → ContentCopy-C4mVqexq.js} +1 -1
- package/dist/{Download-BhSXOhCI.js → Download-D277qwl2.js} +1 -1
- package/dist/{ExpandMore-Bu7_1g6Q.js → ExpandMore-DIsT5FOp.js} +1 -1
- package/dist/{Favorite-BJSuHe0H.js → Favorite-CbvuQfe4.js} +1 -1
- package/dist/{FormControl-DYkaP-oD.js → FormControl-DMZWdEWz.js} +6 -6
- package/dist/{InfoOutlined-C1AW3f5V.js → InfoOutlined-BCzG-5py.js} +1 -1
- package/dist/{Menu-C-0KEauj.js → Menu-CbHevx8q.js} +20 -20
- package/dist/{MenuItem-DWivWkNb.js → MenuItem-CCClg9Si.js} +8 -8
- package/dist/{MenuList-5HOyYdgq.js → MenuList-5C2nFAWS.js} +45 -45
- package/dist/{Modal-C1VRVWBZ.js → Modal-Cu5Cgh-q.js} +109 -108
- package/dist/{Paper-BY4X6-u_.js → Paper-Cy7rReyx.js} +1 -1
- package/dist/{Typography-EsraKPZO.js → Typography-DqtTB0ZJ.js} +2 -2
- package/dist/{UnfoldMoreRounded-pz7NMMy3.js → UnfoldMoreRounded-Cbt8Oi8S.js} +1 -1
- package/dist/{autocomplete-qLj7AqcP.js → autocomplete-Du0flrk6.js} +1 -1
- package/dist/{avatar-BuMhUthq.js → avatar-DQtjHpOs.js} +2 -2
- package/dist/{checkbox-B95Vlykq.js → checkbox-BGA2cVbl.js} +17 -17
- package/dist/{createSvgIcon-BdNZIlKS.js → createSvgIcon-HW-tbFcL.js} +1 -1
- package/dist/{mergeSlotProps-DBBJwoun.js → mergeSlotProps-slENzJO5.js} +1 -1
- package/dist/monthCalendarClasses-C1jHkjgt.js +14 -0
- package/dist/s-accordion/index.js +1 -1
- package/dist/s-accordion/s-accordion.js +1 -1
- package/dist/{s-accordion-CXHBadZ_.js → s-accordion-D2VsBSgb.js} +7 -7
- package/dist/s-breadcrumbs/s-breadcrumbs.js +1 -1
- package/dist/s-carousel/index.js +1 -1
- package/dist/s-carousel/s-carousel.js +1 -1
- package/dist/{s-carousel-BUJYCigy.js → s-carousel-S6CRrrpW.js} +7 -9
- package/dist/s-category-card/s-category-card.js +0 -1
- package/dist/s-chat-input/index.js +1 -1
- package/dist/s-chat-input/s-chat-input.js +1 -1
- package/dist/s-chat-input-DNptuBb0.js +352 -0
- package/dist/s-chat-message/index.js +1 -1
- package/dist/s-chat-message/s-chat-message.js +1 -1
- package/dist/{s-chat-message-Cb1npIQO.js → s-chat-message-Bsvsh45G.js} +4 -6
- package/dist/s-chips/index.js +1 -1
- package/dist/s-chips/s-chips.js +1 -1
- package/dist/{s-chips-DelHx6zM.js → s-chips-CH0zKaz-.js} +1 -1
- package/dist/s-code-block/index.js +1 -1
- package/dist/s-code-block/s-code-block.js +1 -1
- package/dist/{s-code-block-sjt0AQb_.js → s-code-block-ByNQ4Zq5.js} +1 -1
- package/dist/s-comment-message/index.js +1 -1
- package/dist/s-comment-message/s-comment-message.js +1 -1
- package/dist/{s-comment-message-DzjXXLZQ.js → s-comment-message-DF580Qxk.js} +13 -19
- package/dist/s-copyable-text/s-copyable-text.js +1 -1
- package/dist/s-data-table/index.js +1 -1
- package/dist/s-data-table/s-data-table.js +1 -1
- package/dist/{s-data-table-TrCdKq9r.js → s-data-table-B8llaX-A.js} +9 -9
- package/dist/s-date-picker/index.js +1 -1
- package/dist/s-date-picker/picker-action-bar.d.ts +12 -0
- package/dist/s-date-picker/picker-action-bar.js +52 -0
- package/dist/s-date-picker/s-date-picker.d.ts +1 -4
- package/dist/s-date-picker/s-date-picker.js +1 -1
- package/dist/s-date-picker-CLncO3oo.js +640 -0
- package/dist/s-datetime-picker/index.js +1 -1
- package/dist/s-datetime-picker/s-datetime-picker.d.ts +1 -4
- package/dist/s-datetime-picker/s-datetime-picker.js +1 -1
- package/dist/{s-datetime-picker-rCWovez1.js → s-datetime-picker-Dy1fX3rI.js} +806 -799
- package/dist/s-dialog/s-dialog.js +2 -3
- package/dist/s-dialog-confirm/s-dialog-confirm.js +3 -4
- package/dist/s-dialog-message/s-dialog-message.js +3 -4
- package/dist/s-empty/s-empty.js +2 -5
- package/dist/s-error/s-error.js +1 -1
- package/dist/s-error-layout/s-error-layout.d.ts +1 -1
- package/dist/s-error-layout/s-error-layout.js +3 -2
- package/dist/s-file-dropzone/index.js +1 -1
- package/dist/s-file-dropzone/s-file-dropzone.d.ts +1 -4
- package/dist/s-file-dropzone/s-file-dropzone.js +1 -1
- package/dist/{s-file-dropzone-oaQoRV92.js → s-file-dropzone-CbaOf3_3.js} +47 -42
- package/dist/s-gallery/gallery-grid-item.d.ts +17 -0
- package/dist/s-gallery/gallery-grid-item.js +112 -0
- package/dist/s-gallery/gallery-layout.d.ts +16 -0
- package/dist/s-gallery/gallery-layout.js +50 -0
- package/dist/s-gallery/gallery-media-item.d.ts +15 -0
- package/dist/s-gallery/gallery-media-item.js +112 -0
- package/dist/s-gallery/index.d.ts +5 -2
- package/dist/s-gallery/index.js +2 -1
- package/dist/s-gallery/s-gallery.d.ts +1 -17
- package/dist/s-gallery/s-gallery.js +38 -284
- package/dist/s-image-comparison/s-image-comparison.js +46 -42
- package/dist/s-image-modal/default-media-item.d.ts +9 -0
- package/dist/s-image-modal/default-media-item.js +34 -0
- package/dist/s-image-modal/image-modal-thumbnail-dock.d.ts +11 -0
- package/dist/s-image-modal/image-modal-thumbnail-dock.js +102 -0
- package/dist/s-image-modal/index.d.ts +2 -2
- package/dist/s-image-modal/index.js +2 -1
- package/dist/s-image-modal/s-image-modal.d.ts +1 -58
- package/dist/s-image-modal/s-image-modal.js +2 -2
- package/dist/s-image-modal/types.d.ts +52 -0
- package/dist/s-image-modal/types.js +0 -0
- package/dist/s-image-modal/use-image-modal-navigation.d.ts +29 -0
- package/dist/s-image-modal/use-image-modal-navigation.js +57 -0
- package/dist/s-image-modal-hhRD4727.js +243 -0
- package/dist/s-label/s-label.js +1 -1
- package/dist/s-language-switcher/index.js +1 -1
- package/dist/s-language-switcher/s-language-switcher.js +1 -1
- package/dist/{s-language-switcher-vievp2VS.js → s-language-switcher-BKK0r8Kh.js} +4 -4
- package/dist/s-localization-provider/index.js +1 -1
- package/dist/s-localization-provider/s-localization-provider.js +1 -1
- package/dist/{s-localization-provider-YCsec18c.js → s-localization-provider-DDO9UEu_.js} +4 -4
- package/dist/s-nav-item/s-nav-item.js +1 -1
- package/dist/s-nav-items/s-nav-items.js +4 -7
- package/dist/s-pagination/s-pagination.js +12 -15
- package/dist/s-review/index.js +1 -1
- package/dist/s-review/s-review.js +1 -1
- package/dist/{s-review-DjvDY-h4.js → s-review-f0OI1oqM.js} +18 -27
- package/dist/s-scroll-reveal/s-scroll-reveal.js +1 -1
- package/dist/s-scroll-to-top/s-scroll-to-top.js +1 -1
- package/dist/s-select/index.js +1 -1
- package/dist/s-select/s-select.js +1 -1
- package/dist/{s-select-B-dEcddK.js → s-select-BqWS_5Bs.js} +1 -1
- package/dist/s-select-list/s-select-list.js +2 -11
- package/dist/s-spotlight-cursor/s-spotlight-cursor.js +23 -15
- package/dist/s-stripe/s-stripe-cvc.d.ts +1 -5
- package/dist/s-stripe/s-stripe-cvc.js +11 -11
- package/dist/s-stripe/s-stripe-expiry.d.ts +1 -5
- package/dist/s-stripe/s-stripe-expiry.js +11 -11
- package/dist/s-stripe/s-stripe-number.d.ts +1 -5
- package/dist/s-stripe/s-stripe-number.js +11 -11
- package/dist/s-stripe/s-stripe.d.ts +11 -4
- package/dist/s-stripe/s-stripe.js +19 -17
- package/dist/s-stripe/stripe-input.js +41 -32
- package/dist/s-text-editor/index.js +1 -1
- package/dist/s-text-editor/s-text-editor-toolbar.js +1 -1
- package/dist/s-text-editor/s-text-editor.d.ts +1 -4
- package/dist/s-text-editor/s-text-editor.js +21 -24
- package/dist/{s-text-editor-toolbar-DP0MkICo.js → s-text-editor-toolbar-DrQ8v-4J.js} +45 -44
- package/dist/s-text-field/index.js +1 -1
- package/dist/s-text-field/s-text-field.d.ts +1 -4
- package/dist/s-text-field/s-text-field.js +1 -1
- package/dist/{s-text-field-GqcwXwta.js → s-text-field-DLSDoq7u.js} +20 -19
- package/dist/s-theme-demo/index.js +1 -1
- package/dist/s-theme-demo/s-theme-demo.js +1 -1
- package/dist/{s-theme-demo-BpeyFRKt.js → s-theme-demo-DeY0K6MC.js} +4 -4
- package/dist/s-theme-provider/s-theme-provider.js +26 -25
- package/dist/s-theme-switch/index.js +1 -1
- package/dist/s-theme-switch/s-theme-switch.js +1 -1
- package/dist/{s-theme-switch-V3Q58mkG.js → s-theme-switch-B0KHb2wu.js} +1 -1
- package/dist/s-tip/index.js +1 -1
- package/dist/s-tip/s-tip.js +1 -1
- package/dist/{s-tip-Dwu5T2u0.js → s-tip-Beuy9MLR.js} +2 -2
- package/dist/s-tool-bar/index.d.ts +1 -1
- package/dist/s-tool-bar/index.js +1 -1
- package/dist/s-tool-bar/s-tool-bar.d.ts +1 -155
- package/dist/s-tool-bar/s-tool-bar.js +114 -2
- package/dist/s-tool-bar/tool-bar-action-buttons.d.ts +15 -0
- package/dist/s-tool-bar/tool-bar-action-buttons.js +2 -0
- package/dist/s-tool-bar/tool-bar-image-input.d.ts +8 -0
- package/dist/s-tool-bar/tool-bar-image-input.js +2 -0
- package/dist/s-tool-bar/tool-bar-inputs.d.ts +3 -0
- package/dist/s-tool-bar/tool-bar-inputs.js +139 -0
- package/dist/s-tool-bar/types.d.ts +170 -0
- package/dist/s-tool-bar/types.js +0 -0
- package/dist/s-tool-bar/utils.d.ts +10 -0
- package/dist/s-tool-bar/utils.js +22 -0
- package/dist/theme/components/accordion-summary.js +2 -2
- package/dist/theme/components/accordion.js +1 -1
- package/dist/theme/components/alert.d.ts +1 -1
- package/dist/theme/components/alert.js +1 -1
- package/dist/theme/components/autocomplete.js +1 -1
- package/dist/theme/components/avatar.d.ts +10 -1
- package/dist/theme/components/avatar.js +1 -1
- package/dist/theme/components/card.js +4 -4
- package/dist/theme/components/checkbox.js +1 -1
- package/dist/theme/components/chip.js +17 -6
- package/dist/theme/components/components.js +134 -118
- package/dist/theme/components/date-calendar.d.ts +13 -0
- package/dist/theme/components/date-calendar.js +7 -0
- package/dist/theme/components/day-calendar.d.ts +14 -1
- package/dist/theme/components/day-calendar.js +14 -1
- package/dist/theme/components/dialog-actions.js +1 -1
- package/dist/theme/components/dialog-content.d.ts +13 -0
- package/dist/theme/components/dialog-content.js +7 -0
- package/dist/theme/components/dialog-title.d.ts +21 -0
- package/dist/theme/components/dialog-title.js +7 -0
- package/dist/theme/components/form-label.js +1 -1
- package/dist/theme/components/icon-button.d.ts +5 -1
- package/dist/theme/components/icon-button.js +18 -24
- package/dist/theme/components/linear-progress.js +2 -2
- package/dist/theme/components/link.d.ts +1 -1
- package/dist/theme/components/link.js +2 -2
- package/dist/theme/components/list-item-button.js +2 -2
- package/dist/theme/components/list-item.js +3 -3
- package/dist/theme/components/month-calendar.d.ts +27 -0
- package/dist/theme/components/month-calendar.js +14 -0
- package/dist/theme/components/multi-section-digital-clock-section.js +25 -0
- package/dist/theme/components/outlined-input.js +6 -6
- package/dist/theme/components/picker-day.d.ts +16 -2
- package/dist/theme/components/picker-day.js +13 -1
- package/dist/theme/components/pickers-arrow-switcher.d.ts +12 -0
- package/dist/theme/components/pickers-arrow-switcher.js +4 -0
- package/dist/theme/components/pickers-calendar-header.d.ts +38 -0
- package/dist/theme/components/pickers-calendar-header.js +24 -0
- package/dist/theme/components/select.js +2 -2
- package/dist/theme/components/slider.d.ts +29 -2
- package/dist/theme/components/slider.js +14 -2
- package/dist/theme/components/step-connector.d.ts +1 -1
- package/dist/theme/components/step-connector.js +1 -1
- package/dist/theme/components/step-icon.js +1 -1
- package/dist/theme/components/tab.js +1 -1
- package/dist/theme/components/table-pagination.js +1 -1
- package/dist/theme/components/toggle-button-group.js +1 -1
- package/dist/theme/components/toggle-button.js +1 -1
- package/dist/theme/components/year-calendar.d.ts +36 -0
- package/dist/theme/components/year-calendar.js +17 -0
- package/dist/theme/theme-primitives.d.ts +36 -0
- package/dist/theme/theme-primitives.js +2 -2
- package/dist/{theme-primitives-D2vHHGiX.js → theme-primitives-7ruiI7gY.js} +10 -3
- package/dist/{toggle-button-group-ABwIhV4P.js → toggle-button-group-Dx9fvVok.js} +4 -4
- package/dist/{toggle-button-BUsRxHn0.js → toggle-button-j6VLaPoa.js} +3 -3
- package/dist/tool-bar-action-buttons-B4QhqdK_.js +50 -0
- package/dist/tool-bar-image-input-BKFAtyJ1.js +138 -0
- package/dist/{useControlled-DXKqhylj.js → useControlled-BtZNCHV0.js} +1 -1
- package/dist/useForkRef-yOYCJHzF.js +29 -0
- package/dist/{useMobilePicker-ujH2nH2-.js → useMobilePicker-C8toWhEP.js} +7657 -7674
- package/dist/{useSlot-Dkc1Mj31.js → useSlot-IwEDsR9t.js} +107 -133
- package/dist/{utils-CCnIUPad.js → utils-CU6O7jrX.js} +5 -5
- package/dist/{LocalizationProvider-BdaUKqz3.js → warning-CFMmJJnf.js} +51 -51
- package/dist/yearCalendarClasses-DypEe_Vn.js +14 -0
- package/package.json +1 -1
- package/dist/s-chat-input-cOCqPTUS.js +0 -299
- package/dist/s-date-picker-BkZIEZoz.js +0 -634
- package/dist/s-image-modal-Za71QD3d.js +0 -397
- package/dist/s-tool-bar-DaZ2wT09.js +0 -454
- /package/dist/{buttonBaseClasses-BLZbMisL.js → buttonBaseClasses-BVDyR-hz.js} +0 -0
- /package/dist/{checkboxClasses-DSyvUOsN.js → checkboxClasses-DPzQcJz-.js} +0 -0
- /package/dist/{createSimplePaletteValueFilter-GHK52GLU.js → createSimplePaletteValueFilter-5v48HHyU.js} +0 -0
- /package/dist/{extends-D8CDMpIy.js → extends-DM-C9PwL.js} +0 -0
- /package/dist/{formLabelClasses-Cv7W0Roi.js → formLabelClasses-BfRVjiBm.js} +0 -0
- /package/dist/{iconButtonClasses-9jjSQ9-U.js → iconButtonClasses-LyjwljJq.js} +0 -0
- /package/dist/{inputAdornmentClasses-VKwluNTs.js → inputAdornmentClasses-DHmz00nZ.js} +0 -0
- /package/dist/{objectWithoutPropertiesLoose-BpY-kC5L.js → objectWithoutPropertiesLoose-kj3TmhoA.js} +0 -0
- /package/dist/{outlinedInputClasses-Cz4pnn0X.js → outlinedInputClasses-Z5R6RJE3.js} +0 -0
- /package/dist/{selectClasses-DvT1febA.js → selectClasses-vjNpSSyQ.js} +0 -0
- /package/dist/{svgIconClasses-D46YUMKp.js → svgIconClasses-BtHvkhy5.js} +0 -0
- /package/dist/{tabClasses-KqPlYv0c.js → tabClasses-CmFw6sbs.js} +0 -0
- /package/dist/{typographyClasses-CFf0OFiD.js → typographyClasses-CspzYrIn.js} +0 -0
- /package/dist/{useControlled-2-C6cXjG.js → useControlled-DuSwFVhD.js} +0 -0
- /package/dist/{useFormControl-B4z6ONhx.js → useFormControl-bYnTwZE5.js} +0 -0
|
@@ -1,159 +1,5 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import { SxProps, Theme } from '@mui/material/styles';
|
|
4
|
-
/**
|
|
5
|
-
* Possible value types for SToolBar inputs
|
|
6
|
-
*/
|
|
7
|
-
export type SToolBarValue = string | number | boolean | File | (string | File)[] | null;
|
|
8
|
-
/**
|
|
9
|
-
* Base type constraint for select options
|
|
10
|
-
*/
|
|
11
|
-
export type SToolBarOption = string | number | Record<string, unknown>;
|
|
12
|
-
/**
|
|
13
|
-
* Supported input types for SToolBar
|
|
14
|
-
*/
|
|
15
|
-
export type SToolBarInputType = 'textarea' | 'slider' | 'image' | 'number' | 'select' | 'checkbox';
|
|
16
|
-
/**
|
|
17
|
-
* Configuration for individual toolbar input fields
|
|
18
|
-
*/
|
|
19
|
-
export interface SToolBarInput {
|
|
20
|
-
/** Unique identifier for the input */
|
|
21
|
-
key: string;
|
|
22
|
-
/** Display label for the input */
|
|
23
|
-
label: string;
|
|
24
|
-
/** Input type */
|
|
25
|
-
type: SToolBarInputType;
|
|
26
|
-
/** Whether the input is required */
|
|
27
|
-
required?: boolean;
|
|
28
|
-
/** Default value for the input */
|
|
29
|
-
defaultValue?: SToolBarValue;
|
|
30
|
-
/** Placeholder text (for textarea/number/select inputs) */
|
|
31
|
-
placeholder?: string;
|
|
32
|
-
/** Minimum value (for slider/number inputs) */
|
|
33
|
-
min?: number;
|
|
34
|
-
/** Maximum value (for slider/number inputs) */
|
|
35
|
-
max?: number;
|
|
36
|
-
/** Step value (for slider/number inputs) */
|
|
37
|
-
step?: number;
|
|
38
|
-
/** Minimum rows for textarea */
|
|
39
|
-
minRows?: number;
|
|
40
|
-
/** Maximum rows for textarea */
|
|
41
|
-
maxRows?: number;
|
|
42
|
-
/** Allow multiple images (for image inputs) */
|
|
43
|
-
multiple?: boolean;
|
|
44
|
-
/** Maximum number of images (for image inputs with multiple=true) */
|
|
45
|
-
maxImages?: number;
|
|
46
|
-
/** Select options (for select inputs) */
|
|
47
|
-
options?: SToolBarOption[];
|
|
48
|
-
/** Key to extract label from option objects (for select inputs) */
|
|
49
|
-
optionLabel?: string;
|
|
50
|
-
/** Key to extract value from option objects (for select inputs) */
|
|
51
|
-
optionValue?: string;
|
|
52
|
-
/** Enable search functionality in select dropdown */
|
|
53
|
-
searchable?: boolean;
|
|
54
|
-
/** Placeholder for search input in select dropdown */
|
|
55
|
-
searchPlaceholder?: string;
|
|
56
|
-
/**
|
|
57
|
-
* Extra props forwarded to the underlying child component.
|
|
58
|
-
* Each key targets the matching input type:
|
|
59
|
-
* - `textarea` / `number` → MUI `TextField`
|
|
60
|
-
* - `slider` → MUI `Slider`
|
|
61
|
-
* - `select` → `SSelect`
|
|
62
|
-
* - `checkbox` → MUI `Checkbox`
|
|
63
|
-
* - `image` → native `<input type="file">`
|
|
64
|
-
*
|
|
65
|
-
* Only the props relevant to the current `type` are used.
|
|
66
|
-
*/
|
|
67
|
-
componentProps?: SToolBarComponentProps;
|
|
68
|
-
/** Custom renderer for the input */
|
|
69
|
-
renderInput?: (props: {
|
|
70
|
-
value: SToolBarValue;
|
|
71
|
-
onChange: (value: SToolBarValue) => void;
|
|
72
|
-
onFocus: () => void;
|
|
73
|
-
onBlur: () => void;
|
|
74
|
-
disabled?: boolean;
|
|
75
|
-
}) => React.ReactNode;
|
|
76
|
-
}
|
|
77
|
-
/**
|
|
78
|
-
* Per-type overrides forwarded to the underlying child components.
|
|
79
|
-
* Omit props that are already managed by SToolBar to avoid conflicts.
|
|
80
|
-
*/
|
|
81
|
-
export interface SToolBarComponentProps {
|
|
82
|
-
/** Extra props for the MUI TextField used in `textarea` inputs */
|
|
83
|
-
textarea?: Omit<TextFieldProps, 'value' | 'onChange' | 'onFocus' | 'onBlur' | 'disabled' | 'multiline' | 'minRows' | 'maxRows' | 'fullWidth' | 'placeholder'>;
|
|
84
|
-
/** Extra props for the MUI TextField used in `number` inputs */
|
|
85
|
-
number?: Omit<TextFieldProps, 'value' | 'onChange' | 'onFocus' | 'onBlur' | 'disabled' | 'type' | 'slotProps'>;
|
|
86
|
-
/** Extra props for the MUI Slider used in `slider` inputs */
|
|
87
|
-
slider?: Omit<SliderProps, 'value' | 'onChange' | 'onMouseDown' | 'onMouseUp' | 'disabled' | 'min' | 'max' | 'step'>;
|
|
88
|
-
/** Extra props for SSelect used in `select` inputs */
|
|
89
|
-
select?: Omit<SelectProps, 'ref' | 'value' | 'onChange' | 'onFocus' | 'onBlur' | 'disabled' | 'error' | 'variant'> & {
|
|
90
|
-
/** Field label displayed above the select */
|
|
91
|
-
label?: string | React.ReactNode;
|
|
92
|
-
/** Error message to display below the field */
|
|
93
|
-
error?: string;
|
|
94
|
-
/** Whether the field is required */
|
|
95
|
-
required?: boolean;
|
|
96
|
-
/** Whether to use simple value rendering */
|
|
97
|
-
simple?: boolean;
|
|
98
|
-
/** HTML id attribute for the select element */
|
|
99
|
-
htmlFor?: string;
|
|
100
|
-
/** Custom render function for dropdown options */
|
|
101
|
-
renderOption?: (option: SToolBarOption) => React.ReactNode;
|
|
102
|
-
};
|
|
103
|
-
/** Extra props for the MUI Checkbox used in `checkbox` inputs */
|
|
104
|
-
checkbox?: Omit<CheckboxProps, 'checked' | 'onChange' | 'onFocus' | 'onBlur' | 'disabled'>;
|
|
105
|
-
/** Extra props for the native `<input type="file">` element used in `image` inputs */
|
|
106
|
-
image?: Omit<React.InputHTMLAttributes<HTMLInputElement>, 'ref' | 'type' | 'multiple' | 'onChange' | 'disabled' | 'style'>;
|
|
107
|
-
}
|
|
108
|
-
/**
|
|
109
|
-
* Props interface for SToolBar component
|
|
110
|
-
*/
|
|
111
|
-
export interface SToolBarProps {
|
|
112
|
-
/** Configuration for input fields */
|
|
113
|
-
inputs?: SToolBarInput[];
|
|
114
|
-
/** Callback when process button is clicked */
|
|
115
|
-
onProcess?: () => void;
|
|
116
|
-
/** Callback when reset button is clicked */
|
|
117
|
-
onReset?: () => void;
|
|
118
|
-
/** Callback when download button is clicked */
|
|
119
|
-
onDownload?: () => void;
|
|
120
|
-
/** Whether the toolbar is in processing state */
|
|
121
|
-
processing?: boolean;
|
|
122
|
-
/** Whether the toolbar is in uploading state */
|
|
123
|
-
uploading?: boolean;
|
|
124
|
-
/** Input values controlled externally */
|
|
125
|
-
inputValues?: Record<string, SToolBarValue>;
|
|
126
|
-
/** Callback when input values change */
|
|
127
|
-
onInputChange?: (key: string, value: SToolBarValue, file?: File) => void;
|
|
128
|
-
/** Custom action buttons between inputs and standard actions */
|
|
129
|
-
customActionButtons?: React.ReactNode;
|
|
130
|
-
/** Hide the main process button */
|
|
131
|
-
hideProcessButton?: boolean;
|
|
132
|
-
/** Override to disable the process button */
|
|
133
|
-
processButtonDisabled?: boolean;
|
|
134
|
-
/** Function to check if an input should be disabled */
|
|
135
|
-
getInputDisabled?: (inputKey: string) => boolean;
|
|
136
|
-
/** Tooltip for process button */
|
|
137
|
-
processTooltip?: string;
|
|
138
|
-
/** Tooltip for download button */
|
|
139
|
-
downloadTooltip?: string;
|
|
140
|
-
/** Tooltip for reset button */
|
|
141
|
-
resetTooltip?: string;
|
|
142
|
-
/** Tooltip for info button */
|
|
143
|
-
infoTooltip?: string;
|
|
144
|
-
/** Info dialog title */
|
|
145
|
-
infoTitle?: string;
|
|
146
|
-
/** Info dialog content */
|
|
147
|
-
infoContent?: React.ReactNode;
|
|
148
|
-
/** Position of the toolbar */
|
|
149
|
-
position?: 'bottom' | 'top';
|
|
150
|
-
/** Use relative positioning within container instead of fixed viewport positioning */
|
|
151
|
-
relative?: boolean;
|
|
152
|
-
/** Custom styles for the outer container (wrapper) */
|
|
153
|
-
containerSx?: SxProps<Theme>;
|
|
154
|
-
/** Custom styles for the inner toolbar box */
|
|
155
|
-
sx?: SxProps<Theme>;
|
|
156
|
-
}
|
|
2
|
+
import { SToolBarProps } from './types';
|
|
157
3
|
export declare const SToolBar: {
|
|
158
4
|
({ inputs, onProcess, onReset, onDownload, processing, uploading, inputValues, onInputChange, customActionButtons, hideProcessButton, processButtonDisabled, getInputDisabled, processTooltip, downloadTooltip, resetTooltip, infoTooltip, infoTitle, infoContent, position, relative, containerSx, sx, }: SToolBarProps): React.JSX.Element;
|
|
159
5
|
displayName: string;
|
|
@@ -1,2 +1,114 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { tint as e } from "../theme/utils.js";
|
|
2
|
+
import { t } from "../tool-bar-action-buttons-B4QhqdK_.js";
|
|
3
|
+
import { groupInputsByType as n, hasVisibleInputSection as r, isProcessActionDisabled as i, isRequiredInputFilled as a } from "./utils.js";
|
|
4
|
+
import { ToolbarInputItem as o } from "./tool-bar-inputs.js";
|
|
5
|
+
import { useCallback as s, useMemo as c, useState as l } from "react";
|
|
6
|
+
import { jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
7
|
+
import { createPortal as f } from "react-dom";
|
|
8
|
+
import { Box as p, Dialog as m, DialogContent as h, DialogTitle as g } from "@mui/material";
|
|
9
|
+
//#region lib/s-tool-bar/s-tool-bar.tsx
|
|
10
|
+
var _ = ({ inputs: _ = [], onProcess: v, onReset: y, onDownload: b, processing: x = !1, uploading: S = !1, inputValues: C = {}, onInputChange: w, customActionButtons: T, hideProcessButton: E = !1, processButtonDisabled: D = !1, getInputDisabled: O, processTooltip: k = "Process", downloadTooltip: A = "Download", resetTooltip: j = "Reset", infoTooltip: M = "Information", infoTitle: N = "Tool Information", infoContent: P, position: F = "bottom", relative: I = !1, containerSx: L, sx: R }) => {
|
|
11
|
+
let [z, B] = l(!1), V = c(() => _.length === 0 ? !0 : _.every((e) => a(e, C[e.key])), [_, C]), { imageInputs: H, textareaInputs: U, paramInputs: W } = c(() => n(_), [_]), G = r(H, W), K = i(D, V, S, x), q = s(() => {}, []), J = s(() => {}, []), Y = s((e, t, n) => {
|
|
12
|
+
w?.(e, t, n);
|
|
13
|
+
}, [w]), X = s(() => B(!0), []), Z = s(() => B(!1), []), Q = s((e) => {
|
|
14
|
+
let t = C[e.key];
|
|
15
|
+
return /* @__PURE__ */ u(o, {
|
|
16
|
+
input: e,
|
|
17
|
+
value: t,
|
|
18
|
+
onChange: (t) => Y(e.key, t),
|
|
19
|
+
onFocus: q,
|
|
20
|
+
onBlur: J,
|
|
21
|
+
disabled: O?.(e.key) ?? !1
|
|
22
|
+
}, e.key);
|
|
23
|
+
}, [
|
|
24
|
+
C,
|
|
25
|
+
O,
|
|
26
|
+
Y,
|
|
27
|
+
q,
|
|
28
|
+
J
|
|
29
|
+
]), $ = /* @__PURE__ */ d(p, {
|
|
30
|
+
sx: {
|
|
31
|
+
position: I ? "relative" : "fixed",
|
|
32
|
+
[F]: I ? "auto" : 20,
|
|
33
|
+
left: I ? "auto" : "50%",
|
|
34
|
+
transform: I ? "none" : "translateX(-50%)",
|
|
35
|
+
zIndex: I ? "auto" : 1300,
|
|
36
|
+
display: I ? "flex" : "block",
|
|
37
|
+
justifyContent: I ? "center" : "initial",
|
|
38
|
+
mt: I && F === "top" ? 2 : 0,
|
|
39
|
+
mb: I && F === "bottom" ? 2 : 0,
|
|
40
|
+
...L
|
|
41
|
+
},
|
|
42
|
+
children: [/* @__PURE__ */ d(p, {
|
|
43
|
+
sx: [(t) => ({
|
|
44
|
+
display: "flex",
|
|
45
|
+
flexDirection: "column",
|
|
46
|
+
gap: 2,
|
|
47
|
+
p: 2,
|
|
48
|
+
borderRadius: 1,
|
|
49
|
+
border: 1,
|
|
50
|
+
borderColor: "divider",
|
|
51
|
+
bgcolor: "background.default",
|
|
52
|
+
transition: "border 120ms ease-in",
|
|
53
|
+
"&:hover": { borderColor: (t.vars ?? t).palette.grey[500] },
|
|
54
|
+
"&:focus-within": {
|
|
55
|
+
outline: `3px solid ${e((t.vars ?? t).palette.primary[500], 50)}`,
|
|
56
|
+
borderColor: (t.vars ?? t).palette.primary[400]
|
|
57
|
+
}
|
|
58
|
+
}), ...Array.isArray(R) ? R : [R]],
|
|
59
|
+
children: [U.length > 0 && /* @__PURE__ */ u(p, {
|
|
60
|
+
sx: {
|
|
61
|
+
display: "flex",
|
|
62
|
+
flexDirection: "column",
|
|
63
|
+
gap: 2
|
|
64
|
+
},
|
|
65
|
+
children: U.map(Q)
|
|
66
|
+
}), /* @__PURE__ */ d(p, {
|
|
67
|
+
sx: {
|
|
68
|
+
display: "flex",
|
|
69
|
+
alignItems: "center",
|
|
70
|
+
gap: .5
|
|
71
|
+
},
|
|
72
|
+
children: [/* @__PURE__ */ u(p, {
|
|
73
|
+
sx: {
|
|
74
|
+
display: "flex",
|
|
75
|
+
alignItems: "center",
|
|
76
|
+
gap: 2,
|
|
77
|
+
flex: 1
|
|
78
|
+
},
|
|
79
|
+
children: G && /* @__PURE__ */ d(p, {
|
|
80
|
+
sx: {
|
|
81
|
+
display: "flex",
|
|
82
|
+
alignItems: "center",
|
|
83
|
+
gap: 1.5
|
|
84
|
+
},
|
|
85
|
+
children: [H.map(Q), W.map(Q)]
|
|
86
|
+
})
|
|
87
|
+
}), /* @__PURE__ */ u(t, {
|
|
88
|
+
customActionButtons: T,
|
|
89
|
+
infoContent: P,
|
|
90
|
+
infoTooltip: M,
|
|
91
|
+
downloadTooltip: A,
|
|
92
|
+
resetTooltip: j,
|
|
93
|
+
processTooltip: k,
|
|
94
|
+
hideProcessButton: E,
|
|
95
|
+
processActionDisabled: K,
|
|
96
|
+
onInfoOpen: X,
|
|
97
|
+
onDownload: b,
|
|
98
|
+
onReset: y,
|
|
99
|
+
onProcess: v
|
|
100
|
+
})]
|
|
101
|
+
})]
|
|
102
|
+
}), P && /* @__PURE__ */ d(m, {
|
|
103
|
+
open: z,
|
|
104
|
+
onClose: Z,
|
|
105
|
+
maxWidth: "sm",
|
|
106
|
+
fullWidth: !0,
|
|
107
|
+
children: [/* @__PURE__ */ u(g, { children: N }), /* @__PURE__ */ u(h, { children: P })]
|
|
108
|
+
})]
|
|
109
|
+
});
|
|
110
|
+
return !I && typeof window < "u" ? f($, document.body) : $;
|
|
111
|
+
};
|
|
112
|
+
_.displayName = "SToolBar";
|
|
113
|
+
//#endregion
|
|
114
|
+
export { _ as SToolBar, _ as default };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export declare const ToolbarActionButtons: React.NamedExoticComponent<{
|
|
3
|
+
customActionButtons?: React.ReactNode;
|
|
4
|
+
infoContent?: React.ReactNode;
|
|
5
|
+
infoTooltip: string;
|
|
6
|
+
downloadTooltip: string;
|
|
7
|
+
resetTooltip: string;
|
|
8
|
+
processTooltip: string;
|
|
9
|
+
hideProcessButton: boolean;
|
|
10
|
+
processActionDisabled: boolean;
|
|
11
|
+
onInfoOpen: () => void;
|
|
12
|
+
onDownload?: () => void;
|
|
13
|
+
onReset?: () => void;
|
|
14
|
+
onProcess?: () => void;
|
|
15
|
+
}>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { SToolBarInput, SToolBarValue } from './types';
|
|
3
|
+
export declare const ImageInput: React.NamedExoticComponent<{
|
|
4
|
+
input: SToolBarInput;
|
|
5
|
+
value: SToolBarValue;
|
|
6
|
+
onChange: (value: SToolBarValue) => void;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
}>;
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { t as e } from "../tool-bar-image-input-BKFAtyJ1.js";
|
|
2
|
+
import { t } from "../s-select-BqWS_5Bs.js";
|
|
3
|
+
import n from "react";
|
|
4
|
+
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
5
|
+
import { Box as a, Slider as o, TextField as s, Typography as c, outlinedInputClasses as l } from "@mui/material";
|
|
6
|
+
//#region lib/s-tool-bar/tool-bar-inputs.tsx
|
|
7
|
+
var u = n.memo(({ input: e, value: t, onChange: n, onFocus: i, onBlur: a, disabled: o }) => /* @__PURE__ */ r(s, {
|
|
8
|
+
value: t,
|
|
9
|
+
onChange: (e) => n(e.target.value),
|
|
10
|
+
onFocus: i,
|
|
11
|
+
onBlur: a,
|
|
12
|
+
placeholder: e.placeholder ?? e.label,
|
|
13
|
+
disabled: o,
|
|
14
|
+
multiline: !0,
|
|
15
|
+
minRows: e.minRows ?? 2,
|
|
16
|
+
maxRows: e.maxRows ?? 5,
|
|
17
|
+
fullWidth: !0,
|
|
18
|
+
variant: "outlined",
|
|
19
|
+
slotProps: { input: { sx: {
|
|
20
|
+
backgroundColor: "transparent",
|
|
21
|
+
border: "none",
|
|
22
|
+
padding: 0,
|
|
23
|
+
[`&.${l.focused}`]: { outline: "none" },
|
|
24
|
+
"& fieldset": { border: "none" },
|
|
25
|
+
"&:hover fieldset": { border: "none" },
|
|
26
|
+
"&.Mui-focused fieldset": { border: "none" }
|
|
27
|
+
} } },
|
|
28
|
+
...e.componentProps?.textarea ?? {}
|
|
29
|
+
})), d = n.memo((e) => /* @__PURE__ */ r(c, {
|
|
30
|
+
variant: "subtitle2",
|
|
31
|
+
sx: {
|
|
32
|
+
whiteSpace: "nowrap",
|
|
33
|
+
overflow: "hidden",
|
|
34
|
+
textOverflow: "ellipsis",
|
|
35
|
+
width: "100% !important"
|
|
36
|
+
},
|
|
37
|
+
children: e.label
|
|
38
|
+
})), f = n.memo(({ input: e, value: t, onChange: n, onFocus: o, onBlur: c, disabled: l }) => /* @__PURE__ */ i(a, {
|
|
39
|
+
sx: {
|
|
40
|
+
width: 80,
|
|
41
|
+
display: "flex",
|
|
42
|
+
flexDirection: "column"
|
|
43
|
+
},
|
|
44
|
+
children: [/* @__PURE__ */ r(d, { label: e.label }), /* @__PURE__ */ r(s, {
|
|
45
|
+
type: "number",
|
|
46
|
+
value: t ?? e.defaultValue ?? 0,
|
|
47
|
+
onChange: (e) => n(Number(e.target.value)),
|
|
48
|
+
onFocus: o,
|
|
49
|
+
onBlur: c,
|
|
50
|
+
disabled: l,
|
|
51
|
+
slotProps: { htmlInput: {
|
|
52
|
+
min: e.min,
|
|
53
|
+
max: e.max,
|
|
54
|
+
step: e.step
|
|
55
|
+
} },
|
|
56
|
+
...e.componentProps?.number ?? {}
|
|
57
|
+
})]
|
|
58
|
+
})), p = n.memo(({ input: e, value: n, onChange: o, onFocus: s, onBlur: c, disabled: l }) => /* @__PURE__ */ i(a, {
|
|
59
|
+
sx: {
|
|
60
|
+
width: 180,
|
|
61
|
+
display: "flex",
|
|
62
|
+
flexDirection: "column"
|
|
63
|
+
},
|
|
64
|
+
children: [/* @__PURE__ */ r(d, { label: e.label }), /* @__PURE__ */ r(t, {
|
|
65
|
+
value: n ?? e.defaultValue ?? "",
|
|
66
|
+
onChange: (e) => o(e.target.value),
|
|
67
|
+
onFocus: s,
|
|
68
|
+
onBlur: c,
|
|
69
|
+
disabled: l,
|
|
70
|
+
placeholder: e.placeholder,
|
|
71
|
+
options: e.options ?? [],
|
|
72
|
+
optionLabel: e.optionLabel,
|
|
73
|
+
optionValue: e.optionValue,
|
|
74
|
+
searchable: e.searchable,
|
|
75
|
+
searchPlaceholder: e.searchPlaceholder,
|
|
76
|
+
...e.componentProps?.select ?? {}
|
|
77
|
+
})]
|
|
78
|
+
})), m = n.memo(({ input: e, value: t, onChange: n, onFocus: s, onBlur: l, disabled: u }) => /* @__PURE__ */ i(a, {
|
|
79
|
+
sx: {
|
|
80
|
+
width: 160,
|
|
81
|
+
display: "flex",
|
|
82
|
+
flexDirection: "column"
|
|
83
|
+
},
|
|
84
|
+
children: [/* @__PURE__ */ r(d, { label: e.label }), /* @__PURE__ */ i(a, {
|
|
85
|
+
sx: {
|
|
86
|
+
display: "flex",
|
|
87
|
+
alignItems: "center",
|
|
88
|
+
height: 36
|
|
89
|
+
},
|
|
90
|
+
children: [/* @__PURE__ */ r(o, {
|
|
91
|
+
value: t ?? e.defaultValue ?? e.min ?? 0,
|
|
92
|
+
onChange: (e, t) => n(t),
|
|
93
|
+
onMouseDown: s,
|
|
94
|
+
onMouseUp: l,
|
|
95
|
+
disabled: u,
|
|
96
|
+
min: e.min ?? 0,
|
|
97
|
+
max: e.max ?? 100,
|
|
98
|
+
step: e.step ?? 1,
|
|
99
|
+
sx: { flex: 1 },
|
|
100
|
+
...e.componentProps?.slider ?? {}
|
|
101
|
+
}), /* @__PURE__ */ r(c, {
|
|
102
|
+
variant: "body2",
|
|
103
|
+
sx: {
|
|
104
|
+
minWidth: 60,
|
|
105
|
+
textAlign: "center"
|
|
106
|
+
},
|
|
107
|
+
children: t ?? e.defaultValue ?? e.min ?? 0
|
|
108
|
+
})]
|
|
109
|
+
})]
|
|
110
|
+
})), h = (t) => {
|
|
111
|
+
switch (t.input.type) {
|
|
112
|
+
case "textarea": return /* @__PURE__ */ r(u, { ...t });
|
|
113
|
+
case "number": return /* @__PURE__ */ r(f, { ...t });
|
|
114
|
+
case "slider": return /* @__PURE__ */ r(m, { ...t });
|
|
115
|
+
case "select": return /* @__PURE__ */ r(p, { ...t });
|
|
116
|
+
case "image": return /* @__PURE__ */ r(e, {
|
|
117
|
+
input: t.input,
|
|
118
|
+
value: t.value,
|
|
119
|
+
onChange: t.onChange,
|
|
120
|
+
disabled: t.disabled
|
|
121
|
+
});
|
|
122
|
+
default: return null;
|
|
123
|
+
}
|
|
124
|
+
}, g = n.memo(({ input: e, value: t, disabled: n, onChange: i, onFocus: o, onBlur: s }) => e.renderInput ? /* @__PURE__ */ r(a, { children: e.renderInput({
|
|
125
|
+
value: t,
|
|
126
|
+
onChange: i,
|
|
127
|
+
onFocus: o,
|
|
128
|
+
onBlur: s,
|
|
129
|
+
disabled: n
|
|
130
|
+
}) }) : /* @__PURE__ */ r(h, {
|
|
131
|
+
input: e,
|
|
132
|
+
value: t,
|
|
133
|
+
onChange: i,
|
|
134
|
+
onFocus: o,
|
|
135
|
+
onBlur: s,
|
|
136
|
+
disabled: n
|
|
137
|
+
}));
|
|
138
|
+
//#endregion
|
|
139
|
+
export { g as ToolbarInputItem };
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { SelectProps, SliderProps, TextFieldProps } from '@mui/material';
|
|
3
|
+
import { SxProps, Theme } from '@mui/material/styles';
|
|
4
|
+
/**
|
|
5
|
+
* Possible value types for SToolBar inputs
|
|
6
|
+
*/
|
|
7
|
+
export type SToolBarValue = string | number | File | (string | File)[] | null;
|
|
8
|
+
/**
|
|
9
|
+
* Base type constraint for select options
|
|
10
|
+
*/
|
|
11
|
+
export type SToolBarOption = string | number | Record<string, unknown>;
|
|
12
|
+
/**
|
|
13
|
+
* Supported input types for SToolBar
|
|
14
|
+
*/
|
|
15
|
+
export type SToolBarInputType = 'textarea' | 'slider' | 'image' | 'number' | 'select';
|
|
16
|
+
/**
|
|
17
|
+
* Configuration for individual toolbar input fields
|
|
18
|
+
*/
|
|
19
|
+
export interface SToolBarInput {
|
|
20
|
+
/** Unique identifier for the input */
|
|
21
|
+
key: string;
|
|
22
|
+
/** Display label for the input */
|
|
23
|
+
label: string;
|
|
24
|
+
/** Input type */
|
|
25
|
+
type: SToolBarInputType;
|
|
26
|
+
/** Whether the input is required */
|
|
27
|
+
required?: boolean;
|
|
28
|
+
/** Default value for the input */
|
|
29
|
+
defaultValue?: SToolBarValue;
|
|
30
|
+
/** Placeholder text (for textarea/number/select inputs) */
|
|
31
|
+
placeholder?: string;
|
|
32
|
+
/** Minimum value (for slider/number inputs) */
|
|
33
|
+
min?: number;
|
|
34
|
+
/** Maximum value (for slider/number inputs) */
|
|
35
|
+
max?: number;
|
|
36
|
+
/** Step value (for slider/number inputs) */
|
|
37
|
+
step?: number;
|
|
38
|
+
/** Minimum rows for textarea */
|
|
39
|
+
minRows?: number;
|
|
40
|
+
/** Maximum rows for textarea */
|
|
41
|
+
maxRows?: number;
|
|
42
|
+
/** Allow multiple images (for image inputs) */
|
|
43
|
+
multiple?: boolean;
|
|
44
|
+
/** Maximum number of images (for image inputs with multiple=true) */
|
|
45
|
+
maxImages?: number;
|
|
46
|
+
/** Select options (for select inputs) */
|
|
47
|
+
options?: SToolBarOption[];
|
|
48
|
+
/** Key to extract label from option objects (for select inputs) */
|
|
49
|
+
optionLabel?: string;
|
|
50
|
+
/** Key to extract value from option objects (for select inputs) */
|
|
51
|
+
optionValue?: string;
|
|
52
|
+
/** Enable search functionality in select dropdown */
|
|
53
|
+
searchable?: boolean;
|
|
54
|
+
/** Placeholder for search input in select dropdown */
|
|
55
|
+
searchPlaceholder?: string;
|
|
56
|
+
/**
|
|
57
|
+
* Extra props forwarded to the underlying child component.
|
|
58
|
+
* Each key targets the matching input type:
|
|
59
|
+
* - `textarea` / `number` → MUI `TextField`
|
|
60
|
+
* - `slider` → MUI `Slider`
|
|
61
|
+
* - `select` → `SSelect`
|
|
62
|
+
* - `image` → native `<input type="file">`
|
|
63
|
+
*
|
|
64
|
+
* Only the props relevant to the current `type` are used.
|
|
65
|
+
*/
|
|
66
|
+
componentProps?: SToolBarComponentProps;
|
|
67
|
+
/** Custom renderer for the input */
|
|
68
|
+
renderInput?: (props: {
|
|
69
|
+
value: SToolBarValue;
|
|
70
|
+
onChange: (value: SToolBarValue) => void;
|
|
71
|
+
onFocus: () => void;
|
|
72
|
+
onBlur: () => void;
|
|
73
|
+
disabled?: boolean;
|
|
74
|
+
}) => React.ReactNode;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Per-type overrides forwarded to the underlying child components.
|
|
78
|
+
* Omit props that are already managed by SToolBar to avoid conflicts.
|
|
79
|
+
*/
|
|
80
|
+
export interface SToolBarComponentProps {
|
|
81
|
+
/** Extra props for the MUI TextField used in `textarea` inputs */
|
|
82
|
+
textarea?: Omit<TextFieldProps, 'value' | 'onChange' | 'onFocus' | 'onBlur' | 'disabled' | 'multiline' | 'minRows' | 'maxRows' | 'fullWidth' | 'placeholder'>;
|
|
83
|
+
/** Extra props for the MUI TextField used in `number` inputs */
|
|
84
|
+
number?: Omit<TextFieldProps, 'value' | 'onChange' | 'onFocus' | 'onBlur' | 'disabled' | 'type' | 'slotProps'>;
|
|
85
|
+
/** Extra props for the MUI Slider used in `slider` inputs */
|
|
86
|
+
slider?: Omit<SliderProps, 'value' | 'onChange' | 'onMouseDown' | 'onMouseUp' | 'disabled' | 'min' | 'max' | 'step'>;
|
|
87
|
+
/** Extra props for SSelect used in `select` inputs */
|
|
88
|
+
select?: Omit<SelectProps, 'ref' | 'value' | 'onChange' | 'onFocus' | 'onBlur' | 'disabled' | 'error' | 'variant'> & {
|
|
89
|
+
/** Field label displayed above the select */
|
|
90
|
+
label?: string | React.ReactNode;
|
|
91
|
+
/** Error message to display below the field */
|
|
92
|
+
error?: string;
|
|
93
|
+
/** Whether the field is required */
|
|
94
|
+
required?: boolean;
|
|
95
|
+
/** Whether to use simple value rendering */
|
|
96
|
+
simple?: boolean;
|
|
97
|
+
/** HTML id attribute for the select element */
|
|
98
|
+
htmlFor?: string;
|
|
99
|
+
/** Custom render function for dropdown options */
|
|
100
|
+
renderOption?: (option: SToolBarOption) => React.ReactNode;
|
|
101
|
+
};
|
|
102
|
+
/** Extra props for the native `<input type="file">` element used in `image` inputs */
|
|
103
|
+
image?: Omit<React.InputHTMLAttributes<HTMLInputElement>, 'ref' | 'type' | 'multiple' | 'onChange' | 'disabled' | 'style'>;
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Props shared by the built-in input controls rendered inside SToolBar
|
|
107
|
+
*/
|
|
108
|
+
export interface SToolBarInputControlProps {
|
|
109
|
+
/** Input configuration */
|
|
110
|
+
input: SToolBarInput;
|
|
111
|
+
/** Current value of the input */
|
|
112
|
+
value: SToolBarValue;
|
|
113
|
+
/** Callback when the value changes */
|
|
114
|
+
onChange: (value: SToolBarValue) => void;
|
|
115
|
+
/** Callback when the input gains focus */
|
|
116
|
+
onFocus: () => void;
|
|
117
|
+
/** Callback when the input loses focus */
|
|
118
|
+
onBlur: () => void;
|
|
119
|
+
/** Whether the input is disabled */
|
|
120
|
+
disabled?: boolean;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Props interface for SToolBar component
|
|
124
|
+
*/
|
|
125
|
+
export interface SToolBarProps {
|
|
126
|
+
/** Configuration for input fields */
|
|
127
|
+
inputs?: SToolBarInput[];
|
|
128
|
+
/** Callback when process button is clicked */
|
|
129
|
+
onProcess?: () => void;
|
|
130
|
+
/** Callback when reset button is clicked */
|
|
131
|
+
onReset?: () => void;
|
|
132
|
+
/** Callback when download button is clicked */
|
|
133
|
+
onDownload?: () => void;
|
|
134
|
+
/** Whether the toolbar is in processing state */
|
|
135
|
+
processing?: boolean;
|
|
136
|
+
/** Whether the toolbar is in uploading state */
|
|
137
|
+
uploading?: boolean;
|
|
138
|
+
/** Input values controlled externally */
|
|
139
|
+
inputValues?: Record<string, SToolBarValue>;
|
|
140
|
+
/** Callback when input values change */
|
|
141
|
+
onInputChange?: (key: string, value: SToolBarValue, file?: File) => void;
|
|
142
|
+
/** Custom action buttons between inputs and standard actions */
|
|
143
|
+
customActionButtons?: React.ReactNode;
|
|
144
|
+
/** Hide the main process button */
|
|
145
|
+
hideProcessButton?: boolean;
|
|
146
|
+
/** Override to disable the process button */
|
|
147
|
+
processButtonDisabled?: boolean;
|
|
148
|
+
/** Function to check if an input should be disabled */
|
|
149
|
+
getInputDisabled?: (inputKey: string) => boolean;
|
|
150
|
+
/** Tooltip for process button */
|
|
151
|
+
processTooltip?: string;
|
|
152
|
+
/** Tooltip for download button */
|
|
153
|
+
downloadTooltip?: string;
|
|
154
|
+
/** Tooltip for reset button */
|
|
155
|
+
resetTooltip?: string;
|
|
156
|
+
/** Tooltip for info button */
|
|
157
|
+
infoTooltip?: string;
|
|
158
|
+
/** Info dialog title */
|
|
159
|
+
infoTitle?: string;
|
|
160
|
+
/** Info dialog content */
|
|
161
|
+
infoContent?: React.ReactNode;
|
|
162
|
+
/** Position of the toolbar */
|
|
163
|
+
position?: 'bottom' | 'top';
|
|
164
|
+
/** Use relative positioning within container instead of fixed viewport positioning */
|
|
165
|
+
relative?: boolean;
|
|
166
|
+
/** Custom styles for the outer container (wrapper) */
|
|
167
|
+
containerSx?: SxProps<Theme>;
|
|
168
|
+
/** Custom styles for the inner toolbar box */
|
|
169
|
+
sx?: SxProps<Theme>;
|
|
170
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { SToolBarInput, SToolBarValue } from './types';
|
|
2
|
+
export declare function isRequiredInputFilled(input: SToolBarInput, value: SToolBarValue): boolean;
|
|
3
|
+
export declare function getImageInputFiles(value: SToolBarValue): Array<string | File>;
|
|
4
|
+
export declare function groupInputsByType(inputs: SToolBarInput[]): {
|
|
5
|
+
imageInputs: SToolBarInput[];
|
|
6
|
+
textareaInputs: SToolBarInput[];
|
|
7
|
+
paramInputs: SToolBarInput[];
|
|
8
|
+
};
|
|
9
|
+
export declare function hasVisibleInputSection(imageInputs: SToolBarInput[], paramInputs: SToolBarInput[]): boolean;
|
|
10
|
+
export declare function isProcessActionDisabled(processButtonDisabled: boolean, areRequiredInputsFilled: boolean, uploading: boolean, processing: boolean): boolean;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
//#region lib/s-tool-bar/utils.ts
|
|
2
|
+
function e(e, t) {
|
|
3
|
+
return e.required ? e.type === "textarea" ? typeof t == "string" && t.trim() !== "" : e.type === "number" || e.type === "slider" ? t != null : e.type === "select" ? t != null && t !== "" : !0 : !0;
|
|
4
|
+
}
|
|
5
|
+
function t(e) {
|
|
6
|
+
return Array.isArray(e) ? e : e instanceof File || typeof e == "string" ? [e] : [];
|
|
7
|
+
}
|
|
8
|
+
function n(e) {
|
|
9
|
+
return e.reduce((e, t) => (t.type === "image" ? e.imageInputs.push(t) : t.type === "textarea" ? e.textareaInputs.push(t) : e.paramInputs.push(t), e), {
|
|
10
|
+
imageInputs: [],
|
|
11
|
+
textareaInputs: [],
|
|
12
|
+
paramInputs: []
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
function r(e, t) {
|
|
16
|
+
return e.length > 0 || t.length > 0;
|
|
17
|
+
}
|
|
18
|
+
function i(e, t, n, r) {
|
|
19
|
+
return e || !t || n || r;
|
|
20
|
+
}
|
|
21
|
+
//#endregion
|
|
22
|
+
export { t as getImageInputFiles, n as groupInputsByType, r as hasVisibleInputSection, i as isProcessActionDisabled, e as isRequiredInputFilled };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { c as e } from "../../theme-primitives-7ruiI7gY.js";
|
|
2
2
|
//#region lib/theme/components/accordion-summary.tsx
|
|
3
3
|
var t = { styleOverrides: { root: ({ theme: t }) => ({
|
|
4
4
|
border: "none",
|
|
5
|
-
borderRadius:
|
|
5
|
+
borderRadius: (t.vars ?? t).shape.borderRadius,
|
|
6
6
|
"&:hover": { backgroundColor: e[50] },
|
|
7
7
|
"&:focus-visible": { backgroundColor: "transparent" },
|
|
8
8
|
...t.applyStyles("dark", { "&:hover": { backgroundColor: e[800] } })
|