@tmlmobilidade/ui 20250919.1536.28 → 20250920.1941.29
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/index.d.ts
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
2
2
|
import { User, UnixTimestamp, UserPreferenceValue, Permission, Organization } from '@tmlmobilidade/types';
|
3
|
+
import * as react from 'react';
|
4
|
+
import react__default, { PropsWithChildren, ReactNode, CSSProperties, RefObject } from 'react';
|
3
5
|
import { ButtonProps as ButtonProps$2, BadgeProps as BadgeProps$1, ComboboxProps, MenuProps as MenuProps$1, MenuTargetProps as MenuTargetProps$1, MenuDropdownProps as MenuDropdownProps$1, MenuItemProps as MenuItemProps$1, MenuDividerProps as MenuDividerProps$1, MenuLabelProps as MenuLabelProps$1, TooltipProps as TooltipProps$1, CheckboxProps as CheckboxProps$1, CheckboxGroupProps as CheckboxGroupProps$1, PopoverProps as PopoverProps$1, PopoverTargetProps as PopoverTargetProps$1, PopoverDropdownProps as PopoverDropdownProps$1, SegmentedControlProps as SegmentedControlProps$1, SliderProps as SliderProps$1, SwitchProps as SwitchProps$1, TextProps as TextProps$1, NumberInputProps as NumberInputProps$1, PasswordInputProps, PillsInputProps as PillsInputProps$1, TextareaProps as TextareaProps$1, TextInputProps as TextInputProps$1 } from '@mantine/core';
|
4
6
|
export { Modal, RenderTreeNodePayload, Tree, TreeNodeData, getTreeExpandedState, useTree } from '@mantine/core';
|
5
|
-
import * as React$1 from 'react';
|
6
|
-
import React__default, { PropsWithChildren, ReactNode, CSSProperties, RefObject } from 'react';
|
7
7
|
import { Line, Stop } from '@carrismetropolitana/api-types/network';
|
8
8
|
export { ViewportList } from 'react-viewport-list';
|
9
9
|
import { DatePickerInputProps } from '@mantine/dates';
|
@@ -26,6 +26,7 @@ declare function Avatar({ user }: AvatarProps): react_jsx_runtime.JSX.Element;
|
|
26
26
|
interface HasPermissionProps {
|
27
27
|
action: string;
|
28
28
|
children: React.ReactNode;
|
29
|
+
fallback?: React.ReactNode;
|
29
30
|
scope: string;
|
30
31
|
}
|
31
32
|
interface ResourceKeyAndValue<T> {
|
@@ -37,7 +38,7 @@ interface NoResourceKeyOrValue {
|
|
37
38
|
value?: never;
|
38
39
|
}
|
39
40
|
type HasPermissionFinalProps<T> = HasPermissionProps & (NoResourceKeyOrValue | ResourceKeyAndValue<T>);
|
40
|
-
declare function HasPermission<T extends Record<string, unknown>>({ action, children, resource_key, scope, value }: HasPermissionFinalProps<T>): react_jsx_runtime.JSX.Element | null;
|
41
|
+
declare function HasPermission<T extends Record<string, unknown>>({ action, children, fallback, resource_key, scope, value }: HasPermissionFinalProps<T>): string | number | bigint | boolean | Iterable<react.ReactNode> | Promise<string | number | bigint | boolean | react.ReactPortal | react.ReactElement<unknown, string | react.JSXElementConstructor<any>> | Iterable<react.ReactNode> | null | undefined> | react_jsx_runtime.JSX.Element | null;
|
41
42
|
|
42
43
|
interface BackButtonProps {
|
43
44
|
onClick?: () => void;
|
@@ -47,7 +48,7 @@ declare function BackButton({ onClick, type }: BackButtonProps): react_jsx_runti
|
|
47
48
|
|
48
49
|
interface ButtonProps$1 extends ButtonProps$2 {
|
49
50
|
href?: string;
|
50
|
-
icon?:
|
51
|
+
icon?: react__default.ReactNode;
|
51
52
|
label?: string;
|
52
53
|
onClick?: () => void;
|
53
54
|
target?: string;
|
@@ -175,11 +176,11 @@ declare function CommentList({ data }: {
|
|
175
176
|
}): react_jsx_runtime.JSX.Element | null;
|
176
177
|
|
177
178
|
interface BadgeProps extends BadgeProps$1 {
|
178
|
-
children?:
|
179
|
+
children?: react__default.ReactNode;
|
179
180
|
disabled?: boolean;
|
180
181
|
filled?: boolean;
|
181
182
|
fullWidth?: boolean;
|
182
|
-
icon?:
|
183
|
+
icon?: react__default.ReactNode;
|
183
184
|
onClick?: () => void;
|
184
185
|
size?: 'lg' | 'md' | 'sm' | 'xl' | 'xs';
|
185
186
|
type?: 'pill' | 'tag';
|
@@ -220,7 +221,7 @@ declare function ComboboxComponent(props: Props$2): react_jsx_runtime.JSX.Elemen
|
|
220
221
|
declare function ComponentWrapper({ children }: PropsWithChildren): react_jsx_runtime.JSX.Element;
|
221
222
|
|
222
223
|
interface DescriptionProps {
|
223
|
-
children?:
|
224
|
+
children?: react__default.ReactNode;
|
224
225
|
singleLine?: boolean;
|
225
226
|
}
|
226
227
|
declare function Description({ children, singleLine }: DescriptionProps): react_jsx_runtime.JSX.Element;
|
@@ -555,7 +556,7 @@ declare function NoDataLabel({ text }: NoDataLabelProps): react_jsx_runtime.JSX.
|
|
555
556
|
|
556
557
|
interface TagProps {
|
557
558
|
filled?: boolean;
|
558
|
-
icon?:
|
559
|
+
icon?: react__default.ReactNode;
|
559
560
|
label?: number | string;
|
560
561
|
onClick?: () => void;
|
561
562
|
variant?: 'danger' | 'muted' | 'primary' | 'secondary' | 'success' | 'warning';
|
@@ -593,7 +594,7 @@ interface FilterTargetProps extends React.ComponentPropsWithoutRef<'div'> {
|
|
593
594
|
disabled?: boolean;
|
594
595
|
label: string;
|
595
596
|
}
|
596
|
-
declare const FilterTarget:
|
597
|
+
declare const FilterTarget: react.ForwardRefExoticComponent<FilterTargetProps & react.RefAttributes<HTMLDivElement>>;
|
597
598
|
|
598
599
|
interface FilterTypeDateRangeProps {
|
599
600
|
active?: boolean;
|
@@ -3,7 +3,7 @@ import { j as jsxRuntimeExports } from '../../../../_virtual/jsx-runtime.js';
|
|
3
3
|
import { useMeContext } from '../../../contexts/Me.context.js';
|
4
4
|
|
5
5
|
/* * */
|
6
|
-
function HasPermission({ action, children, resource_key, scope, value }) {
|
6
|
+
function HasPermission({ action, children, fallback, resource_key, scope, value }) {
|
7
7
|
//
|
8
8
|
//
|
9
9
|
// A. Setup variables
|
@@ -16,7 +16,7 @@ function HasPermission({ action, children, resource_key, scope, value }) {
|
|
16
16
|
if (meContext.actions.hasPermissionResource({ action, resource_key: resource_key ?? '', scope, value: value ?? '' })) {
|
17
17
|
return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: children });
|
18
18
|
}
|
19
|
-
return null;
|
19
|
+
return fallback ?? null;
|
20
20
|
//
|
21
21
|
}
|
22
22
|
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../src/components/authentication/HasPermission/index.tsx"],"sourcesContent":[null],"names":["_jsx","_Fragment"],"mappings":";;;;
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../src/components/authentication/HasPermission/index.tsx"],"sourcesContent":[null],"names":["_jsx","_Fragment"],"mappings":";;;;AA2BA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAEM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAU,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAa,CAAoC,CAAA,CAAE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,EAAE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAE,YAAY,CAAA,CAAE,CAAA,CAAA,CAAA,CAAA,CAAK,CAAA,CAAE,CAAA,CAAA,CAAA,CAAA,CAAK,EAA8B,CAAA,CAAA;;;;AAMtJ,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAS,CAAA,CAAA,CAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAY,CAAA,CAAE;;;AAKhC,CAAA,CAAA,CAAA,CAAA,IAAI,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAY,CAAA,CAAA,CAAA,CAAI,CAAC,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E,CAAA,CAAA,CAAA,CAAA,CAAK,CAAA,CAAE,CAAA,CAAA,CAAA,CAAA,CAAK,CAAA,CAAA,CAAA,CAAI,CAAA,CAAE,CAAA,CAAE,CAAC,CAAA,CAAE;QACrH,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAOD,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAA,CAAAC,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAI;IACvB;IAEA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAI,CAAA,CAAA,CAAA,CAAI;;AAGxB;;"}
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@tmlmobilidade/ui",
|
3
3
|
"description": "UI components for Transportes Metropolitanos de Lisboa (TML) web applications.",
|
4
|
-
"version": "
|
4
|
+
"version": "20250920.1941.29",
|
5
5
|
"author": "João de Vasconcelos & Jusi Monteiro",
|
6
6
|
"license": "AGPL-3.0-or-later",
|
7
7
|
"publishConfig": {
|