@headless-adminapp/fluent 1.3.3 → 1.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/DataGrid/GridListContainer.js +2 -5
- package/DataGrid/GridTableContainer.js +2 -5
- package/DataGrid/useTableColumns.js +6 -14
- package/PageEntityForm/CommandContainer.d.ts +5 -1
- package/PageEntityForm/CommandContainer.js +33 -4
- package/PageEntityForm/FormTabRelated.d.ts +1 -1
- package/PageEntityForm/FormTabRelated.js +7 -5
- package/PageEntityForm/PageCustomEntityForm.js +9 -7
- package/PageEntityForm/PageEntityForm.js +9 -7
- package/PageEntityForm/PageEntityFormDesktopContainer.js +24 -41
- package/PageEntityForm/ProcessFlow.d.ts +2 -1
- package/PageEntityForm/ProcessFlow.js +27 -12
- package/PageEntityForm/RecordAvatar.js +14 -0
- package/PageEntityForm/RelatedViewSelector.d.ts +1 -8
- package/PageEntityForm/SectionContainer.d.ts +2 -1
- package/PageEntityForm/SectionContainer.js +11 -9
- package/PageEntityForm/StandardControl.js +17 -36
- package/PageEntityView/PageEntityView.js +2 -1
- package/Skeleton/TextSkeleton.d.ts +10 -0
- package/Skeleton/TextSkeleton.js +21 -0
- package/form/controls/AttachmentControl.js +10 -3
- package/form/controls/AttachmentsControl.js +5 -1
- package/form/controls/CurrencyControl.d.ts +1 -1
- package/form/controls/CurrencyControl.js +5 -1
- package/form/controls/DateControl.d.ts +1 -1
- package/form/controls/DateControl.js +5 -1
- package/form/controls/DateRangeControl/DateRangeControl.d.ts +1 -1
- package/form/controls/DateRangeControl/DateRangeControl.js +5 -1
- package/form/controls/DateTimeControl.d.ts +1 -1
- package/form/controls/DateTimeControl.js +9 -1
- package/form/controls/DecimalControl.d.ts +1 -1
- package/form/controls/DecimalControl.js +5 -1
- package/form/controls/DurationControl.js +5 -1
- package/form/controls/EmailControl.d.ts +1 -1
- package/form/controls/EmailControl.js +5 -1
- package/form/controls/IdControl.d.ts +1 -1
- package/form/controls/IdControl.js +5 -1
- package/form/controls/IntegerControl.d.ts +1 -1
- package/form/controls/IntegerControl.js +5 -1
- package/form/controls/LookupControl.js +5 -1
- package/form/controls/MultiSelectControl.d.ts +1 -1
- package/form/controls/MultiSelectControl.js +5 -1
- package/form/controls/MultiSelectLookupControl.js +5 -1
- package/form/controls/RegardingControl.js +5 -1
- package/form/controls/RichTextControl.js +5 -1
- package/form/controls/SelectControl.d.ts +1 -1
- package/form/controls/SelectControl.js +5 -1
- package/form/controls/SkeletonControl.d.ts +7 -0
- package/form/controls/SkeletonControl.js +18 -0
- package/form/controls/SwitchControl.d.ts +1 -1
- package/form/controls/SwitchControl.js +5 -1
- package/form/controls/TelephoneControl.d.ts +1 -1
- package/form/controls/TelephoneControl.js +5 -1
- package/form/controls/TextAreaControl.d.ts +1 -1
- package/form/controls/TextAreaControl.js +5 -1
- package/form/controls/TextControl.d.ts +1 -1
- package/form/controls/TextControl.js +5 -1
- package/form/controls/TimeControl/TimeControl.d.ts +1 -1
- package/form/controls/TimeControl/TimeControl.js +5 -1
- package/form/controls/UrlControl.d.ts +1 -1
- package/form/controls/UrlControl.js +5 -1
- package/form/controls/types.d.ts +1 -0
- package/package.json +2 -2
|
@@ -10,6 +10,7 @@ const icons_1 = require("@headless-adminapp/icons");
|
|
|
10
10
|
const react_1 = require("react");
|
|
11
11
|
const AppStringContext_1 = require("../../App/AppStringContext");
|
|
12
12
|
const RecordCard_1 = require("../../PageEntityForm/RecordCard");
|
|
13
|
+
const SkeletonControl_1 = require("./SkeletonControl");
|
|
13
14
|
const useLookupData_1 = require("./useLookupData");
|
|
14
15
|
function MultiSelectLookupControl(props) {
|
|
15
16
|
const Control = LookupControlMd;
|
|
@@ -30,7 +31,7 @@ const useStyles = (0, react_components_1.makeStyles)({
|
|
|
30
31
|
},
|
|
31
32
|
},
|
|
32
33
|
});
|
|
33
|
-
const LookupControlMd = ({ value, onChange, id, name, onBlur, onFocus, placeholder, disabled, autoFocus, readOnly, dataService, schema, viewId, allowNavigation, allowNewRecord, }) => {
|
|
34
|
+
const LookupControlMd = ({ value, onChange, id, name, onBlur, onFocus, placeholder, disabled, autoFocus, readOnly, dataService, schema, viewId, allowNavigation, allowNewRecord, skeleton, }) => {
|
|
34
35
|
const [lookupEnabled, setLookupEnabled] = (0, react_1.useState)(false);
|
|
35
36
|
const [open, setOpen] = (0, react_1.useState)(false);
|
|
36
37
|
const [searchText, setSearchText] = (0, react_1.useState)('');
|
|
@@ -121,6 +122,9 @@ const LookupControlMd = ({ value, onChange, id, name, onBlur, onFocus, placehold
|
|
|
121
122
|
onChange?.(newValue);
|
|
122
123
|
}
|
|
123
124
|
};
|
|
125
|
+
if (skeleton) {
|
|
126
|
+
return (0, jsx_runtime_1.jsx)(SkeletonControl_1.SkeletonControl, {});
|
|
127
|
+
}
|
|
124
128
|
return ((0, jsx_runtime_1.jsxs)("div", { style: { position: 'relative', width: '100%', height: containerHeight }, children: [(0, jsx_runtime_1.jsxs)(react_components_1.Combobox, { name: name, appearance: "filled-darker", expandIcon: (0, jsx_runtime_1.jsx)("div", { style: { position: 'absolute', right: 4, bottom: 8 }, children: readOnly || disabled ? null : isLoading ? ((0, jsx_runtime_1.jsx)(react_components_1.Spinner, { size: "extra-tiny" })) : ((0, jsx_runtime_1.jsx)(icons_1.Icons.Search, { size: 18 })) }), input: {
|
|
125
129
|
style: {
|
|
126
130
|
position: 'absolute',
|
|
@@ -14,6 +14,7 @@ const react_1 = require("react");
|
|
|
14
14
|
const AppStringContext_1 = require("../../App/AppStringContext");
|
|
15
15
|
const RecordCard_1 = require("../../PageEntityForm/RecordCard");
|
|
16
16
|
const avatar_1 = require("../../utils/avatar");
|
|
17
|
+
const SkeletonControl_1 = require("./SkeletonControl");
|
|
17
18
|
const useLookupData_1 = require("./useLookupData");
|
|
18
19
|
function RegardingControl(props) {
|
|
19
20
|
const Control = LookupControlMd;
|
|
@@ -34,7 +35,7 @@ const useStyles = (0, react_components_1.makeStyles)({
|
|
|
34
35
|
},
|
|
35
36
|
},
|
|
36
37
|
});
|
|
37
|
-
const LookupControlMd = ({ value, onChange, id, name, onBlur, onFocus, placeholder, disabled, autoFocus, readOnly, dataService, entities, schemaStore, allowNavigation, }) => {
|
|
38
|
+
const LookupControlMd = ({ value, onChange, id, name, onBlur, onFocus, placeholder, disabled, autoFocus, readOnly, dataService, entities, schemaStore, allowNavigation, skeleton, }) => {
|
|
38
39
|
const [lookupEnabled, setLookupEnabled] = (0, react_1.useState)(false);
|
|
39
40
|
const [open, setOpen] = (0, react_1.useState)(false);
|
|
40
41
|
const [searchText, setSearchText] = (0, react_1.useState)('');
|
|
@@ -119,6 +120,9 @@ const LookupControlMd = ({ value, onChange, id, name, onBlur, onFocus, placehold
|
|
|
119
120
|
}
|
|
120
121
|
return schemaStore.getSchema(value?.logicalName);
|
|
121
122
|
}, [schemaStore, value]);
|
|
123
|
+
if (skeleton) {
|
|
124
|
+
return (0, jsx_runtime_1.jsx)(SkeletonControl_1.SkeletonControl, {});
|
|
125
|
+
}
|
|
122
126
|
return ((0, jsx_runtime_1.jsxs)("div", { style: { position: 'relative', width: '100%' }, children: [(0, jsx_runtime_1.jsxs)(react_components_1.Combobox, { name: name, appearance: "filled-darker", expandIcon: readOnly || disabled ? null : isLoading ? ((0, jsx_runtime_1.jsx)(react_components_1.Spinner, { size: "extra-tiny" })) : ((0, jsx_runtime_1.jsx)(icons_1.Icons.Search, { size: 18 })), placeholder: !value ? placeholder : '', inputMode: "search", style: { width: '100%', minWidth: 'unset' }, autoComplete: "off", readOnly: readOnly || disabled,
|
|
123
127
|
// disabled={disabled}
|
|
124
128
|
open: open && !value && !readOnly && !disabled, value: !value ? searchText : '', onOpenChange: (e, data) => setOpen(data.open), onChange: (e) => {
|
|
@@ -26,8 +26,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
26
26
|
exports.RichTextControl = void 0;
|
|
27
27
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
28
28
|
const react_1 = require("react");
|
|
29
|
+
const SkeletonControl_1 = require("./SkeletonControl");
|
|
29
30
|
const ReactQuill = (0, react_1.lazy)(() => Promise.resolve().then(() => __importStar(require('react-quill'))));
|
|
30
|
-
const RichTextControl = ({ value, onChange, id, onBlur, onFocus, disabled, readOnly, }) => {
|
|
31
|
+
const RichTextControl = ({ value, onChange, id, onBlur, onFocus, disabled, readOnly, skeleton, }) => {
|
|
32
|
+
if (skeleton) {
|
|
33
|
+
return (0, jsx_runtime_1.jsx)(SkeletonControl_1.SkeletonControl, { height: 200 });
|
|
34
|
+
}
|
|
31
35
|
return ((0, jsx_runtime_1.jsx)(react_1.Suspense, { children: (0, jsx_runtime_1.jsx)(ReactQuill, { value: value ?? '', onChange: onChange, className: "hdlapp_rte", readOnly: disabled || readOnly, style: { maxHeight: '400px', minHeight: '200px' }, onFocus: onFocus, onBlur: onBlur, id: id }) }));
|
|
32
36
|
};
|
|
33
37
|
exports.RichTextControl = RichTextControl;
|
|
@@ -6,4 +6,4 @@ export interface Lookup<T = string> {
|
|
|
6
6
|
export interface SelectControlProps<T> extends ControlProps<T> {
|
|
7
7
|
options: Lookup<T>[];
|
|
8
8
|
}
|
|
9
|
-
export default function SelectControl<T extends string | number>({ value, onChange, options, id, name, disabled, onBlur, onFocus, placeholder, }: Readonly<SelectControlProps<T>>): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export default function SelectControl<T extends string | number>({ value, onChange, options, id, name, disabled, onBlur, onFocus, placeholder, skeleton, }: Readonly<SelectControlProps<T>>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -4,7 +4,8 @@ exports.default = SelectControl;
|
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_components_1 = require("@fluentui/react-components");
|
|
6
6
|
const react_1 = require("react");
|
|
7
|
-
|
|
7
|
+
const SkeletonControl_1 = require("./SkeletonControl");
|
|
8
|
+
function SelectControl({ value, onChange, options, id, name, disabled, onBlur, onFocus, placeholder, skeleton, }) {
|
|
8
9
|
const transformedOptions = (0, react_1.useMemo)(() => options.map((x) => ({ label: x.label, value: String(x.value) })), [options]);
|
|
9
10
|
const handleChange = (value) => {
|
|
10
11
|
const option = options.find((x) => String(x.value) === value);
|
|
@@ -16,6 +17,9 @@ function SelectControl({ value, onChange, options, id, name, disabled, onBlur, o
|
|
|
16
17
|
}
|
|
17
18
|
};
|
|
18
19
|
const selectedOption = (0, react_1.useMemo)(() => options.find((x) => x.value === value), [options, value]);
|
|
20
|
+
if (skeleton) {
|
|
21
|
+
return (0, jsx_runtime_1.jsx)(SkeletonControl_1.SkeletonControl, {});
|
|
22
|
+
}
|
|
19
23
|
return ((0, jsx_runtime_1.jsx)(react_components_1.Dropdown, { placeholder: placeholder, id: id, name: name, appearance: "filled-darker",
|
|
20
24
|
// data={transformedOptions}
|
|
21
25
|
value: selectedOption?.label ?? '',
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SkeletonControl = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_components_1 = require("@fluentui/react-components");
|
|
6
|
+
const useStyles = (0, react_components_1.makeStyles)({
|
|
7
|
+
skeleton: {
|
|
8
|
+
backgroundColor: 'var(--colorNeutralBackground3)',
|
|
9
|
+
'&:after': {
|
|
10
|
+
backgroundImage: 'linear-gradient(to right, var(--colorNeutralBackground3) 0%, var(--colorNeutralBackground6) 50%, var(--colorNeutralBackground3) 100%)',
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
});
|
|
14
|
+
const SkeletonControl = ({ height = 32, width, }) => {
|
|
15
|
+
const styles = useStyles();
|
|
16
|
+
return ((0, jsx_runtime_1.jsx)("div", { style: { paddingBlock: 2 }, children: (0, jsx_runtime_1.jsx)(react_components_1.SkeletonItem, { style: { height: height - 4, width }, className: styles.skeleton }) }));
|
|
17
|
+
};
|
|
18
|
+
exports.SkeletonControl = SkeletonControl;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { ControlProps } from './types';
|
|
2
2
|
export interface SwitchControlProps extends ControlProps<boolean> {
|
|
3
3
|
}
|
|
4
|
-
export declare function SwitchControl({ value, onChange, id, name, disabled, readOnly, onBlur, onFocus, }: SwitchControlProps): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
export declare function SwitchControl({ value, onChange, id, name, disabled, readOnly, onBlur, onFocus, skeleton, }: SwitchControlProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -3,6 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.SwitchControl = SwitchControl;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_components_1 = require("@fluentui/react-components");
|
|
6
|
-
|
|
6
|
+
const SkeletonControl_1 = require("./SkeletonControl");
|
|
7
|
+
function SwitchControl({ value, onChange, id, name, disabled, readOnly, onBlur, onFocus, skeleton, }) {
|
|
8
|
+
if (skeleton) {
|
|
9
|
+
return (0, jsx_runtime_1.jsx)(SkeletonControl_1.SkeletonControl, { width: 80 });
|
|
10
|
+
}
|
|
7
11
|
return ((0, jsx_runtime_1.jsx)(react_components_1.Switch, { checked: value ?? false, onChange: (e) => onChange?.(e.currentTarget.checked), id: id, name: name, disabled: disabled, readOnly: readOnly, onBlur: onBlur, onFocus: onFocus }));
|
|
8
12
|
}
|
|
@@ -2,4 +2,4 @@ import { ControlProps } from './types';
|
|
|
2
2
|
export interface TelephoneControlProps extends ControlProps<string> {
|
|
3
3
|
autoComplete?: string;
|
|
4
4
|
}
|
|
5
|
-
export declare function TelephoneControl({ value, onChange, id, name, onBlur, onFocus, placeholder, disabled, readOnly, autoComplete, }: Readonly<TelephoneControlProps>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export declare function TelephoneControl({ value, onChange, id, name, onBlur, onFocus, placeholder, disabled, readOnly, autoComplete, skeleton, }: Readonly<TelephoneControlProps>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -7,7 +7,8 @@ const locale_1 = require("@headless-adminapp/app/locale");
|
|
|
7
7
|
const phone_1 = require("@headless-adminapp/app/utils/phone");
|
|
8
8
|
const icons_1 = require("@headless-adminapp/icons");
|
|
9
9
|
const react_1 = require("react");
|
|
10
|
-
|
|
10
|
+
const SkeletonControl_1 = require("./SkeletonControl");
|
|
11
|
+
function TelephoneControl({ value, onChange, id, name, onBlur, onFocus, placeholder, disabled, readOnly, autoComplete, skeleton, }) {
|
|
11
12
|
const [internalValue, setInternalValue] = (0, react_1.useState)('');
|
|
12
13
|
const { region } = (0, locale_1.useLocale)();
|
|
13
14
|
const number = (0, react_1.useMemo)(() => {
|
|
@@ -24,6 +25,9 @@ function TelephoneControl({ value, onChange, id, name, onBlur, onFocus, placehol
|
|
|
24
25
|
setInternalValue(parsedPhoneNumber.formattedInternationalValue);
|
|
25
26
|
onChange?.(parsedPhoneNumber.rawValue);
|
|
26
27
|
};
|
|
28
|
+
if (skeleton) {
|
|
29
|
+
return (0, jsx_runtime_1.jsx)(SkeletonControl_1.SkeletonControl, {});
|
|
30
|
+
}
|
|
27
31
|
return ((0, jsx_runtime_1.jsx)(react_components_1.Input, { type: "tel", placeholder: placeholder, id: id, appearance: "filled-darker", name: name, value: internalValue, onChange: (e) => setInternalValue?.(e.target.value), onBlur: () => {
|
|
28
32
|
handleChange();
|
|
29
33
|
onBlur?.();
|
|
@@ -5,4 +5,4 @@ export interface TextAreaControlProps extends ControlProps<string> {
|
|
|
5
5
|
autoHeight?: boolean;
|
|
6
6
|
maxHeight?: number;
|
|
7
7
|
}
|
|
8
|
-
export declare function TextAreaControl({ value, onChange, id, name, placeholder, onBlur, onFocus, disabled, readOnly, rows, textTransform, autoHeight, maxHeight, }: TextAreaControlProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare function TextAreaControl({ value, onChange, id, name, placeholder, onBlur, onFocus, disabled, readOnly, rows, textTransform, autoHeight, maxHeight, skeleton, }: TextAreaControlProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -4,8 +4,9 @@ exports.TextAreaControl = TextAreaControl;
|
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_components_1 = require("@fluentui/react-components");
|
|
6
6
|
const react_1 = require("react");
|
|
7
|
+
const SkeletonControl_1 = require("./SkeletonControl");
|
|
7
8
|
const DEFAULT_MAX_HEIGHT = 260;
|
|
8
|
-
function TextAreaControl({ value, onChange, id, name, placeholder, onBlur, onFocus, disabled, readOnly, rows = 5, textTransform, autoHeight, maxHeight, }) {
|
|
9
|
+
function TextAreaControl({ value, onChange, id, name, placeholder, onBlur, onFocus, disabled, readOnly, rows = 5, textTransform, autoHeight, maxHeight, skeleton, }) {
|
|
9
10
|
const textAreaRef = (0, react_1.useRef)(null);
|
|
10
11
|
(0, react_1.useEffect)(() => {
|
|
11
12
|
const textarea = textAreaRef.current;
|
|
@@ -35,6 +36,9 @@ function TextAreaControl({ value, onChange, id, name, placeholder, onBlur, onFoc
|
|
|
35
36
|
}
|
|
36
37
|
onChange?.(newValue);
|
|
37
38
|
};
|
|
39
|
+
if (skeleton) {
|
|
40
|
+
return (0, jsx_runtime_1.jsx)(SkeletonControl_1.SkeletonControl, { height: 116 });
|
|
41
|
+
}
|
|
38
42
|
return ((0, jsx_runtime_1.jsx)(react_components_1.Textarea, { ref: textAreaRef, placeholder: placeholder, id: id, appearance: "filled-darker", name: name, value: value ?? '', onChange: handleInput, onBlur: () => onBlur?.(), onFocus: () => onFocus?.(),
|
|
39
43
|
// error={error}
|
|
40
44
|
readOnly: disabled || readOnly, rows: rows, style: {
|
|
@@ -8,4 +8,4 @@ export interface TextControlProps extends ControlProps<string> {
|
|
|
8
8
|
appearance?: InputProps['appearance'];
|
|
9
9
|
maxLength?: number;
|
|
10
10
|
}
|
|
11
|
-
export declare function TextControl({ value, onChange, id, name, onBlur, onFocus, placeholder, disabled, autoComplete, autoFocus, autoCapitalize, autoCorrect, textTransform, readOnly, appearance, maxLength, }: TextControlProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export declare function TextControl({ value, onChange, id, name, onBlur, onFocus, placeholder, disabled, autoComplete, autoFocus, autoCapitalize, autoCorrect, textTransform, readOnly, appearance, maxLength, skeleton, }: TextControlProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -3,12 +3,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.TextControl = TextControl;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_components_1 = require("@fluentui/react-components");
|
|
6
|
+
const SkeletonControl_1 = require("./SkeletonControl");
|
|
6
7
|
function TextControl({ value, onChange, id, name, onBlur, onFocus,
|
|
7
8
|
// error,
|
|
8
9
|
placeholder, disabled, autoComplete, autoFocus, autoCapitalize, autoCorrect, textTransform,
|
|
9
10
|
// borderOnFocusOnly,
|
|
10
|
-
readOnly, appearance = 'filled-darker', maxLength, }) {
|
|
11
|
+
readOnly, appearance = 'filled-darker', maxLength, skeleton, }) {
|
|
11
12
|
const readonly = disabled || readOnly;
|
|
13
|
+
if (skeleton) {
|
|
14
|
+
return (0, jsx_runtime_1.jsx)(SkeletonControl_1.SkeletonControl, {});
|
|
15
|
+
}
|
|
12
16
|
return ((0, jsx_runtime_1.jsx)(react_components_1.Input, { placeholder: placeholder, id: id, name: name, autoFocus: autoFocus, appearance: appearance, value: value || '', onChange: (e) => {
|
|
13
17
|
textTransform === 'uppercase'
|
|
14
18
|
? onChange?.(e.target.value.toUpperCase())
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { ControlProps } from '../types';
|
|
2
2
|
export interface TimeControlProps extends ControlProps<number> {
|
|
3
3
|
}
|
|
4
|
-
export declare function TimeControl({ value, onChange, id, name, onBlur, placeholder, disabled, readOnly, }: Readonly<TimeControlProps>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
export declare function TimeControl({ value, onChange, id, name, onBlur, placeholder, disabled, readOnly, skeleton, }: Readonly<TimeControlProps>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -12,9 +12,10 @@ const icons_1 = require("@headless-adminapp/icons");
|
|
|
12
12
|
const dayjs_1 = __importDefault(require("dayjs"));
|
|
13
13
|
const customParseFormat_1 = __importDefault(require("dayjs/plugin/customParseFormat"));
|
|
14
14
|
const react_1 = require("react");
|
|
15
|
+
const SkeletonControl_1 = require("../SkeletonControl");
|
|
15
16
|
const utils_1 = require("./utils");
|
|
16
17
|
dayjs_1.default.extend(customParseFormat_1.default);
|
|
17
|
-
function TimeControl({ value, onChange, id, name, onBlur, placeholder, disabled, readOnly, }) {
|
|
18
|
+
function TimeControl({ value, onChange, id, name, onBlur, placeholder, disabled, readOnly, skeleton, }) {
|
|
18
19
|
const { timeFormats: { short: timeFormat }, timezone, } = (0, locale_1.useLocale)();
|
|
19
20
|
const [internalTimeValue, setInternalTimeValue] = (0, react_1.useState)(value ? (0, dayjs_1.default)().startOf('day').add(value, 'minutes').format(timeFormat) : '');
|
|
20
21
|
const internalTimeValueRef = (0, react_1.useRef)(internalTimeValue);
|
|
@@ -34,6 +35,9 @@ function TimeControl({ value, onChange, id, name, onBlur, placeholder, disabled,
|
|
|
34
35
|
}
|
|
35
36
|
return (0, dayjs_1.default)().startOf('day').add(value, 'minutes').toDate();
|
|
36
37
|
}, [value]);
|
|
38
|
+
if (skeleton) {
|
|
39
|
+
return (0, jsx_runtime_1.jsx)(SkeletonControl_1.SkeletonControl, {});
|
|
40
|
+
}
|
|
37
41
|
return ((0, jsx_runtime_1.jsx)("div", { style: {
|
|
38
42
|
display: 'flex',
|
|
39
43
|
alignItems: 'center',
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { ControlProps } from './types';
|
|
2
2
|
export interface UrlControlProps extends ControlProps<string> {
|
|
3
3
|
}
|
|
4
|
-
export declare function UrlControl({ value, onChange, id, name, onBlur, onFocus, placeholder, disabled, readOnly, }: UrlControlProps): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
export declare function UrlControl({ value, onChange, id, name, onBlur, onFocus, placeholder, disabled, readOnly, skeleton, }: UrlControlProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -4,7 +4,11 @@ exports.UrlControl = UrlControl;
|
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_components_1 = require("@fluentui/react-components");
|
|
6
6
|
const icons_1 = require("@headless-adminapp/icons");
|
|
7
|
-
|
|
7
|
+
const SkeletonControl_1 = require("./SkeletonControl");
|
|
8
|
+
function UrlControl({ value, onChange, id, name, onBlur, onFocus, placeholder, disabled, readOnly, skeleton, }) {
|
|
9
|
+
if (skeleton) {
|
|
10
|
+
return (0, jsx_runtime_1.jsx)(SkeletonControl_1.SkeletonControl, {});
|
|
11
|
+
}
|
|
8
12
|
return ((0, jsx_runtime_1.jsx)(react_components_1.Input, { type: "url", placeholder: placeholder, id: id, appearance: "filled-darker", name: name, value: value || '', onChange: (e) => onChange?.(e.target.value), onBlur: () => onBlur?.(), onFocus: () => onFocus?.(),
|
|
9
13
|
// invalid={error}
|
|
10
14
|
readOnly: disabled || readOnly, autoComplete: "off", style: {
|
package/form/controls/types.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@headless-adminapp/fluent",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.2",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -52,5 +52,5 @@
|
|
|
52
52
|
"uuid": "11.0.3",
|
|
53
53
|
"yup": "^1.4.0"
|
|
54
54
|
},
|
|
55
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "150c2a6eee123cdb3cb42b1f42f1b4bea8db2756"
|
|
56
56
|
}
|