@seedgrid/fe-components 2026.11.2 → 2026.11.4
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/ai/seedgrid-components.manifest.json +350 -65
- package/dist/buttons/SgButton.d.ts +6 -2
- package/dist/buttons/SgButton.d.ts.map +1 -1
- package/dist/buttons/SgButton.js +2 -2
- package/dist/buttons/SgButton.meta.js +3 -3
- package/dist/buttons/SgFloatActionButton.d.ts +2 -2
- package/dist/buttons/SgFloatActionButton.d.ts.map +1 -1
- package/dist/buttons/SgFloatActionButton.js +7 -7
- package/dist/buttons/SgFloatActionButton.meta.js +2 -2
- package/dist/buttons/SgSplitButton.d.ts +2 -2
- package/dist/buttons/SgSplitButton.d.ts.map +1 -1
- package/dist/buttons/SgSplitButton.js +4 -4
- package/dist/buttons/SgSplitButton.meta.js +3 -3
- package/dist/commons/SgAvatar.d.ts +2 -2
- package/dist/commons/SgAvatar.d.ts.map +1 -1
- package/dist/commons/SgAvatar.js +3 -3
- package/dist/commons/SgBadge.d.ts +1 -1
- package/dist/commons/SgBadge.d.ts.map +1 -1
- package/dist/commons/SgBadge.js +3 -3
- package/dist/gadgets/calendar/SgCalendar.d.ts +6 -0
- package/dist/gadgets/calendar/SgCalendar.d.ts.map +1 -1
- package/dist/gadgets/calendar/SgCalendar.js +9 -5
- package/dist/gadgets/calendar/SgCalendar.meta.d.ts.map +1 -1
- package/dist/gadgets/calendar/SgCalendar.meta.js +1 -0
- package/dist/generated/compiledStyles.d.ts +1 -1
- package/dist/generated/compiledStyles.d.ts.map +1 -1
- package/dist/generated/compiledStyles.js +1 -1
- package/dist/i18n/en-US.d.ts.map +1 -1
- package/dist/i18n/en-US.js +26 -0
- package/dist/i18n/es.d.ts.map +1 -1
- package/dist/i18n/es.js +26 -0
- package/dist/i18n/fr.d.ts.map +1 -1
- package/dist/i18n/fr.js +26 -0
- package/dist/i18n/pt-BR.d.ts.map +1 -1
- package/dist/i18n/pt-BR.js +26 -0
- package/dist/i18n/pt-PT.d.ts.map +1 -1
- package/dist/i18n/pt-PT.js +26 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/inputs/SgAutocomplete.d.ts +1 -1
- package/dist/inputs/SgAutocomplete.d.ts.map +1 -1
- package/dist/inputs/SgAutocomplete.js +3 -3
- package/dist/inputs/SgCameraCapture.d.ts +1 -1
- package/dist/inputs/SgCameraCapture.d.ts.map +1 -1
- package/dist/inputs/SgCameraCapture.js +4 -4
- package/dist/inputs/SgCameraCapture.meta.js +1 -1
- package/dist/inputs/SgCheckboxGroup.d.ts +2 -2
- package/dist/inputs/SgCheckboxGroup.d.ts.map +1 -1
- package/dist/inputs/SgCheckboxGroup.js +12 -12
- package/dist/inputs/SgCombobox.js +5 -5
- package/dist/inputs/SgDatatable.d.ts +7 -0
- package/dist/inputs/SgDatatable.d.ts.map +1 -1
- package/dist/inputs/SgDatatable.js +33 -21
- package/dist/inputs/SgDatatable.meta.d.ts.map +1 -1
- package/dist/inputs/SgDatatable.meta.js +5 -1
- package/dist/inputs/SgFileUpload.d.ts +1 -1
- package/dist/inputs/SgFileUpload.d.ts.map +1 -1
- package/dist/inputs/SgFileUpload.js +2 -2
- package/dist/inputs/SgFileUpload.meta.js +1 -1
- package/dist/inputs/SgImageUpload.meta.js +1 -1
- package/dist/inputs/SgInputCurrency.d.ts.map +1 -1
- package/dist/inputs/SgInputCurrency.js +6 -4
- package/dist/inputs/SgInputDate.d.ts.map +1 -1
- package/dist/inputs/SgInputDate.js +3 -4
- package/dist/inputs/SgInputDateTime.d.ts.map +1 -1
- package/dist/inputs/SgInputDateTime.js +11 -0
- package/dist/inputs/SgInputNumber.d.ts.map +1 -1
- package/dist/inputs/SgInputNumber.js +6 -4
- package/dist/inputs/SgInputText.d.ts.map +1 -1
- package/dist/inputs/SgInputText.js +6 -4
- package/dist/inputs/SgInputTextArea.d.ts.map +1 -1
- package/dist/inputs/SgInputTextArea.js +4 -2
- package/dist/inputs/SgMultiSelect.meta.js +1 -1
- package/dist/inputs/SgMultiSelectChips.meta.js +1 -1
- package/dist/inputs/SgMultiSelectDropdown.js +1 -1
- package/dist/inputs/SgOrderList.d.ts +3 -3
- package/dist/inputs/SgOrderList.d.ts.map +1 -1
- package/dist/inputs/SgOrderList.js +13 -13
- package/dist/inputs/SgOrderList.meta.js +1 -1
- package/dist/inputs/SgPeriodSelector.d.ts +1 -1
- package/dist/inputs/SgPeriodSelector.d.ts.map +1 -1
- package/dist/inputs/SgPeriodSelector.js +3 -3
- package/dist/inputs/SgPickList.d.ts +3 -3
- package/dist/inputs/SgPickList.d.ts.map +1 -1
- package/dist/inputs/SgPickList.js +28 -28
- package/dist/inputs/SgPickList.meta.js +1 -1
- package/dist/inputs/SgRadioGroup.d.ts +2 -2
- package/dist/inputs/SgRadioGroup.d.ts.map +1 -1
- package/dist/inputs/SgRadioGroup.js +5 -5
- package/dist/inputs/SgRating.d.ts +1 -1
- package/dist/inputs/SgRating.d.ts.map +1 -1
- package/dist/inputs/SgRating.js +7 -7
- package/dist/inputs/SgRating.meta.js +1 -1
- package/dist/inputs/SgSlider.d.ts +1 -1
- package/dist/inputs/SgSlider.d.ts.map +1 -1
- package/dist/inputs/SgSlider.js +3 -3
- package/dist/inputs/SgSlider.meta.js +1 -1
- package/dist/inputs/SgStepperInput.d.ts +2 -2
- package/dist/inputs/SgStepperInput.d.ts.map +1 -1
- package/dist/inputs/SgStepperInput.js +4 -4
- package/dist/inputs/SgStepperInput.meta.js +1 -1
- package/dist/inputs/SgTextEditor.d.ts +1 -1
- package/dist/inputs/SgTextEditor.d.ts.map +1 -1
- package/dist/inputs/SgTextEditor.js +14 -14
- package/dist/inputs/SgToggleSwitch.meta.js +1 -1
- package/dist/inputs/SgYearPartSelector.d.ts +1 -1
- package/dist/inputs/SgYearPartSelector.d.ts.map +1 -1
- package/dist/inputs/SgYearPartSelector.js +1 -2
- package/dist/inputs/SgYearPartSelector.meta.js +2 -2
- package/dist/inputs/dateTimeLogic.d.ts +7 -1
- package/dist/inputs/dateTimeLogic.d.ts.map +1 -1
- package/dist/inputs/dateTimeLogic.js +17 -4
- package/dist/inputs/useSgMultiSelect.d.ts +1 -1
- package/dist/inputs/useSgMultiSelect.d.ts.map +1 -1
- package/dist/inputs/useSgMultiSelect.js +1 -1
- package/dist/layout/SgAccordion.d.ts +1 -1
- package/dist/layout/SgAccordion.d.ts.map +1 -1
- package/dist/layout/SgAccordion.js +3 -3
- package/dist/layout/SgBreadcrumb.d.ts +1 -1
- package/dist/layout/SgBreadcrumb.d.ts.map +1 -1
- package/dist/layout/SgBreadcrumb.js +1 -1
- package/dist/layout/SgCard.d.ts +1 -1
- package/dist/layout/SgCard.d.ts.map +1 -1
- package/dist/layout/SgCard.js +14 -14
- package/dist/layout/SgMenu.d.ts +1 -1
- package/dist/layout/SgMenu.d.ts.map +1 -1
- package/dist/layout/SgMenu.js +15 -15
- package/dist/layout/SgPageControl.d.ts +1 -1
- package/dist/layout/SgPageControl.d.ts.map +1 -1
- package/dist/layout/SgPageControl.js +4 -4
- package/dist/layout/SgPageControlPage.meta.js +2 -2
- package/dist/layout/SgToolBar.d.ts +1 -1
- package/dist/layout/SgToolBar.d.ts.map +1 -1
- package/dist/layout/SgToolBar.js +4 -4
- package/dist/layout/SgToolbarIconButton.meta.js +2 -2
- package/dist/layout/SgTreeView.d.ts +4 -4
- package/dist/layout/SgTreeView.d.ts.map +1 -1
- package/dist/layout/SgTreeView.js +6 -6
- package/dist/menus/SgDockMenu.d.ts +1 -1
- package/dist/menus/SgDockMenu.d.ts.map +1 -1
- package/dist/menus/SgDockMenu.js +4 -4
- package/dist/notifications/SgNotificationBell.d.ts +51 -0
- package/dist/notifications/SgNotificationBell.d.ts.map +1 -0
- package/dist/notifications/SgNotificationBell.js +348 -0
- package/dist/notifications/SgNotificationBell.meta.d.ts +4 -0
- package/dist/notifications/SgNotificationBell.meta.d.ts.map +1 -0
- package/dist/notifications/SgNotificationBell.meta.js +75 -0
- package/dist/notifications/notificationBellLogic.d.ts +148 -0
- package/dist/notifications/notificationBellLogic.d.ts.map +1 -0
- package/dist/notifications/notificationBellLogic.js +244 -0
- package/dist/overlay/SgConfirmationDialog.d.ts +1 -1
- package/dist/overlay/SgConfirmationDialog.d.ts.map +1 -1
- package/dist/overlay/SgConfirmationDialog.js +1 -1
- package/dist/overlay/SgPopup.d.ts +1 -1
- package/dist/overlay/SgPopup.d.ts.map +1 -1
- package/dist/overlay/SgPopup.js +1 -1
- package/dist/realtime/SgRealtimeProvider.d.ts +5 -0
- package/dist/realtime/SgRealtimeProvider.d.ts.map +1 -1
- package/dist/realtime/SgRealtimeProvider.js +31 -8
- package/dist/sandbox.cjs +64 -64
- package/dist/style.css +1 -1
- package/dist/wizard/SgWizard.d.ts +7 -0
- package/dist/wizard/SgWizard.d.ts.map +1 -1
- package/dist/wizard/SgWizard.js +11 -2
- package/dist/wizard/SgWizard.meta.d.ts.map +1 -1
- package/dist/wizard/SgWizard.meta.js +1 -0
- package/package.json +3 -3
package/dist/layout/SgCard.js
CHANGED
|
@@ -41,7 +41,7 @@ function DefaultCaret({ open, size }) {
|
|
|
41
41
|
}
|
|
42
42
|
export function SgCard(props) {
|
|
43
43
|
const i18n = useComponentsI18n();
|
|
44
|
-
const { id, className, headerClassName, bodyClassName, footerClassName, bgColor, bgColorTitle, bgColorFooter, cardStyle = "default", size = "md", leading, trailing, trailer, title, description, actions, header, footer, clickable = false,
|
|
44
|
+
const { id, className, headerClassName, bodyClassName, footerClassName, bgColor, bgColorTitle, bgColorFooter, cardStyle = "default", size = "md", leading, trailing, trailer, title, description, actions, header, footer, clickable = false, enabled = true, collapsible = false, defaultOpen = true, open: controlledOpen, onOpenChange, collapseIcon, collapseIconSize = 18, collapseToggleAlign = "left", toggleOnHeaderClick = true, draggable = false, defaultPosition, dragPersistKey, onPositionChange, style, onClick, children, ...rest } = props;
|
|
45
45
|
const hasEnvironmentProvider = useHasSgEnvironmentProvider();
|
|
46
46
|
const { load: loadPersistedState, save: savePersistedState, clear: clearPersistedState } = useSgPersistence();
|
|
47
47
|
const isInteractive = (clickable || typeof onClick === "function") && !collapsible && !draggable;
|
|
@@ -193,9 +193,9 @@ export function SgCard(props) {
|
|
|
193
193
|
? "bg-background border border-border shadow-md"
|
|
194
194
|
: "bg-background border border-border shadow-sm";
|
|
195
195
|
const interactiveClasses = isInteractive
|
|
196
|
-
? cn("transition-[box-shadow,transform] duration-150", "hover:shadow-md", "focus-visible:outline-none focus-visible:ring-4 focus-visible:ring-[hsl(var(--primary)/0.35)]",
|
|
196
|
+
? cn("transition-[box-shadow,transform] duration-150", "hover:shadow-md", "focus-visible:outline-none focus-visible:ring-4 focus-visible:ring-[hsl(var(--primary)/0.35)]", !enabled ? "" : "cursor-pointer", !enabled ? "" : "active:translate-y-[0.5px]")
|
|
197
197
|
: "";
|
|
198
|
-
const disabledClasses =
|
|
198
|
+
const disabledClasses = !enabled ? "opacity-60 pointer-events-none select-none" : "";
|
|
199
199
|
const rootClasses = cn("w-full", sizeClasses.root, variantClasses, interactiveClasses, disabledClasses, draggable ? "touch-none" : "", className);
|
|
200
200
|
const toggle = React.useCallback(() => setOpen(!isOpen), [isOpen, setOpen]);
|
|
201
201
|
const onHeaderClick = () => {
|
|
@@ -207,12 +207,12 @@ export function SgCard(props) {
|
|
|
207
207
|
return;
|
|
208
208
|
if (!toggleOnHeaderClick)
|
|
209
209
|
return;
|
|
210
|
-
if (
|
|
210
|
+
if (!enabled)
|
|
211
211
|
return;
|
|
212
212
|
toggle();
|
|
213
213
|
};
|
|
214
214
|
const onHeaderPointerDown = React.useCallback((event) => {
|
|
215
|
-
if (!draggable ||
|
|
215
|
+
if (!draggable || !enabled)
|
|
216
216
|
return;
|
|
217
217
|
if (event.button !== 0)
|
|
218
218
|
return;
|
|
@@ -232,7 +232,7 @@ export function SgCard(props) {
|
|
|
232
232
|
event.currentTarget.setPointerCapture?.(event.pointerId);
|
|
233
233
|
setDragging(true);
|
|
234
234
|
event.preventDefault();
|
|
235
|
-
}, [
|
|
235
|
+
}, [enabled, draggable]);
|
|
236
236
|
const onHeaderPointerMove = React.useCallback((event) => {
|
|
237
237
|
const state = dragStateRef.current;
|
|
238
238
|
if (!state || state.pointerId !== event.pointerId)
|
|
@@ -266,7 +266,7 @@ export function SgCard(props) {
|
|
|
266
266
|
// ignore
|
|
267
267
|
}
|
|
268
268
|
}, []);
|
|
269
|
-
const headerInteractionClasses =
|
|
269
|
+
const headerInteractionClasses = !enabled
|
|
270
270
|
? ""
|
|
271
271
|
: draggable
|
|
272
272
|
? dragging
|
|
@@ -278,7 +278,7 @@ export function SgCard(props) {
|
|
|
278
278
|
const ToggleButton = collapsible ? (_jsx("button", { "data-sg-card-toggle": "true", type: "button", onClick: (e) => {
|
|
279
279
|
e.stopPropagation();
|
|
280
280
|
toggle();
|
|
281
|
-
}, className: cn("inline-flex h-9 w-9 items-center justify-center rounded-md", "text-muted-foreground hover:text-foreground", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[hsl(var(--primary)/0.35)]"), "aria-label": isOpen ? t(i18n, "components.actions.collapse") : t(i18n, "components.actions.expand"), "aria-expanded": isOpen, disabled:
|
|
281
|
+
}, className: cn("inline-flex h-9 w-9 items-center justify-center rounded-md", "text-muted-foreground hover:text-foreground", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[hsl(var(--primary)/0.35)]"), "aria-label": isOpen ? t(i18n, "components.actions.collapse") : t(i18n, "components.actions.expand"), "aria-expanded": isOpen, disabled: !enabled, children: collapseIcon ?? _jsx(DefaultCaret, { open: isOpen, size: collapseIconSize }) })) : null;
|
|
282
282
|
const headerHasContent = Boolean(header) ||
|
|
283
283
|
Boolean(leading) ||
|
|
284
284
|
Boolean(title) ||
|
|
@@ -286,16 +286,16 @@ export function SgCard(props) {
|
|
|
286
286
|
Boolean(trailingNode) ||
|
|
287
287
|
Boolean(actions) ||
|
|
288
288
|
collapsible;
|
|
289
|
-
const renderDefaultHeader = headerHasContent ? (_jsxs("div", { className: cn("flex items-start gap-3", "border-b border-border/60", sizeClasses.header, headerClassName, headerInteractionClasses), style: bgColorTitle ? { backgroundColor: bgColorTitle } : undefined, onClick: onHeaderClick, onPointerDown: onHeaderPointerDown, onPointerMove: onHeaderPointerMove, onPointerUp: endHeaderDrag, onPointerCancel: endHeaderDrag, role: collapsible && toggleOnHeaderClick ? "button" : undefined, tabIndex: collapsible && toggleOnHeaderClick &&
|
|
290
|
-
if (!collapsible || !toggleOnHeaderClick ||
|
|
289
|
+
const renderDefaultHeader = headerHasContent ? (_jsxs("div", { className: cn("flex items-start gap-3", "border-b border-border/60", sizeClasses.header, headerClassName, headerInteractionClasses), style: bgColorTitle ? { backgroundColor: bgColorTitle } : undefined, onClick: onHeaderClick, onPointerDown: onHeaderPointerDown, onPointerMove: onHeaderPointerMove, onPointerUp: endHeaderDrag, onPointerCancel: endHeaderDrag, role: collapsible && toggleOnHeaderClick ? "button" : undefined, tabIndex: collapsible && toggleOnHeaderClick && enabled ? 0 : undefined, onKeyDown: (e) => {
|
|
290
|
+
if (!collapsible || !toggleOnHeaderClick || !enabled)
|
|
291
291
|
return;
|
|
292
292
|
if (e.key === "Enter" || e.key === " ") {
|
|
293
293
|
e.preventDefault();
|
|
294
294
|
toggle();
|
|
295
295
|
}
|
|
296
296
|
}, "aria-expanded": collapsible ? isOpen : undefined, children: [collapseToggleAlign === "left" ? ToggleButton : null, leading ? _jsx("div", { className: "shrink-0 pt-0.5", children: leading }) : null, _jsxs("div", { className: "min-w-0 flex-1", children: [title ? (_jsx("div", { className: cn("font-medium text-foreground", sizeClasses.title), children: title })) : null, description ? (_jsx("div", { className: cn("mt-0.5 text-muted-foreground", sizeClasses.desc), children: description })) : null] }), _jsxs("div", { className: "flex shrink-0 items-center gap-2", children: [trailingNode ? _jsx("div", { className: "shrink-0", children: trailingNode }) : null, actions ? _jsx("div", { className: "shrink-0", children: actions }) : null, collapseToggleAlign === "right" ? ToggleButton : null] })] })) : null;
|
|
297
|
-
const headerNode = header ? (_jsx("div", { className: cn("border-b border-border/60", sizeClasses.header, headerClassName, headerInteractionClasses), style: bgColorTitle ? { backgroundColor: bgColorTitle } : undefined, onClick: onHeaderClick, onPointerDown: onHeaderPointerDown, onPointerMove: onHeaderPointerMove, onPointerUp: endHeaderDrag, onPointerCancel: endHeaderDrag, role: collapsible && toggleOnHeaderClick ? "button" : undefined, tabIndex: collapsible && toggleOnHeaderClick &&
|
|
298
|
-
if (!collapsible || !toggleOnHeaderClick ||
|
|
297
|
+
const headerNode = header ? (_jsx("div", { className: cn("border-b border-border/60", sizeClasses.header, headerClassName, headerInteractionClasses), style: bgColorTitle ? { backgroundColor: bgColorTitle } : undefined, onClick: onHeaderClick, onPointerDown: onHeaderPointerDown, onPointerMove: onHeaderPointerMove, onPointerUp: endHeaderDrag, onPointerCancel: endHeaderDrag, role: collapsible && toggleOnHeaderClick ? "button" : undefined, tabIndex: collapsible && toggleOnHeaderClick && enabled ? 0 : undefined, onKeyDown: (e) => {
|
|
298
|
+
if (!collapsible || !toggleOnHeaderClick || !enabled)
|
|
299
299
|
return;
|
|
300
300
|
if (e.key === "Enter" || e.key === " ") {
|
|
301
301
|
e.preventDefault();
|
|
@@ -306,8 +306,8 @@ export function SgCard(props) {
|
|
|
306
306
|
const bodyNode = !collapsible ? _jsx("div", { className: cn(sizeClasses.body, bodyClassName), children: children }) : null;
|
|
307
307
|
const footerNode = !collapsible && footer ? (_jsx("div", { className: cn("border-t border-border/60", sizeClasses.footer, footerClassName), style: bgColorFooter ? { backgroundColor: bgColorFooter } : undefined, children: footer })) : null;
|
|
308
308
|
const Component = isInteractive ? "button" : "section";
|
|
309
|
-
const buttonLikeProps = isInteractive ? { type: "button", onClick:
|
|
310
|
-
const passiveOnClickProps = !isInteractive && typeof onClick === "function" ? { onClick:
|
|
309
|
+
const buttonLikeProps = isInteractive ? { type: "button", onClick: !enabled ? undefined : onClick, disabled: !enabled } : {};
|
|
310
|
+
const passiveOnClickProps = !isInteractive && typeof onClick === "function" ? { onClick: !enabled ? undefined : onClick } : {};
|
|
311
311
|
const roundedDragX = Math.round(dragPosition.x);
|
|
312
312
|
const roundedDragY = Math.round(dragPosition.y);
|
|
313
313
|
const shouldApplyDragTransform = draggable && (dragging || roundedDragX !== 0 || roundedDragY !== 0);
|
package/dist/layout/SgMenu.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SgMenu.d.ts","sourceRoot":"","sources":["../../src/layout/SgMenu.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,EAAqB,KAAK,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAGpF,OAAO,EAAmB,KAAK,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAKpE,MAAM,MAAM,UAAU,GAAG;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,UAAU,EAAE,CAAC;IACxB,
|
|
1
|
+
{"version":3,"file":"SgMenu.d.ts","sourceRoot":"","sources":["../../src/layout/SgMenu.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,EAAqB,KAAK,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAGpF,OAAO,EAAmB,KAAK,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAKpE,MAAM,MAAM,UAAU,GAAG;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,UAAU,EAAE,CAAC;IACxB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,KAAK,C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AE,OAAO,CAAC;IAExB,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,UAAU,KAAK,IAAI,CAAC;IACxC,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,UAAU,KAAK,IAAI,CAAC;IACtC,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,UAAU,KAAK,IAAI,CAAC;IAEzC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,MAAM,CAAC,EAAE;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,WAAW,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAEpD,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAAC;IACjC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,gBAAgB,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAEvC,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC1B,CAAC;AA2HF,wBAAgB,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,WAAW,CAAC,2CA2hDlD;yBA3hDe,MAAM"}
|
package/dist/layout/SgMenu.js
CHANGED
|
@@ -423,7 +423,7 @@ export function SgMenu(props) {
|
|
|
423
423
|
}));
|
|
424
424
|
}, [maps.childrenByParent, maps.parentById, mode, setExpandedIds]);
|
|
425
425
|
const activateNode = React.useCallback((node) => {
|
|
426
|
-
if (node.
|
|
426
|
+
if ((node.enabled === false))
|
|
427
427
|
return;
|
|
428
428
|
hideMenuHint();
|
|
429
429
|
onItemClick?.(node);
|
|
@@ -593,7 +593,7 @@ export function SgMenu(props) {
|
|
|
593
593
|
const openNow = hasSearch || expandedSet.has(node.id);
|
|
594
594
|
const isExactActive = activeSets.exact.has(node.id);
|
|
595
595
|
const isBranchActive = activeSets.branch.has(node.id);
|
|
596
|
-
const disabled =
|
|
596
|
+
const disabled = node.enabled === false;
|
|
597
597
|
const iconNode = resolveIcon(node);
|
|
598
598
|
const hideChildren = isCollapsed;
|
|
599
599
|
const nodeHint = node.hint ?? (isCollapsed ? node.label : undefined);
|
|
@@ -642,8 +642,8 @@ export function SgMenu(props) {
|
|
|
642
642
|
const isBranchActive = activeSets.branch.has(node.id);
|
|
643
643
|
const hasChildren = !!node.children?.length;
|
|
644
644
|
const iconNode = resolveIcon(node);
|
|
645
|
-
return (_jsxs("button", { type: "button", disabled: node.
|
|
646
|
-
if (node.
|
|
645
|
+
return (_jsxs("button", { type: "button", disabled: node.enabled === false, "aria-current": isExactActive ? "page" : undefined, onMouseEnter: node.hint ? (event) => showMenuHint(event.currentTarget, node.hint) : undefined, onMouseLeave: node.hint ? hideMenuHint : undefined, onClick: () => {
|
|
646
|
+
if ((node.enabled === false))
|
|
647
647
|
return;
|
|
648
648
|
const intent = resolveMenuNodeActionIntent({
|
|
649
649
|
variant: "flat",
|
|
@@ -657,7 +657,7 @@ export function SgMenu(props) {
|
|
|
657
657
|
? "bg-primary/15 text-primary"
|
|
658
658
|
: isBranchActive
|
|
659
659
|
? "bg-muted/60 text-foreground"
|
|
660
|
-
: "text-foreground hover:bg-muted/60", node.
|
|
660
|
+
: "text-foreground hover:bg-muted/60", (node.enabled === false) ? "cursor-not-allowed opacity-55" : "", className), children: [_jsx("span", { className: cn("inline-flex shrink-0 items-center justify-center rounded", densityCfg.icon, iconNode ? "" : "bg-muted text-[10px] font-semibold"), children: iconNode ?? firstChars(node.label, 1) }), _jsx("span", { className: "min-w-0 flex-1 truncate", children: node.label }), hasChildren ? _jsx(ChevronRight, { className: "size-4 shrink-0 text-muted-foreground" }) : null] }, node.id));
|
|
661
661
|
}, [activateNode, activeSets.branch, activeSets.exact, densityCfg.icon, hideMenuHint, showMenuHint]);
|
|
662
662
|
const renderTieredLevels = React.useCallback((nodes, depth) => {
|
|
663
663
|
if (!nodes.length)
|
|
@@ -671,7 +671,7 @@ export function SgMenu(props) {
|
|
|
671
671
|
const isOpen = activeIdAtDepth === node.id;
|
|
672
672
|
const isExactActive = activeSets.exact.has(node.id);
|
|
673
673
|
const iconNode = resolveIcon(node);
|
|
674
|
-
return (_jsxs("button", { type: "button", disabled: node.
|
|
674
|
+
return (_jsxs("button", { type: "button", disabled: node.enabled === false, "aria-current": isExactActive ? "page" : undefined, onMouseEnter: (event) => {
|
|
675
675
|
if (node.hint)
|
|
676
676
|
showMenuHint(event.currentTarget, node.hint);
|
|
677
677
|
setTieredPath((prev) => resolveTieredHoverIntent({
|
|
@@ -682,7 +682,7 @@ export function SgMenu(props) {
|
|
|
682
682
|
openSubmenuOnHover
|
|
683
683
|
}) ?? prev);
|
|
684
684
|
}, onMouseLeave: node.hint ? hideMenuHint : undefined, onClick: () => {
|
|
685
|
-
if (node.
|
|
685
|
+
if ((node.enabled === false))
|
|
686
686
|
return;
|
|
687
687
|
const nextState = resolveTieredNodeClickIntent({
|
|
688
688
|
currentPath: tieredPath,
|
|
@@ -701,7 +701,7 @@ export function SgMenu(props) {
|
|
|
701
701
|
setTieredPath([]);
|
|
702
702
|
}
|
|
703
703
|
activateNode(node);
|
|
704
|
-
}, className: cn("flex w-full items-center gap-2 rounded-md px-2.5 py-2 text-left text-sm transition-colors", isExactActive ? "bg-primary/15 text-primary" : isOpen ? "bg-muted/70" : "hover:bg-muted/60", node.
|
|
704
|
+
}, className: cn("flex w-full items-center gap-2 rounded-md px-2.5 py-2 text-left text-sm transition-colors", isExactActive ? "bg-primary/15 text-primary" : isOpen ? "bg-muted/70" : "hover:bg-muted/60", (node.enabled === false) ? "cursor-not-allowed opacity-55" : ""), children: [_jsx("span", { className: cn("inline-flex shrink-0 items-center justify-center rounded", densityCfg.icon, iconNode ? "" : "bg-muted text-[10px] font-semibold"), children: iconNode ?? firstChars(node.label, 1) }), _jsx("span", { className: "min-w-0 flex-1 truncate", children: node.label }), hasChildren ? (tieredOpenToLeft ? (_jsx(ChevronLeft, { className: "size-4 shrink-0 text-muted-foreground" })) : (_jsx(ChevronRight, { className: "size-4 shrink-0 text-muted-foreground" }))) : null] }, node.id));
|
|
705
705
|
}) }), activeNode?.children?.length
|
|
706
706
|
? renderTieredLevels(activeNode.children, depth + 1)
|
|
707
707
|
: null] }));
|
|
@@ -737,7 +737,7 @@ export function SgMenu(props) {
|
|
|
737
737
|
const hasChildren = !!node.children?.length;
|
|
738
738
|
const active = activeMegaNode?.id === node.id;
|
|
739
739
|
const iconNode = resolveIcon(node);
|
|
740
|
-
return (_jsxs("button", { type: "button", disabled: node.
|
|
740
|
+
return (_jsxs("button", { type: "button", disabled: node.enabled === false, onMouseEnter: (event) => {
|
|
741
741
|
if (node.hint)
|
|
742
742
|
showMenuHint(event.currentTarget, node.hint);
|
|
743
743
|
const nextMegaActiveId = resolveMegaMenuHoverActiveId({
|
|
@@ -747,7 +747,7 @@ export function SgMenu(props) {
|
|
|
747
747
|
if (nextMegaActiveId)
|
|
748
748
|
setMegaActiveId(nextMegaActiveId);
|
|
749
749
|
}, onMouseLeave: node.hint ? hideMenuHint : undefined, onClick: () => {
|
|
750
|
-
if (node.
|
|
750
|
+
if ((node.enabled === false))
|
|
751
751
|
return;
|
|
752
752
|
const nextState = resolveMegaMenuInteraction({
|
|
753
753
|
nodeId: node.id,
|
|
@@ -759,14 +759,14 @@ export function SgMenu(props) {
|
|
|
759
759
|
if (!nextState.shouldActivateNode)
|
|
760
760
|
return;
|
|
761
761
|
activateNode(node);
|
|
762
|
-
}, className: cn("inline-flex items-center gap-2 rounded-md px-3 py-2 text-sm transition-colors", active ? "bg-muted/80 text-foreground" : "hover:bg-muted/60", node.
|
|
762
|
+
}, className: cn("inline-flex items-center gap-2 rounded-md px-3 py-2 text-sm transition-colors", active ? "bg-muted/80 text-foreground" : "hover:bg-muted/60", (node.enabled === false) ? "cursor-not-allowed opacity-55" : ""), children: [iconNode ? (_jsx("span", { className: cn("inline-flex shrink-0 items-center justify-center", densityCfg.icon), children: iconNode })) : null, _jsx("span", { className: "truncate", children: node.label }), hasChildren ? _jsx(ChevronDown, { className: "size-4 shrink-0 text-muted-foreground" }) : null] }, node.id));
|
|
763
763
|
}) }), _jsx("div", { className: "p-4", children: renderMegaColumns(activeMegaNode?.children ?? []) })] }));
|
|
764
764
|
}
|
|
765
765
|
return (_jsxs("div", { className: "flex rounded-md border border-border bg-background", children: [_jsx("div", { className: "w-52 shrink-0 border-r border-border p-1", children: items.map((node) => {
|
|
766
766
|
const hasChildren = !!node.children?.length;
|
|
767
767
|
const active = activeMegaNode?.id === node.id;
|
|
768
768
|
const iconNode = resolveIcon(node);
|
|
769
|
-
return (_jsxs("button", { type: "button", disabled: node.
|
|
769
|
+
return (_jsxs("button", { type: "button", disabled: node.enabled === false, onMouseEnter: (event) => {
|
|
770
770
|
if (node.hint)
|
|
771
771
|
showMenuHint(event.currentTarget, node.hint);
|
|
772
772
|
const nextMegaActiveId = resolveMegaMenuHoverActiveId({
|
|
@@ -776,7 +776,7 @@ export function SgMenu(props) {
|
|
|
776
776
|
if (nextMegaActiveId)
|
|
777
777
|
setMegaActiveId(nextMegaActiveId);
|
|
778
778
|
}, onMouseLeave: node.hint ? hideMenuHint : undefined, onClick: () => {
|
|
779
|
-
if (node.
|
|
779
|
+
if ((node.enabled === false))
|
|
780
780
|
return;
|
|
781
781
|
const nextState = resolveMegaMenuInteraction({
|
|
782
782
|
nodeId: node.id,
|
|
@@ -788,7 +788,7 @@ export function SgMenu(props) {
|
|
|
788
788
|
if (!nextState.shouldActivateNode)
|
|
789
789
|
return;
|
|
790
790
|
activateNode(node);
|
|
791
|
-
}, className: cn("flex w-full items-center gap-2 rounded-md px-2.5 py-2 text-left text-sm transition-colors", active ? "bg-muted/80 text-foreground" : "hover:bg-muted/60", node.
|
|
791
|
+
}, className: cn("flex w-full items-center gap-2 rounded-md px-2.5 py-2 text-left text-sm transition-colors", active ? "bg-muted/80 text-foreground" : "hover:bg-muted/60", (node.enabled === false) ? "cursor-not-allowed opacity-55" : ""), children: [iconNode ? (_jsx("span", { className: cn("inline-flex shrink-0 items-center justify-center", densityCfg.icon), children: iconNode })) : null, _jsx("span", { className: "min-w-0 flex-1 truncate", children: node.label }), hasChildren ? _jsx(ChevronRight, { className: "size-4 shrink-0 text-muted-foreground" }) : null] }, node.id));
|
|
792
792
|
}) }), _jsx("div", { className: "min-h-[220px] flex-1 p-4", children: renderMegaColumns(activeMegaNode?.children ?? []) })] }));
|
|
793
793
|
};
|
|
794
794
|
const showDockDragHandle = dockMode && draggable && (!isCollapsed || isHorizontalDockZone);
|
|
@@ -831,7 +831,7 @@ export function SgMenu(props) {
|
|
|
831
831
|
if (!nodeId)
|
|
832
832
|
return;
|
|
833
833
|
const node = maps.nodeById.get(nodeId);
|
|
834
|
-
if (!node || node.
|
|
834
|
+
if (!node || (node.enabled === false))
|
|
835
835
|
return;
|
|
836
836
|
const parentChain = collectParentChain(maps.parentById, node.id);
|
|
837
837
|
const rootToParent = [...parentChain].reverse();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SgPageControl.d.ts","sourceRoot":"","sources":["../../src/layout/SgPageControl.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAO/B,MAAM,MAAM,sBAAsB,GAAG;IACnC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,
|
|
1
|
+
{"version":3,"file":"SgPageControl.d.ts","sourceRoot":"","sources":["../../src/layout/SgPageControl.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAO/B,MAAM,MAAM,sBAAsB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;IACxB;;;;;;OAMG;IACH,iBAAiB,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAC;IACxC,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAE7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAE/B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B,CAAC;AA4CF,wBAAgB,aAAa,CAAC,KAAK,EAAE,QAAQ,CAAC,kBAAkB,CAAC,2CA+ThE;yBA/Te,aAAa;;;AAmU7B,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,2CAExE;yBAFe,iBAAiB"}
|
|
@@ -77,7 +77,7 @@ export function SgPageControl(props) {
|
|
|
77
77
|
}, [onActiveIndexChange, onActivePageIdChange, visiblePages]);
|
|
78
78
|
const selectPage = React.useCallback((nextId) => {
|
|
79
79
|
const next = visiblePages.find((record) => record.id === nextId);
|
|
80
|
-
if (!next || next.props.
|
|
80
|
+
if (!next || (next.props.enabled === false))
|
|
81
81
|
return;
|
|
82
82
|
if (!isControlled)
|
|
83
83
|
setInternalActiveId(nextId);
|
|
@@ -144,7 +144,7 @@ export function SgPageControl(props) {
|
|
|
144
144
|
// Alternativa do celular: as abas viram um select nativo. Fica escondido a partir
|
|
145
145
|
// do tablet, e a troca e feita por CSS (nao por media query em JS) para nao
|
|
146
146
|
// depender do tamanho da janela na primeira renderizacao.
|
|
147
|
-
_jsx("div", { className: "mb-2 md:hidden", children: _jsx("select", { "aria-label": resolvedAriaLabel, value: resolvedActiveId ?? "", onChange: (event) => selectPage(event.target.value), className: cn("w-full rounded-md border border-border bg-background px-3 font-medium text-foreground", sizeClasses.select), children: visiblePages.map((record) => (_jsx("option", { value: record.id, disabled: record.props.
|
|
147
|
+
_jsx("div", { className: "mb-2 md:hidden", children: _jsx("select", { "aria-label": resolvedAriaLabel, value: resolvedActiveId ?? "", onChange: (event) => selectPage(event.target.value), className: cn("w-full rounded-md border border-border bg-background px-3 font-medium text-foreground", sizeClasses.select), children: visiblePages.map((record) => (_jsx("option", { value: record.id, disabled: record.props.enabled === false, children: optionLabel(record) }, record.id))) }) })) : null, _jsx("div", { role: "tablist", ref: tabListRef, "aria-label": resolvedAriaLabel, className: cn("min-h-0 items-end gap-1 overflow-x-auto border-b border-border pb-0.5",
|
|
148
148
|
// Um unico utilitario de display por breakpoint. Antes `flex` e `grid` saiam
|
|
149
149
|
// juntos no mesmo elemento e quem vencia dependia da ordem no CSS gerado.
|
|
150
150
|
mobilePageControl === "select" ? "hidden" : "flex", fullWidthTabs ? "md:grid md:auto-cols-fr md:grid-flow-col" : "md:flex", tabListClassName), onKeyDown: (event) => {
|
|
@@ -188,10 +188,10 @@ export function SgPageControl(props) {
|
|
|
188
188
|
const panelId = `${rootId}-panel-${record.id}`;
|
|
189
189
|
return (_jsxs("button", { ref: (el) => {
|
|
190
190
|
tabsRef.current[index] = el;
|
|
191
|
-
}, type: "button", id: tabId, role: "tab", "aria-controls": panelId, "aria-selected": isActive, tabIndex: isActive ? 0 : -1, title: record.props.hint, disabled: record.props.
|
|
191
|
+
}, type: "button", id: tabId, role: "tab", "aria-controls": panelId, "aria-selected": isActive, tabIndex: isActive ? 0 : -1, title: record.props.hint, disabled: record.props.enabled === false, onClick: () => selectPage(record.id), className: cn("inline-flex shrink-0 items-center justify-center whitespace-nowrap font-medium transition-colors", sizeClasses.tab, tabStyle.base, isActive ? tabStyle.active : tabStyle.inactive,
|
|
192
192
|
// No celular a lista e flex com rolagem: `w-full` faria cada aba ocupar a
|
|
193
193
|
// largura toda do container.
|
|
194
|
-
fullWidthTabs ? "md:w-full" : "", record.props.
|
|
194
|
+
fullWidthTabs ? "md:w-full" : "", (record.props.enabled === false) ? "cursor-not-allowed opacity-45" : "", tabClassName, record.props.tabClassName), children: [record.props.icon ? (_jsx("span", { className: cn("inline-flex items-center justify-center", sizeClasses.icon), children: record.props.icon })) : null, _jsx("span", { className: "truncate", children: record.props.title })] }, record.id));
|
|
195
195
|
}) }), _jsx("div", { className: cn("rounded-b-md border border-t-0 border-border bg-background", panelClassName), children: visiblePages.length === 0 ? (_jsx("div", { className: cn(sizeClasses.panel, "text-sm text-muted-foreground"), children: resolvedEmptyMessage })) : keepMounted ? (visiblePages.map((record) => {
|
|
196
196
|
const isActive = record.id === resolvedActiveId;
|
|
197
197
|
const tabId = `${rootId}-tab-${record.id}`;
|
|
@@ -17,13 +17,13 @@ export const sgMeta = {
|
|
|
17
17
|
{ name: "hint", type: "string", description: "Descricao curta associada a aba.", semanticRole: "label", bindable: true },
|
|
18
18
|
{ name: "icon", type: "ReactNode", description: "Icone opcional da aba.", semanticRole: "label", bindable: true },
|
|
19
19
|
{ name: "hidden", type: "boolean", default: false, description: "Oculta a pagina sem remove-la da estrutura.", semanticRole: "behavior", bindable: true },
|
|
20
|
-
{ name: "
|
|
20
|
+
{ name: "enabled", type: "boolean", default: true, description: "Desabilita a selecao da pagina.", semanticRole: "behavior", bindable: true },
|
|
21
21
|
{ name: "children", type: "ReactNode", required: true, description: "Conteudo exibido no painel desta pagina.", semanticRole: "data", bindable: false }
|
|
22
22
|
],
|
|
23
23
|
states: ["default", "active", "hidden", "disabled"],
|
|
24
24
|
examples: [{ id: "basic", title: "Basico", file: "apps/showcase/src/app/components/sg-page-control/samples/basico.tsx.sample", kind: "sample" }],
|
|
25
25
|
showcase: { route: "/components/sg-page-control", hasPlayground: true, hasPropsTable: true },
|
|
26
|
-
sdui: { rendererType: "navigation.page-control-page", acceptsDataBinding: true, defaultProps: { hidden: false,
|
|
26
|
+
sdui: { rendererType: "navigation.page-control-page", acceptsDataBinding: true, defaultProps: { hidden: false, enabled: true } }
|
|
27
27
|
};
|
|
28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jBe,SAAS;;;AAwjBzB,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,QAAQ,CAAC,wBAAwB,GAAG;IAAE,SAAS,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC,2CAiJpE;yBAlJe,mBAAmB"}
|
package/dist/layout/SgToolBar.js
CHANGED
|
@@ -479,7 +479,7 @@ export function SgToolBar(props) {
|
|
|
479
479
|
return toolbarForRender;
|
|
480
480
|
}
|
|
481
481
|
export function SgToolbarIconButton(props) {
|
|
482
|
-
const { icon, label, showLabel = true, hint, loading = false, severity = "plain",
|
|
482
|
+
const { icon, label, showLabel = true, hint, loading = false, severity = "plain", enabled = true, onClick, hideLabel, className, style } = props;
|
|
483
483
|
const toolbarOrientation = React.useContext(SgToolbarOrientationContext);
|
|
484
484
|
const isHorizontalToolbar = toolbarOrientation === "horizontal";
|
|
485
485
|
const c = BTN_COLORS[severity];
|
|
@@ -492,7 +492,7 @@ export function SgToolbarIconButton(props) {
|
|
|
492
492
|
const [isHintHovered, setIsHintHovered] = React.useState(false);
|
|
493
493
|
const buttonRef = React.useRef(null);
|
|
494
494
|
const handleClick = React.useCallback(() => {
|
|
495
|
-
if (!onClick ||
|
|
495
|
+
if (!onClick || !enabled || isLoading)
|
|
496
496
|
return;
|
|
497
497
|
const result = onClick();
|
|
498
498
|
if (!result || typeof result.then !== "function")
|
|
@@ -501,7 +501,7 @@ export function SgToolbarIconButton(props) {
|
|
|
501
501
|
void result.finally(() => {
|
|
502
502
|
setIsPending(false);
|
|
503
503
|
});
|
|
504
|
-
}, [
|
|
504
|
+
}, [enabled, isLoading, onClick]);
|
|
505
505
|
const updateHintPosition = React.useCallback(() => {
|
|
506
506
|
if (!buttonRef.current)
|
|
507
507
|
return;
|
|
@@ -546,7 +546,7 @@ export function SgToolbarIconButton(props) {
|
|
|
546
546
|
: "translateY(-50%)"
|
|
547
547
|
}, children: hint }), document.body)
|
|
548
548
|
: null;
|
|
549
|
-
return (_jsxs(_Fragment, { children: [_jsxs("button", { ref: buttonRef, type: "button", disabled:
|
|
549
|
+
return (_jsxs(_Fragment, { children: [_jsxs("button", { ref: buttonRef, type: "button", disabled: !enabled || isLoading, onClick: handleClick, "aria-busy": isLoading || undefined, onMouseEnter: showHintTooltip ? () => {
|
|
550
550
|
updateHintPosition();
|
|
551
551
|
setIsHintHovered(true);
|
|
552
552
|
} : undefined, onMouseLeave: showHintTooltip ? () => setIsHintHovered(false) : undefined, "aria-label": hint ?? label ?? text ?? undefined, className: cn("group", "relative inline-flex items-center justify-center rounded-lg", "transition-[transform,filter] duration-150", "hover:brightness-95 active:brightness-90", "focus-visible:outline-none focus-visible:ring-4", "disabled:opacity-50 disabled:cursor-not-allowed", hasVisibleLabel ? "gap-2 px-2 pr-3" : "", className), style: {
|
|
@@ -18,13 +18,13 @@ export const sgMeta = {
|
|
|
18
18
|
{ name: "showLabel", type: "boolean", default: false, description: "Exibe o rotulo junto do icone quando suportado pela toolbar.", semanticRole: "appearance", bindable: true },
|
|
19
19
|
{ name: "loading", type: "boolean", default: false, description: "Indica processamento em andamento.", semanticRole: "behavior", bindable: true },
|
|
20
20
|
{ name: "severity", type: '"primary" | "secondary" | "success" | "info" | "warning" | "help" | "danger" | "plain"', default: "plain", description: "Tom visual do botao de toolbar.", semanticRole: "appearance", bindable: true },
|
|
21
|
-
{ name: "
|
|
21
|
+
{ name: "enabled", type: "boolean", default: true, description: "Desabilita interacao.", semanticRole: "behavior", bindable: true },
|
|
22
22
|
{ name: "onClick", type: "() => void | Promise<void>", description: "Callback executado ao clicar no item.", semanticRole: "event", bindable: false }
|
|
23
23
|
],
|
|
24
24
|
states: ["default", "disabled", "loading"],
|
|
25
25
|
examples: [{ id: "basic", title: "Basico", file: "apps/showcase/src/app/components/sg-toolbar/samples/basico.tsx.sample", kind: "sample" }],
|
|
26
26
|
showcase: { route: "/components/sg-toolbar", hasPlayground: true, hasPropsTable: true },
|
|
27
|
-
sdui: { rendererType: "action.toolbar-icon-button", acceptsDataBinding: true, defaultProps: { showLabel: false, severity: "plain",
|
|
27
|
+
sdui: { rendererType: "action.toolbar-icon-button", acceptsDataBinding: true, defaultProps: { showLabel: false, severity: "plain", enabled: true } }
|
|
28
28
|
};
|
|
29
29
|
export const aiHints = {
|
|
30
30
|
version: "0.1",
|
|
@@ -7,14 +7,14 @@ export type SgTreeNode = {
|
|
|
7
7
|
label: string;
|
|
8
8
|
icon?: React.ReactNode;
|
|
9
9
|
children?: SgTreeNode[];
|
|
10
|
-
|
|
10
|
+
enabled?: boolean;
|
|
11
11
|
meta?: unknown;
|
|
12
12
|
};
|
|
13
13
|
export type SgTreeNodeJson = {
|
|
14
14
|
id: string;
|
|
15
15
|
label: string;
|
|
16
16
|
icon?: string;
|
|
17
|
-
|
|
17
|
+
enabled?: boolean;
|
|
18
18
|
checked?: boolean;
|
|
19
19
|
children?: SgTreeNodeJson[];
|
|
20
20
|
meta?: unknown;
|
|
@@ -40,7 +40,7 @@ export type SgTreeTrackBoolean = SgTreeTrackBase & {
|
|
|
40
40
|
kind: "boolean";
|
|
41
41
|
checkedIds: string[];
|
|
42
42
|
onCheckedChange: (ids: string[]) => void;
|
|
43
|
-
|
|
43
|
+
enabled?: (node: SgTreeNode) => boolean;
|
|
44
44
|
ariaLabel?: string;
|
|
45
45
|
/** Conteudo livre ao lado do controle desta coluna, por no'. O componente nao sabe (nem
|
|
46
46
|
* precisa saber) o que ele significa -- icone, badge, contador, o que a tela quiser. */
|
|
@@ -54,7 +54,7 @@ export type SgTreeTrackEnum = SgTreeTrackBase & {
|
|
|
54
54
|
}[];
|
|
55
55
|
valueByNodeId: Record<string, string | undefined>;
|
|
56
56
|
onChange: (next: Record<string, string | undefined>) => void;
|
|
57
|
-
|
|
57
|
+
enabled?: (node: SgTreeNode) => boolean;
|
|
58
58
|
ariaLabel?: string;
|
|
59
59
|
placeholder?: string;
|
|
60
60
|
mixedLabel?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SgTreeView.d.ts","sourceRoot":"","sources":["../../src/layout/SgTreeView.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAU/B,MAAM,MAAM,MAAM,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AACxC,MAAM,MAAM,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,aAAa,CAAC;AAC7D,MAAM,MAAM,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC;AAEzC,MAAM,MAAM,UAAU,GAAG;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,QAAQ,CAAC,EAAE,UAAU,EAAE,CAAC;IACxB,
|
|
1
|
+
{"version":3,"file":"SgTreeView.d.ts","sourceRoot":"","sources":["../../src/layout/SgTreeView.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAU/B,MAAM,MAAM,MAAM,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AACxC,MAAM,MAAM,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,aAAa,CAAC;AAC7D,MAAM,MAAM,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC;AAEzC,MAAM,MAAM,UAAU,GAAG;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,QAAQ,CAAC,EAAE,UAAU,EAAE,CAAC;IACxB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,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AAC;IACtC,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,UAAU,KAAK,IAAI,CAAC;IACxC,WAAW,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,mBAAmB,CAAC,EAAE,QAAQ,GAAG,MAAM,CAAC;IACxC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,cAAc,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,UAAU,CAAC,EAAE,gBAAgB,CAAC;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B,CAAC;AAEF,eAAO,MAAM,UAAU,uFA8hBrB,CAAC"}
|
|
@@ -12,7 +12,7 @@ export function sgTreeFromJson(json, iconRegistry) {
|
|
|
12
12
|
const walk = (list) => list.map((n) => ({
|
|
13
13
|
id: n.id,
|
|
14
14
|
label: n.label,
|
|
15
|
-
disabled: n.
|
|
15
|
+
disabled: n.enabled === false,
|
|
16
16
|
icon: n.icon ? iconRegistry?.[n.icon] : undefined,
|
|
17
17
|
children: n.children?.length ? walk(n.children) : undefined,
|
|
18
18
|
meta: n.meta
|
|
@@ -27,7 +27,7 @@ export function sgTreeFromJsonWithChecked(json, iconRegistry) {
|
|
|
27
27
|
return {
|
|
28
28
|
id: n.id,
|
|
29
29
|
label: n.label,
|
|
30
|
-
disabled: n.
|
|
30
|
+
disabled: n.enabled === false,
|
|
31
31
|
icon: n.icon ? iconRegistry?.[n.icon] : undefined,
|
|
32
32
|
children: n.children?.length ? walk(n.children) : undefined,
|
|
33
33
|
meta: n.meta
|
|
@@ -309,7 +309,7 @@ export const SgTreeView = React.forwardRef(function SgTreeView(props, ref) {
|
|
|
309
309
|
}
|
|
310
310
|
}, [checkMode, setCheckedIdsLive]);
|
|
311
311
|
const toggleCheck = React.useCallback((node) => {
|
|
312
|
-
if (!checkable || node.
|
|
312
|
+
if (!checkable || (node.enabled === false))
|
|
313
313
|
return;
|
|
314
314
|
const next = new Set(checkedSet);
|
|
315
315
|
const st = computeCheckedState(node.id, maps.childrenById, checkedSet);
|
|
@@ -365,7 +365,7 @@ export const SgTreeView = React.forwardRef(function SgTreeView(props, ref) {
|
|
|
365
365
|
const renderNode = (node, depth) => {
|
|
366
366
|
const hasChildren = !!node.children?.length;
|
|
367
367
|
const isOpen = expandedSet.has(node.id);
|
|
368
|
-
const isDisabled =
|
|
368
|
+
const isDisabled = node.enabled === false;
|
|
369
369
|
const checkedState = checkable ? computeCheckedState(node.id, maps.childrenById, checkedSet) : "unchecked";
|
|
370
370
|
return (_jsxs("div", { children: [_jsxs("div", { className: cn("flex items-center rounded-md", DY.rowPx, DY.rowPy, DY.gap, T.rowHover, isDisabled && "opacity-60"), style: { paddingLeft: 8 + depth * DY.indent }, children: [_jsx("button", { type: "button", className: cn(DY.caret, "shrink-0 rounded-md flex items-center justify-center", "hover:bg-sg-hover2 hover:bg-foreground/10", "focus:outline-none focus:ring-2 focus:ring-sg-focus/30", !hasChildren && "opacity-0 pointer-events-none"), onClick: () => hasChildren && !isDisabled && toggleExpand(node), "aria-label": isOpen ? t(i18n, "components.actions.collapse") : t(i18n, "components.actions.expand"), disabled: isDisabled, children: _jsx("span", { className: cn("transition-transform", isOpen && "rotate-90"), children: ">" }) }), checkable &&
|
|
371
371
|
(() => {
|
|
@@ -380,7 +380,7 @@ export const SgTreeView = React.forwardRef(function SgTreeView(props, ref) {
|
|
|
380
380
|
if (track.kind === "custom") {
|
|
381
381
|
return (_jsx("div", { className: cn(TRACK_CELL_CLASS, "flex items-center gap-1"), style: trackCellWidth(track), children: track.render(node) }, track.id));
|
|
382
382
|
}
|
|
383
|
-
const trackDisabled = isDisabled ||
|
|
383
|
+
const trackDisabled = isDisabled || track.enabled?.(node) === false;
|
|
384
384
|
const adornment = track.adornment?.(node) ?? null;
|
|
385
385
|
if (track.kind === "boolean") {
|
|
386
386
|
const checkedSetTrack = data.checkedSet;
|
|
@@ -415,6 +415,6 @@ export const SgTreeView = React.forwardRef(function SgTreeView(props, ref) {
|
|
|
415
415
|
}, disabled: isDisabled, children: node.label })] }), hasChildren && isOpen && _jsx("div", { children: node.children.map((c) => renderNode(c, depth + 1)) })] }, node.id));
|
|
416
416
|
};
|
|
417
417
|
const hasAny = filtered.length > 0;
|
|
418
|
-
return (_jsxs("div", { className: cn("w-full", className), style: style, children: [_jsxs("div", { className: "mb-2 flex items-center gap-2", children: [searchable && (_jsx(SgInputText, { id: searchId, labelText: searchPlaceholder, placeholder: searchPlaceholder, prefixIcon: _jsx(Search, { size: 16 }), clearButton: true, filled: true, inputProps: { value: search }, onChange: (value) => setSearch(value) })), _jsx(SgButton, { severity: "secondary", appearance: "ghost", size: "sm", shape: "rounded", onClick: expandAll, leftIcon: _jsx(ChevronDown, { className: "size-4" }), children: t(i18n, "components.actions.expandAll") }), _jsx(SgButton, { severity: "secondary", appearance: "ghost", size: "sm", shape: "rounded", onClick: collapseAll, leftIcon: _jsx(ChevronUp, { className: "size-4" }), children: t(i18n, "components.actions.collapseAll") }), checkable && (_jsx(SgButton, { severity: "danger", appearance: "outline", size: "sm", shape: "rounded", onClick: clearChecked, title: t(i18n, "components.actions.clearSelection"), children: t(i18n, "components.actions.clear") }))] }), _jsxs("div", { className: cn("rounded-sg border border-sg-border", T.panelBg, "text-sg-text"), children: [hasTracks && (_jsxs("div", { className: cn("flex items-center border-b border-sg-border", DY.rowPx, DY.rowPy, DY.gap, SZ.text, "font-semibold text-sg-muted"), children: [_jsx("span", { className: cn(DY.caret, "shrink-0") }), checkable && (_jsx("div", { className: cn(TRACK_CELL_CLASS, "truncate"), style: trackCellWidth({}), title: props.checkableLabel, children: props.checkableLabel })), (tracks ?? []).map((track) => (_jsx("div", { className: cn(TRACK_CELL_CLASS, "truncate"), style: trackCellWidth(track), title: track.label, children: track.label }, track.id)))] })), _jsx("div", { className: cn("overflow-auto", maxHeightClassName), children: _jsx("div", { className: "p-2", children: !hasAny ? (_jsx("div", { className: cn("p-6 text-center", SZ.text, T.subtle), children: emptyText })) : (filtered.map((n) => renderNode(n, 0))) }) }), confirmEnabled && confirmCfg && (_jsx("div", { className: cn("border-t border-sg-border px-3 py-2", (confirmCfg.sticky ?? true) && "sticky bottom-0 bg-sg-surface/95 bg-background/95 backdrop-blur"), children: _jsxs("div", { className: "flex items-center justify-between gap-3", children: [_jsx("div", { className: cn("text-xs", T.subtle), children: confirmCfg.hint ?? (_jsxs(_Fragment, { children: [t(i18n, "components.tree.selected", { count: confirmSelectedIds.length }), confirmSelection === "leafOnly" ? t(i18n, "components.tree.selectedLeafs") : ""] })) }), _jsxs("div", { className: "flex items-center gap-2", children: [(confirmCfg.showCancel ?? false) && (_jsx("button", { type: "button", onClick: onCancel, className: cn("rounded-md border border-sg-border", T.panelBg, "text-sg-text hover:bg-sg-hover", "focus:outline-none focus:ring-2 focus:ring-sg-focus/30", SZ.btn), children: confirmCfg.cancelLabel ?? t(i18n, "components.actions.cancel") })), _jsx(SgButton, { severity: "secondary", appearance: "outline", size: "md", shape: "rounded", onClick: clearChecked,
|
|
418
|
+
return (_jsxs("div", { className: cn("w-full", className), style: style, children: [_jsxs("div", { className: "mb-2 flex items-center gap-2", children: [searchable && (_jsx(SgInputText, { id: searchId, labelText: searchPlaceholder, placeholder: searchPlaceholder, prefixIcon: _jsx(Search, { size: 16 }), clearButton: true, filled: true, inputProps: { value: search }, onChange: (value) => setSearch(value) })), _jsx(SgButton, { severity: "secondary", appearance: "ghost", size: "sm", shape: "rounded", onClick: expandAll, leftIcon: _jsx(ChevronDown, { className: "size-4" }), children: t(i18n, "components.actions.expandAll") }), _jsx(SgButton, { severity: "secondary", appearance: "ghost", size: "sm", shape: "rounded", onClick: collapseAll, leftIcon: _jsx(ChevronUp, { className: "size-4" }), children: t(i18n, "components.actions.collapseAll") }), checkable && (_jsx(SgButton, { severity: "danger", appearance: "outline", size: "sm", shape: "rounded", onClick: clearChecked, title: t(i18n, "components.actions.clearSelection"), children: t(i18n, "components.actions.clear") }))] }), _jsxs("div", { className: cn("rounded-sg border border-sg-border", T.panelBg, "text-sg-text"), children: [hasTracks && (_jsxs("div", { className: cn("flex items-center border-b border-sg-border", DY.rowPx, DY.rowPy, DY.gap, SZ.text, "font-semibold text-sg-muted"), children: [_jsx("span", { className: cn(DY.caret, "shrink-0") }), checkable && (_jsx("div", { className: cn(TRACK_CELL_CLASS, "truncate"), style: trackCellWidth({}), title: props.checkableLabel, children: props.checkableLabel })), (tracks ?? []).map((track) => (_jsx("div", { className: cn(TRACK_CELL_CLASS, "truncate"), style: trackCellWidth(track), title: track.label, children: track.label }, track.id)))] })), _jsx("div", { className: cn("overflow-auto", maxHeightClassName), children: _jsx("div", { className: "p-2", children: !hasAny ? (_jsx("div", { className: cn("p-6 text-center", SZ.text, T.subtle), children: emptyText })) : (filtered.map((n) => renderNode(n, 0))) }) }), confirmEnabled && confirmCfg && (_jsx("div", { className: cn("border-t border-sg-border px-3 py-2", (confirmCfg.sticky ?? true) && "sticky bottom-0 bg-sg-surface/95 bg-background/95 backdrop-blur"), children: _jsxs("div", { className: "flex items-center justify-between gap-3", children: [_jsx("div", { className: cn("text-xs", T.subtle), children: confirmCfg.hint ?? (_jsxs(_Fragment, { children: [t(i18n, "components.tree.selected", { count: confirmSelectedIds.length }), confirmSelection === "leafOnly" ? t(i18n, "components.tree.selectedLeafs") : ""] })) }), _jsxs("div", { className: "flex items-center gap-2", children: [(confirmCfg.showCancel ?? false) && (_jsx("button", { type: "button", onClick: onCancel, className: cn("rounded-md border border-sg-border", T.panelBg, "text-sg-text hover:bg-sg-hover", "focus:outline-none focus:ring-2 focus:ring-sg-focus/30", SZ.btn), children: confirmCfg.cancelLabel ?? t(i18n, "components.actions.cancel") })), _jsx(SgButton, { severity: "secondary", appearance: "outline", size: "md", shape: "rounded", onClick: clearChecked, enabled: !(!!confirmDisabled), children: t(i18n, "components.actions.clear") }), _jsx(SgButton, { severity: "primary", appearance: "solid", elevation: "sm", size: "md", shape: "rounded", enabled: !(!!confirmDisabled), onClick: onConfirm, children: confirmCfg.label ?? t(i18n, "components.actions.confirm") })] })] }) }))] })] }));
|
|
419
419
|
});
|
|
420
420
|
SgTreeView.displayName = "SgTreeView";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SgDockMenu.d.ts","sourceRoot":"","sources":["../../src/menus/SgDockMenu.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAQ/B,MAAM,MAAM,kBAAkB,GAC1B,UAAU,GAAG,aAAa,GAAG,aAAa,GAC1C,YAAY,GAAG,eAAe,GAC9B,WAAW,GAAG,cAAc,GAAG,cAAc,CAAC;AAElD,MAAM,MAAM,qBAAqB,GAAG,YAAY,GAAG,UAAU,CAAC;AAE9D,MAAM,MAAM,cAAc,GAAG;IAC3B,wBAAwB;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,sBAAsB;IACtB,IAAI,EAAE,KAAK,CAAC,SAAS,CAAC;IACtB,yBAAyB;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,oBAAoB;IACpB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,qBAAqB;IACrB,
|
|
1
|
+
{"version":3,"file":"SgDockMenu.d.ts","sourceRoot":"","sources":["../../src/menus/SgDockMenu.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAQ/B,MAAM,MAAM,kBAAkB,GAC1B,UAAU,GAAG,aAAa,GAAG,aAAa,GAC1C,YAAY,GAAG,eAAe,GAC9B,WAAW,GAAG,cAAc,GAAG,cAAc,CAAC;AAElD,MAAM,MAAM,qBAAqB,GAAG,YAAY,GAAG,UAAU,CAAC;AAE9D,MAAM,MAAM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C,EAAE,MAAM,CAAC;IACtB,oBAAoB;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,uBAAuB;IACvB,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IACxC,mBAAmB;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B;AA0BD,wBAAgB,UAAU,CAAC,KAAK,EAAE,QAAQ,CAAC,eAAe,CAAC,2CA2f1D"}
|
package/dist/menus/SgDockMenu.js
CHANGED
|
@@ -265,7 +265,7 @@ export function SgDockMenu(props) {
|
|
|
265
265
|
dragMoved.current = false;
|
|
266
266
|
}, [clearStoredPosition, dragId, enableDragDrop, storageKey]);
|
|
267
267
|
const handleItemClick = React.useCallback((item) => {
|
|
268
|
-
if (item.
|
|
268
|
+
if ((item.enabled === false))
|
|
269
269
|
return;
|
|
270
270
|
if (dragMoved.current) {
|
|
271
271
|
dragMoved.current = false;
|
|
@@ -331,8 +331,8 @@ export function SgDockMenu(props) {
|
|
|
331
331
|
transformOrigin: motion.transformOrigin,
|
|
332
332
|
transition: "transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1)",
|
|
333
333
|
willChange: "transform",
|
|
334
|
-
cursor: item.
|
|
335
|
-
opacity: item.
|
|
334
|
+
cursor: (item.enabled === false) ? "not-allowed" : "pointer",
|
|
335
|
+
opacity: (item.enabled === false) ? 0.5 : 1,
|
|
336
336
|
zIndex: motion.zIndex,
|
|
337
337
|
}, onMouseEnter: () => setHoveredIndex(index), onMouseLeave: () => setHoveredIndex(null), children: [_jsx("button", { type: "button", className: "sg-dock-item-icon focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/35", style: {
|
|
338
338
|
width: "100%",
|
|
@@ -348,7 +348,7 @@ export function SgDockMenu(props) {
|
|
|
348
348
|
e.currentTarget.style.backgroundColor = itemSurfaceHoverColor;
|
|
349
349
|
}, onMouseLeave: (e) => {
|
|
350
350
|
e.currentTarget.style.backgroundColor = itemSurfaceColor;
|
|
351
|
-
}, onClick: () => handleItemClick(item), "aria-label": item.label, title: item.label, disabled: item.
|
|
351
|
+
}, onClick: () => handleItemClick(item), "aria-label": item.label, title: item.label, disabled: item.enabled === false, children: item.icon }), item.badge && (_jsx("div", { className: "sg-dock-item-badge", style: {
|
|
352
352
|
position: "absolute",
|
|
353
353
|
top: -4,
|
|
354
354
|
right: -4,
|