@geotab/zenith 3.3.0 → 3.4.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -0
- package/dist/advancedGroupsFilter/advancedGroupsFilterFormSection.js +1 -1
- package/dist/advancedGroupsFilter/advancedGroupsFilterSectionTooltip.js +0 -39
- package/dist/alertRaw/components/alertAnimation.js +8 -4
- package/dist/card/card.d.ts +1 -1
- package/dist/card/card.js +1 -3
- package/dist/card/components/status.js +2 -2
- package/dist/chart/barChart/getBarTooltipItems.js +31 -2
- package/dist/chart/barChart.js +2 -1
- package/dist/chart/utils/getYAxisMeta.d.ts +1 -1
- package/dist/chart/utils/getYAxisMeta.js +44 -1
- package/dist/checkbox/checkbox.js +3 -3
- package/dist/dataGrid/emptySearchList/emptySearchList.d.ts +6 -7
- package/dist/dataGrid/emptySearchList/emptySearchList.js +15 -23
- package/dist/dateInputRaw/dateInputRaw.d.ts +1 -1
- package/dist/dateRangeRaw/dateRangeRaw.d.ts +1 -1
- package/dist/dateRangeRaw/utils/dateRangeUtils.d.ts +1 -0
- package/dist/dateRangeRaw/utils/dateRangeUtils.js +39 -1
- package/dist/dropdownRaw/dropdownRaw.d.ts +1 -1
- package/dist/emptyState/emptyState.d.ts +9 -0
- package/dist/emptyState/emptyState.js +14 -0
- package/dist/emptyState/hooks/useIcon.d.ts +2 -0
- package/dist/emptyState/hooks/useIcon.js +17 -0
- package/dist/filtersBar/components/filtersBarPeriodPicker/getRangeOption.d.ts +1 -0
- package/dist/filtersBar/components/filtersBarPeriodPicker/getRangeOption.js +28 -3
- package/dist/formField/components/formFieldAdditionalInfo.d.ts +12 -0
- package/dist/formField/components/formFieldAdditionalInfo.js +10 -0
- package/dist/formField/components/formFieldAssistiveError.d.ts +10 -0
- package/dist/formField/components/formFieldAssistiveError.js +12 -0
- package/dist/formField/components/formFieldCounter.d.ts +6 -0
- package/dist/formField/components/formFieldCounter.js +7 -0
- package/dist/formField/components/formFieldLoading.d.ts +12 -0
- package/dist/formField/components/formFieldLoading.js +16 -0
- package/dist/formField/components/formFieldWithLabel.d.ts +8 -11
- package/dist/formField/components/formFieldWithLabel.js +21 -3
- package/dist/formField/components/formFieldWithoutLabel.d.ts +8 -9
- package/dist/formField/components/formFieldWithoutLabel.js +6 -1
- package/dist/formField/components/isOldFormFieldComponent.d.ts +2 -0
- package/dist/formField/components/isOldFormFieldComponent.js +12 -0
- package/dist/formField/components/trailingComponent.d.ts +2 -1
- package/dist/formField/components/trailingComponent.js +7 -1
- package/dist/formField/formField.d.ts +17 -35
- package/dist/formField/formField.js +4 -71
- package/dist/formField/hooks/useContainer.d.ts +2 -0
- package/dist/formField/hooks/useContainer.js +47 -0
- package/dist/formField/hooks/useError.d.ts +1 -1
- package/dist/formField/hooks/useFormFieldClasses.d.ts +2 -0
- package/dist/formField/hooks/useFormFieldClasses.js +30 -0
- package/dist/formField/hooks/useFormFieldProps.d.ts +17 -0
- package/dist/formField/hooks/useFormFieldProps.js +37 -0
- package/dist/formField/hooks/useTrailing.d.ts +1 -1
- package/dist/formField/hooks/useTrailing.js +1 -1
- package/dist/formField/hooks/useWidth.d.ts +1 -1
- package/dist/formField/types.d.ts +35 -0
- package/dist/formField/types.js +2 -0
- package/dist/formGroup/components/formGroupList.d.ts +1 -1
- package/dist/formGroup/components/formGroupToggle.d.ts +1 -1
- package/dist/formGroup/formGroup.d.ts +1 -1
- package/dist/formGroup/hooks/useLabelAlign.d.ts +1 -1
- package/dist/formGroup/types.d.ts +1 -1
- package/dist/formGroup/utils/applyCustomControlClasses.d.ts +1 -1
- package/dist/formGroup/utils/applyCustomLabelClasses.d.ts +1 -1
- package/dist/formGroup/utils/getControlClasses/getControlClasses.d.ts +1 -1
- package/dist/formGroup/utils/getControlClasses/getOneLabelOneControlClasses.d.ts +1 -1
- package/dist/formGroup/utils/getControlClasses/getOneLabelTwoControlsClasses.d.ts +1 -1
- package/dist/formGroup/utils/getControlClasses/getTwoLabelsOneControlClasses.d.ts +1 -1
- package/dist/formGroup/utils/getControlClasses/getTwoLabelsTwoControlsClasses.d.ts +1 -1
- package/dist/formGroup/utils/getLabelClasses/getLabelClasses.d.ts +1 -1
- package/dist/formGroup/utils/getLabelClasses/getOneLabelOneControlClasses.d.ts +1 -1
- package/dist/formGroup/utils/getLabelClasses/getOneLabelTwoControlsClasses.d.ts +1 -1
- package/dist/formGroup/utils/getLabelClasses/getTwoLabelsOneControlClasses.d.ts +1 -1
- package/dist/formGroup/utils/getLabelClasses/getTwoLabelsTwoControlsClasses.d.ts +1 -1
- package/dist/formGroup/utils/getListClasses.d.ts +1 -1
- package/dist/formGroup/utils/getToggleClasses.d.ts +1 -1
- package/dist/formGroup/utils/initializeState.d.ts +1 -1
- package/dist/formGroup/utils/isTopAlign.d.ts +1 -1
- package/dist/formLayout/types.d.ts +1 -1
- package/dist/formSection/types.d.ts +1 -1
- package/dist/formSection/utils/formSectionProvider.d.ts +1 -1
- package/dist/groupButtonRaw/groupButtonRaw.d.ts +1 -1
- package/dist/groupsFilterRaw/groupsFilterRaw.d.ts +1 -1
- package/dist/groupsFilterRaw/groupsHelper.js +2 -2
- package/dist/headerTitle/headerTitle.js +1 -1
- package/dist/images/imageAdjustFilter.d.ts +4 -0
- package/dist/images/imageAdjustFilter.js +16 -0
- package/dist/images/imageNoMatchingAssets.d.ts +4 -0
- package/dist/images/imageNoMatchingAssets.js +16 -0
- package/dist/index.css +619 -524
- package/dist/index.d.ts +6 -2
- package/dist/index.js +23 -16
- package/dist/inputAdornments/inputAdornments.d.ts +2 -1
- package/dist/inputAdornments/inputAdornments.js +2 -2
- package/dist/layout/layout.js +11 -7
- package/dist/list/itemData/itemData.d.ts +1 -0
- package/dist/list/itemData/itemDataInternal.d.ts +2 -1
- package/dist/list/itemData/itemDataInternal.js +4 -2
- package/dist/list/itemData/itemDataWaiting.d.ts +2 -1
- package/dist/list/itemData/itemDataWaiting.js +4 -1
- package/dist/list/list.d.ts +13 -4
- package/dist/list/list.js +29 -12
- package/dist/list/utils/getLoadingItems.d.ts +1 -1
- package/dist/list/utils/getLoadingItems.js +4 -4
- package/dist/modal/modal.js +7 -0
- package/dist/pillExpandable/pillExpandable.d.ts +1 -0
- package/dist/pillExpandable/pillExpandable.js +74 -33
- package/dist/radioGroupRaw/radioGroupRaw.d.ts +1 -1
- package/dist/rangeRaw/rangeRaw.d.ts +1 -1
- package/dist/summary/summary.js +0 -1
- package/dist/summaryTile/summaryTile.js +2 -2
- package/dist/table/children/tableEmpty.d.ts +1 -1
- package/dist/table/children/useTableChildren.js +1 -1
- package/dist/timePickerRaw/timePickerRaw.d.ts +1 -1
- package/dist/tooltip/tooltip.d.ts +15 -4
- package/dist/tooltip/tooltip.js +421 -158
- package/dist/utils/localization/translations/cs.json +2 -1
- package/dist/utils/localization/translations/da-DK.json +2 -1
- package/dist/utils/localization/translations/de.json +2 -1
- package/dist/utils/localization/translations/en.json +2 -1
- package/dist/utils/localization/translations/es.json +3 -2
- package/dist/utils/localization/translations/fi-FI.json +2 -1
- package/dist/utils/localization/translations/fr-FR.json +2 -1
- package/dist/utils/localization/translations/fr.json +3 -2
- package/dist/utils/localization/translations/hu-HU.json +2 -1
- package/dist/utils/localization/translations/id.json +2 -1
- package/dist/utils/localization/translations/it.json +2 -1
- package/dist/utils/localization/translations/ja.json +2 -1
- package/dist/utils/localization/translations/ko-KR.json +2 -1
- package/dist/utils/localization/translations/ms.json +2 -1
- package/dist/utils/localization/translations/nb-NO.json +2 -1
- package/dist/utils/localization/translations/nl.json +2 -1
- package/dist/utils/localization/translations/pl.json +2 -1
- package/dist/utils/localization/translations/pt-BR.json +2 -1
- package/dist/utils/localization/translations/sk-SK.json +2 -1
- package/dist/utils/localization/translations/sv.json +2 -1
- package/dist/utils/localization/translations/th.json +2 -1
- package/dist/utils/localization/translations/tr.json +2 -1
- package/dist/utils/localization/translations/zh-Hans.json +2 -1
- package/dist/utils/localization/translations/zh-TW.json +2 -1
- package/dist/utils/positioningUtils/calculatePosition.d.ts +1 -1
- package/dist/utils/positioningUtils/calculatePosition.js +11 -1
- package/esm/advancedGroupsFilter/advancedGroupsFilterFormSection.js +1 -1
- package/esm/advancedGroupsFilter/advancedGroupsFilterSectionTooltip.js +0 -39
- package/esm/alertRaw/components/alertAnimation.js +8 -4
- package/esm/card/card.d.ts +1 -1
- package/esm/card/card.js +1 -3
- package/esm/card/components/status.js +2 -2
- package/esm/chart/barChart/getBarTooltipItems.js +31 -2
- package/esm/chart/barChart.js +2 -1
- package/esm/chart/utils/getYAxisMeta.d.ts +1 -1
- package/esm/chart/utils/getYAxisMeta.js +44 -1
- package/esm/checkbox/checkbox.js +3 -3
- package/esm/dataGrid/emptySearchList/emptySearchList.d.ts +6 -7
- package/esm/dataGrid/emptySearchList/emptySearchList.js +16 -24
- package/esm/dateInputRaw/dateInputRaw.d.ts +1 -1
- package/esm/dateRangeRaw/dateRangeRaw.d.ts +1 -1
- package/esm/dateRangeRaw/utils/dateRangeUtils.d.ts +1 -0
- package/esm/dateRangeRaw/utils/dateRangeUtils.js +37 -0
- package/esm/dropdownRaw/dropdownRaw.d.ts +1 -1
- package/esm/emptyState/emptyState.d.ts +9 -0
- package/esm/emptyState/emptyState.js +10 -0
- package/esm/emptyState/hooks/useIcon.d.ts +2 -0
- package/esm/emptyState/hooks/useIcon.js +10 -0
- package/esm/filtersBar/components/filtersBarPeriodPicker/getRangeOption.d.ts +1 -0
- package/esm/filtersBar/components/filtersBarPeriodPicker/getRangeOption.js +29 -4
- package/esm/formField/components/formFieldAdditionalInfo.d.ts +12 -0
- package/esm/formField/components/formFieldAdditionalInfo.js +6 -0
- package/esm/formField/components/formFieldAssistiveError.d.ts +10 -0
- package/esm/formField/components/formFieldAssistiveError.js +8 -0
- package/esm/formField/components/formFieldCounter.d.ts +6 -0
- package/esm/formField/components/formFieldCounter.js +3 -0
- package/esm/formField/components/formFieldLoading.d.ts +12 -0
- package/esm/formField/components/formFieldLoading.js +12 -0
- package/esm/formField/components/formFieldWithLabel.d.ts +8 -11
- package/esm/formField/components/formFieldWithLabel.js +21 -3
- package/esm/formField/components/formFieldWithoutLabel.d.ts +8 -9
- package/esm/formField/components/formFieldWithoutLabel.js +6 -1
- package/esm/formField/components/isOldFormFieldComponent.d.ts +2 -0
- package/esm/formField/components/isOldFormFieldComponent.js +8 -0
- package/esm/formField/components/trailingComponent.d.ts +2 -1
- package/esm/formField/components/trailingComponent.js +7 -1
- package/esm/formField/formField.d.ts +17 -35
- package/esm/formField/formField.js +5 -72
- package/esm/formField/hooks/useContainer.d.ts +2 -0
- package/esm/formField/hooks/useContainer.js +43 -0
- package/esm/formField/hooks/useError.d.ts +1 -1
- package/esm/formField/hooks/useFormFieldClasses.d.ts +2 -0
- package/esm/formField/hooks/useFormFieldClasses.js +26 -0
- package/esm/formField/hooks/useFormFieldProps.d.ts +17 -0
- package/esm/formField/hooks/useFormFieldProps.js +33 -0
- package/esm/formField/hooks/useTrailing.d.ts +1 -1
- package/esm/formField/hooks/useTrailing.js +1 -1
- package/esm/formField/hooks/useWidth.d.ts +1 -1
- package/esm/formField/types.d.ts +35 -0
- package/esm/formField/types.js +1 -0
- package/esm/formGroup/components/formGroupList.d.ts +1 -1
- package/esm/formGroup/components/formGroupToggle.d.ts +1 -1
- package/esm/formGroup/formGroup.d.ts +1 -1
- package/esm/formGroup/hooks/useLabelAlign.d.ts +1 -1
- package/esm/formGroup/types.d.ts +1 -1
- package/esm/formGroup/utils/applyCustomControlClasses.d.ts +1 -1
- package/esm/formGroup/utils/applyCustomLabelClasses.d.ts +1 -1
- package/esm/formGroup/utils/getControlClasses/getControlClasses.d.ts +1 -1
- package/esm/formGroup/utils/getControlClasses/getOneLabelOneControlClasses.d.ts +1 -1
- package/esm/formGroup/utils/getControlClasses/getOneLabelTwoControlsClasses.d.ts +1 -1
- package/esm/formGroup/utils/getControlClasses/getTwoLabelsOneControlClasses.d.ts +1 -1
- package/esm/formGroup/utils/getControlClasses/getTwoLabelsTwoControlsClasses.d.ts +1 -1
- package/esm/formGroup/utils/getLabelClasses/getLabelClasses.d.ts +1 -1
- package/esm/formGroup/utils/getLabelClasses/getOneLabelOneControlClasses.d.ts +1 -1
- package/esm/formGroup/utils/getLabelClasses/getOneLabelTwoControlsClasses.d.ts +1 -1
- package/esm/formGroup/utils/getLabelClasses/getTwoLabelsOneControlClasses.d.ts +1 -1
- package/esm/formGroup/utils/getLabelClasses/getTwoLabelsTwoControlsClasses.d.ts +1 -1
- package/esm/formGroup/utils/getListClasses.d.ts +1 -1
- package/esm/formGroup/utils/getToggleClasses.d.ts +1 -1
- package/esm/formGroup/utils/initializeState.d.ts +1 -1
- package/esm/formGroup/utils/isTopAlign.d.ts +1 -1
- package/esm/formLayout/types.d.ts +1 -1
- package/esm/formSection/types.d.ts +1 -1
- package/esm/formSection/utils/formSectionProvider.d.ts +1 -1
- package/esm/groupButtonRaw/groupButtonRaw.d.ts +1 -1
- package/esm/groupsFilterRaw/groupsFilterRaw.d.ts +1 -1
- package/esm/groupsFilterRaw/groupsHelper.js +2 -2
- package/esm/headerTitle/headerTitle.js +1 -1
- package/esm/images/imageAdjustFilter.d.ts +4 -0
- package/esm/images/imageAdjustFilter.js +12 -0
- package/esm/images/imageNoMatchingAssets.d.ts +4 -0
- package/esm/images/imageNoMatchingAssets.js +12 -0
- package/esm/index.d.ts +6 -2
- package/esm/index.js +4 -1
- package/esm/inputAdornments/inputAdornments.d.ts +2 -1
- package/esm/inputAdornments/inputAdornments.js +2 -2
- package/esm/layout/layout.js +11 -7
- package/esm/list/itemData/itemData.d.ts +1 -0
- package/esm/list/itemData/itemDataInternal.d.ts +2 -1
- package/esm/list/itemData/itemDataInternal.js +4 -2
- package/esm/list/itemData/itemDataWaiting.d.ts +2 -1
- package/esm/list/itemData/itemDataWaiting.js +4 -1
- package/esm/list/list.d.ts +13 -4
- package/esm/list/list.js +29 -12
- package/esm/list/utils/getLoadingItems.d.ts +1 -1
- package/esm/list/utils/getLoadingItems.js +4 -4
- package/esm/modal/modal.js +7 -0
- package/esm/pillExpandable/pillExpandable.d.ts +1 -0
- package/esm/pillExpandable/pillExpandable.js +74 -33
- package/esm/radioGroupRaw/radioGroupRaw.d.ts +1 -1
- package/esm/rangeRaw/rangeRaw.d.ts +1 -1
- package/esm/summary/summary.js +0 -1
- package/esm/summaryTile/summaryTile.js +2 -2
- package/esm/table/children/tableEmpty.d.ts +1 -1
- package/esm/table/children/useTableChildren.js +1 -1
- package/esm/timePickerRaw/timePickerRaw.d.ts +1 -1
- package/esm/tooltip/tooltip.d.ts +15 -4
- package/esm/tooltip/tooltip.js +388 -138
- package/esm/utils/localization/translations/cs.json +2 -1
- package/esm/utils/localization/translations/da-DK.json +2 -1
- package/esm/utils/localization/translations/de.json +2 -1
- package/esm/utils/localization/translations/en.json +2 -1
- package/esm/utils/localization/translations/es.json +3 -2
- package/esm/utils/localization/translations/fi-FI.json +2 -1
- package/esm/utils/localization/translations/fr-FR.json +2 -1
- package/esm/utils/localization/translations/fr.json +3 -2
- package/esm/utils/localization/translations/hu-HU.json +2 -1
- package/esm/utils/localization/translations/id.json +2 -1
- package/esm/utils/localization/translations/it.json +2 -1
- package/esm/utils/localization/translations/ja.json +2 -1
- package/esm/utils/localization/translations/ko-KR.json +2 -1
- package/esm/utils/localization/translations/ms.json +2 -1
- package/esm/utils/localization/translations/nb-NO.json +2 -1
- package/esm/utils/localization/translations/nl.json +2 -1
- package/esm/utils/localization/translations/pl.json +2 -1
- package/esm/utils/localization/translations/pt-BR.json +2 -1
- package/esm/utils/localization/translations/sk-SK.json +2 -1
- package/esm/utils/localization/translations/sv.json +2 -1
- package/esm/utils/localization/translations/th.json +2 -1
- package/esm/utils/localization/translations/tr.json +2 -1
- package/esm/utils/localization/translations/zh-Hans.json +2 -1
- package/esm/utils/localization/translations/zh-TW.json +2 -1
- package/esm/utils/positioningUtils/calculatePosition.d.ts +1 -1
- package/esm/utils/positioningUtils/calculatePosition.js +11 -1
- package/package.json +1 -1
|
@@ -9,93 +9,26 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
9
9
|
}
|
|
10
10
|
return t;
|
|
11
11
|
};
|
|
12
|
-
import { jsx as _jsx
|
|
13
|
-
import { useId, useMemo, useContext } from "react";
|
|
14
|
-
import { classNames } from "../commonHelpers/classNames/classNames";
|
|
15
|
-
import { useDriveClassName } from "../utils/theme/useDriveClassName";
|
|
16
|
-
import { FormFieldError } from "../formFieldError/formFieldError";
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
17
13
|
import { FormFieldBanner } from "./components/formFieldBanner";
|
|
18
|
-
import { useMobile } from "../commonHelpers/hooks/useMobile";
|
|
19
|
-
import { useBanner } from "./hooks/useBanner";
|
|
20
|
-
import { useAssistive } from "./hooks/useAssistive";
|
|
21
|
-
import { useTrailing } from "./hooks/useTrailing";
|
|
22
|
-
import { useError } from "./hooks/useError";
|
|
23
14
|
import { rangeRawLabelCheck } from "./utils/rangeRawLabelCheck";
|
|
24
|
-
import { Skeleton } from "../skeleton/skeleton";
|
|
25
|
-
import { TextareaRaw } from "../textareaRaw/textareaRaw";
|
|
26
15
|
import { useSkeleton } from "./hooks/useSkeleton";
|
|
27
|
-
import { useWidth } from "./hooks/useWidth";
|
|
28
|
-
import { useDisabled } from "./hooks/useDisabled";
|
|
29
16
|
import { useLoading } from "./hooks/useLoading";
|
|
30
|
-
import { useReadonly } from "./hooks/useReadonly";
|
|
31
17
|
import { FormFieldWithLabel } from "./components/formFieldWithLabel";
|
|
32
18
|
import { FormFieldWithoutLabel } from "./components/formFieldWithoutLabel";
|
|
33
|
-
import {
|
|
34
|
-
import { FormSectionContext } from "../formSection/utils/formSectionProvider";
|
|
35
|
-
const OLD_FORM_FIELD_COMPONENTS = [
|
|
36
|
-
"SearchInputRaw",
|
|
37
|
-
"SelectRaw",
|
|
38
|
-
"StepperRaw",
|
|
39
|
-
"TextAreaInput",
|
|
40
|
-
"TextInputRaw"
|
|
41
|
-
];
|
|
42
|
-
const isOldFormFieldComponent = (component) =>
|
|
43
|
-
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
44
|
-
OLD_FORM_FIELD_COMPONENTS.includes((component === null || component === void 0 ? void 0 : component.displayName) || "") || OLD_FORM_FIELD_COMPONENTS.includes((component === null || component === void 0 ? void 0 : component.name) || "");
|
|
19
|
+
import { FormFieldLoading } from "./components/formFieldLoading";
|
|
45
20
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
46
21
|
export const FormField = function FormFieldInner(WrappedComponent) {
|
|
47
|
-
// eslint-disable-next-line complexity
|
|
48
22
|
const InnerFormField = (props) => {
|
|
49
|
-
const isMobile = useMobile();
|
|
50
|
-
const ref = props.ref;
|
|
51
|
-
const { isFormSection } = useContext(FormSectionContext);
|
|
52
|
-
const { id: assistiveId, assistive } = useAssistive(props);
|
|
53
|
-
const { id: trailingId, trailing } = useTrailing(props);
|
|
54
|
-
const { id: errorId, error, errorBanner } = useError(props);
|
|
55
|
-
const { id: bannerId, banner: bannerComp } = useBanner(props);
|
|
56
|
-
const disabledProps = useDisabled(props);
|
|
57
|
-
const _a = useWidth(props), { hasCustomWidth } = _a, widthObj = __rest(_a, ["hasCustomWidth"]);
|
|
58
23
|
const skeletonProps = __rest(useSkeleton(props), []);
|
|
59
24
|
const isLoading = useLoading(props, WrappedComponent.displayName);
|
|
60
|
-
const isReadonly = useReadonly(props);
|
|
61
|
-
// TODO: add tests
|
|
62
|
-
const banner = errorBanner || bannerComp;
|
|
63
|
-
const isInputContainerHidden = isReadonly && props.isError;
|
|
64
|
-
const { className, inputClassName, counter } = props, rest = __rest(props, ["className", "inputClassName", "counter"]);
|
|
65
|
-
const driveTextClass = useDriveClassName("zen-form-field__text");
|
|
66
|
-
// TODO: Banner? Only it or assistive text?
|
|
67
|
-
const showAdditionalInfo = (error || assistive || counter) && !isReadonly;
|
|
68
|
-
const componentClassName = classNames(["zen-form-field__input", inputClassName || ""]);
|
|
69
|
-
const ariaDescribedBy = `${assistiveId} ${trailingId} ${errorId} ${bannerId}`.trim();
|
|
70
|
-
const localId = useId();
|
|
71
|
-
const id = props.id || localId;
|
|
72
|
-
const container = useMemo(() => _jsxs(_Fragment, { children: [_jsxs("div", { className: classNames(["zen-form-field__input-container", isReadonly ? "zen-form-field__input-container--review" : "", isInputContainerHidden ? "zen-form-field__input-container--hidden" : "", trailing ? "zen-form-field__input-container--with-trailing" : ""]), children: [_jsxs("div", { children: [_jsx(WrappedComponent, Object.assign({}, rest, disabledProps, { isReadOnly: isReadonly, id: id, className: componentClassName, ref: ref, isLoadingError: props.isError, isError: !!error, "aria-describedby": ariaDescribedBy })), showAdditionalInfo ?
|
|
73
|
-
_jsxs("div", { className: "zen-form-field__secondary", children: [_jsx("div", { id: assistiveId || errorId, className: classNames([
|
|
74
|
-
"zen-form-field__text",
|
|
75
|
-
driveTextClass || "",
|
|
76
|
-
error ? "zen-form-field__text--error" : ""
|
|
77
|
-
]), children: error ? _jsx(FormFieldError, { error: error }) : assistive }), counter
|
|
78
|
-
? _jsx("div", { className: classNames(["zen-form-field__length"]), children: counter })
|
|
79
|
-
: ""] })
|
|
80
|
-
: null] }), !hasCustomWidth && trailing && _jsx(TrailingComponent, { id: trailingId, value: trailing, hasAdditionalInfo: !!showAdditionalInfo })] }), banner] }), [isInputContainerHidden, trailing, rest, disabledProps, isReadonly, id, componentClassName, ref, props.isError, error, ariaDescribedBy, hasCustomWidth, trailingId, showAdditionalInfo, assistiveId, errorId, driveTextClass, assistive, counter, banner]);
|
|
81
|
-
const classes = classNames([
|
|
82
|
-
"zen-form-field",
|
|
83
|
-
isMobile ? "zen-form-field--mobile" : "",
|
|
84
|
-
banner ? "zen-form-field--with-banner" : "",
|
|
85
|
-
!props.label ? "" : props.labelAlign ? `zen-form-field--label-${props.labelAlign}` : "zen-form-field--label-left",
|
|
86
|
-
!isOldFormFieldComponent(WrappedComponent) ? "zen-form-field--new-component" : "",
|
|
87
|
-
isFormSection ? "zen-form-field--form-item" : "",
|
|
88
|
-
className || ""
|
|
89
|
-
]);
|
|
90
25
|
if (isLoading) {
|
|
91
|
-
|
|
92
|
-
return _jsx(Skeleton, Object.assign({ className: classes, height: height }, skeletonProps));
|
|
26
|
+
return _jsx(FormFieldLoading, { props: props, wrapperComponent: WrappedComponent, skeletonProps: skeletonProps });
|
|
93
27
|
}
|
|
94
|
-
// TODO: refactor?
|
|
95
28
|
if (props.label && rangeRawLabelCheck(WrappedComponent, props)) {
|
|
96
|
-
return _jsx(FormFieldWithLabel, {
|
|
29
|
+
return _jsx(FormFieldWithLabel, { props: props, wrapperComponent: WrappedComponent });
|
|
97
30
|
}
|
|
98
|
-
return _jsx(FormFieldWithoutLabel, {
|
|
31
|
+
return _jsx(FormFieldWithoutLabel, { props: props, wrapperComponent: WrappedComponent });
|
|
99
32
|
};
|
|
100
33
|
InnerFormField.displayName = "InnerFormField";
|
|
101
34
|
return InnerFormField;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
13
|
+
import { useMemo } from "react";
|
|
14
|
+
import { classNames } from "../../commonHelpers/classNames/classNames";
|
|
15
|
+
import { useDriveClassName } from "../../utils/theme/useDriveClassName";
|
|
16
|
+
import { FormFieldAdditionalInfo } from "../components/formFieldAdditionalInfo";
|
|
17
|
+
import { TrailingComponent } from "../components/trailingComponent";
|
|
18
|
+
import { useAssistive } from "./useAssistive";
|
|
19
|
+
import { useBanner } from "./useBanner";
|
|
20
|
+
import { useDisabled } from "./useDisabled";
|
|
21
|
+
import { useError } from "./useError";
|
|
22
|
+
import { useReadonly } from "./useReadonly";
|
|
23
|
+
import { useWidth } from "./useWidth";
|
|
24
|
+
import { useFormFieldProps } from "./useFormFieldProps";
|
|
25
|
+
// eslint-disable-next-line
|
|
26
|
+
export const useContainer = (props, wrapperComponent) => {
|
|
27
|
+
const { id, wrapperComponent: WrappedComponent, trailing, trailingId, showAdditionalInfo } = useFormFieldProps(props, wrapperComponent);
|
|
28
|
+
const { className, inputClassName, counter } = props, rest = __rest(props, ["className", "inputClassName", "counter"]);
|
|
29
|
+
const { id: errorId, error, errorBanner } = useError(props);
|
|
30
|
+
const { id: bannerId, banner: bannerComp } = useBanner(props);
|
|
31
|
+
const { id: assistiveId, assistive } = useAssistive(props);
|
|
32
|
+
const disabledProps = useDisabled(props);
|
|
33
|
+
const componentClassName = classNames(["zen-form-field__input", inputClassName || ""]);
|
|
34
|
+
const ariaDescribedBy = `${assistiveId} ${trailingId} ${errorId} ${bannerId}`.trim();
|
|
35
|
+
const isReadonly = useReadonly(props);
|
|
36
|
+
const { hasCustomWidth } = useWidth(props);
|
|
37
|
+
const driveTextClass = useDriveClassName("zen-form-field__text");
|
|
38
|
+
const isInputContainerHidden = isReadonly && props.isError;
|
|
39
|
+
const ref = props.ref;
|
|
40
|
+
const banner = errorBanner || bannerComp;
|
|
41
|
+
const container = useMemo(() => _jsxs(_Fragment, { children: [_jsxs("div", { className: classNames(["zen-form-field__input-container", isReadonly ? "zen-form-field__input-container--review" : "", isInputContainerHidden ? "zen-form-field__input-container--hidden" : "", trailing ? "zen-form-field__input-container--with-trailing" : ""]), children: [_jsxs("div", { children: [_jsx(WrappedComponent, Object.assign({}, rest, disabledProps, { isReadOnly: isReadonly, id: id, className: componentClassName, ref: ref, isLoadingError: props.isError, isError: !!error, "aria-describedby": ariaDescribedBy })), _jsx(FormFieldAdditionalInfo, { assistiveId: assistiveId, errorId: errorId, driveTextClass: driveTextClass, error: error, assistive: assistive, counter: counter, showAdditionalInfo: showAdditionalInfo })] }), _jsx(TrailingComponent, { hasCustomWidth: hasCustomWidth, id: trailingId, value: trailing, hasAdditionalInfo: !!showAdditionalInfo })] }), banner] }), [isReadonly, isInputContainerHidden, trailing, WrappedComponent, rest, disabledProps, id, componentClassName, ref, props.isError, error, ariaDescribedBy, assistiveId, errorId, driveTextClass, assistive, counter, showAdditionalInfo, hasCustomWidth, trailingId, banner]);
|
|
42
|
+
return container;
|
|
43
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ReactElement } from "react";
|
|
2
2
|
import { IReactFormItemController } from "../../commonHelpers/zenComponent";
|
|
3
|
-
import { IFormFieldComponent, TFormField } from "../
|
|
3
|
+
import { IFormFieldComponent, TFormField } from "../types";
|
|
4
4
|
import { Exclusive } from "../../commonHelpers/types/exclusive";
|
|
5
5
|
import { IFormFieldBannerProps } from "../components/formFieldBanner";
|
|
6
6
|
export type TErrorType = "text" | "banner";
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { useContext } from "react";
|
|
2
|
+
import { classNames } from "../../commonHelpers/classNames/classNames";
|
|
3
|
+
import { useMobile } from "../../commonHelpers/hooks/useMobile";
|
|
4
|
+
import { FormSectionContext } from "../../formSection/utils/formSectionProvider";
|
|
5
|
+
import { isOldFormFieldComponent } from "../components/isOldFormFieldComponent";
|
|
6
|
+
import { useBanner } from "./useBanner";
|
|
7
|
+
import { useError } from "./useError";
|
|
8
|
+
import { rangeRawLabelCheck } from "../utils/rangeRawLabelCheck";
|
|
9
|
+
// eslint-disable-next-line @typescript-eslint/comma-dangle
|
|
10
|
+
export const useFormFieldClasses = (props, component) => {
|
|
11
|
+
const isMobile = useMobile();
|
|
12
|
+
const { isFormSection } = useContext(FormSectionContext);
|
|
13
|
+
const { banner: bannerComp } = useBanner(props);
|
|
14
|
+
const { errorBanner } = useError(props);
|
|
15
|
+
const banner = errorBanner || bannerComp;
|
|
16
|
+
const classes = classNames([
|
|
17
|
+
"zen-form-field",
|
|
18
|
+
isMobile ? "zen-form-field--mobile" : "",
|
|
19
|
+
banner ? "zen-form-field--with-banner" : "",
|
|
20
|
+
(!props.label || !rangeRawLabelCheck(component, props)) ? "" : props.labelAlign ? `zen-form-field--label-${props.labelAlign}` : "zen-form-field--label-left",
|
|
21
|
+
!isOldFormFieldComponent(component) ? "zen-form-field--new-component" : "",
|
|
22
|
+
isFormSection ? "zen-form-field--form-item" : "",
|
|
23
|
+
props.className || ""
|
|
24
|
+
]);
|
|
25
|
+
return classes;
|
|
26
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { FC } from "react";
|
|
2
|
+
import { TFormFieldComponentProps } from "../formField";
|
|
3
|
+
export declare const useFormFieldProps: <T>(props: TFormFieldComponentProps<T>, wrapperComponent: FC<T>) => {
|
|
4
|
+
id: string;
|
|
5
|
+
wrapperComponent: FC<T>;
|
|
6
|
+
props: TFormFieldComponentProps<T>;
|
|
7
|
+
hasCustomWidth: boolean;
|
|
8
|
+
widthObj: {
|
|
9
|
+
width: string | number;
|
|
10
|
+
} | {
|
|
11
|
+
width?: undefined;
|
|
12
|
+
};
|
|
13
|
+
trailingId: string;
|
|
14
|
+
trailing: string | undefined;
|
|
15
|
+
showAdditionalInfo: boolean;
|
|
16
|
+
classes: string;
|
|
17
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import { useId } from "react";
|
|
13
|
+
import { useAssistive } from "./useAssistive";
|
|
14
|
+
import { useError } from "./useError";
|
|
15
|
+
import { useFormFieldClasses } from "./useFormFieldClasses";
|
|
16
|
+
import { useReadonly } from "./useReadonly";
|
|
17
|
+
import { useTrailing } from "./useTrailing";
|
|
18
|
+
import { useWidth } from "./useWidth";
|
|
19
|
+
// eslint-disable-next-line @typescript-eslint/comma-dangle
|
|
20
|
+
export const useFormFieldProps = (props, wrapperComponent) => {
|
|
21
|
+
const localId = useId();
|
|
22
|
+
const id = props.id || localId;
|
|
23
|
+
const _a = useWidth(props), { hasCustomWidth } = _a, widthObj = __rest(_a, ["hasCustomWidth"]);
|
|
24
|
+
const { id: trailingId, trailing } = useTrailing(props);
|
|
25
|
+
const { error } = useError(props);
|
|
26
|
+
const { assistive } = useAssistive(props);
|
|
27
|
+
const isReadonly = useReadonly(props);
|
|
28
|
+
const showAdditionalInfo = !!((error || assistive || props.counter) && !isReadonly);
|
|
29
|
+
const classes = useFormFieldClasses(props, wrapperComponent);
|
|
30
|
+
return {
|
|
31
|
+
id, wrapperComponent, props, hasCustomWidth, widthObj, trailingId, trailing, showAdditionalInfo, classes
|
|
32
|
+
};
|
|
33
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { PropsWithChildren, Ref } from "react";
|
|
2
|
+
import { ILoadingBase } from "../commonHelpers/loading";
|
|
3
|
+
import { Exclusive } from "../commonHelpers/types/exclusive";
|
|
4
|
+
export type TLabelAlign = "left" | "top";
|
|
5
|
+
interface IFormFieldBase extends PropsWithChildren {
|
|
6
|
+
className?: string;
|
|
7
|
+
inputClassName?: string;
|
|
8
|
+
error?: string;
|
|
9
|
+
assistive?: string;
|
|
10
|
+
counter?: string;
|
|
11
|
+
trailing?: string;
|
|
12
|
+
isReadOnly?: boolean;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
width?: string | number;
|
|
15
|
+
}
|
|
16
|
+
export interface IFormFieldWithLabel extends IFormFieldBase, ILoadingBase {
|
|
17
|
+
label?: string;
|
|
18
|
+
labelAlign?: TLabelAlign;
|
|
19
|
+
tooltip?: React.ReactNode;
|
|
20
|
+
labelClassesName?: string;
|
|
21
|
+
controlClassesName?: string;
|
|
22
|
+
readOnlyValue?: string | React.ReactNode | ((content: React.ReactNode) => React.ReactNode);
|
|
23
|
+
}
|
|
24
|
+
export interface IFormField extends IFormFieldBase {
|
|
25
|
+
}
|
|
26
|
+
export type TFormField = Exclusive<IFormFieldWithLabel, IFormField>;
|
|
27
|
+
export interface IFormFieldComponent {
|
|
28
|
+
isError?: boolean;
|
|
29
|
+
isReadOnly?: boolean;
|
|
30
|
+
children?: React.ReactNode;
|
|
31
|
+
isLoadingError?: boolean;
|
|
32
|
+
bannerLabel?: string;
|
|
33
|
+
ref?: Ref<HTMLElement | null>;
|
|
34
|
+
}
|
|
35
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FC, PropsWithChildren } from "react";
|
|
2
|
-
import { IFormFieldWithLabel } from "../../formField/
|
|
2
|
+
import { IFormFieldWithLabel } from "../../formField/types";
|
|
3
3
|
export interface IFormGroupList extends PropsWithChildren, Required<Pick<IFormFieldWithLabel, "label">>, Pick<IFormFieldWithLabel, "tooltip"> {
|
|
4
4
|
}
|
|
5
5
|
export declare const FormGroupList: FC<IFormGroupList>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FC, PropsWithChildren } from "react";
|
|
2
2
|
import { IReactFormItemController } from "../../commonHelpers/zenComponent";
|
|
3
|
-
import { IFormFieldWithLabel } from "../../formField/
|
|
3
|
+
import { IFormFieldWithLabel } from "../../formField/types";
|
|
4
4
|
import { Exclusive } from "../../commonHelpers/types/exclusive";
|
|
5
5
|
interface IFormGroupToggleBase extends Required<Pick<IFormFieldWithLabel, "label">>, Pick<IFormFieldWithLabel, "tooltip">, PropsWithChildren {
|
|
6
6
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FC } from "react";
|
|
2
2
|
import { IZenComponentProps } from "../commonHelpers/zenComponent";
|
|
3
|
-
import { IFormFieldWithLabel } from "../formField/
|
|
3
|
+
import { IFormFieldWithLabel } from "../formField/types";
|
|
4
4
|
import { TFormGroupToggle } from "./components/formGroupToggle";
|
|
5
5
|
import "./formGroup.less";
|
|
6
6
|
import { IFormGroupList } from "./components/formGroupList";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { TLabelAlign } from "../../formField/
|
|
1
|
+
import { TLabelAlign } from "../../formField/types";
|
|
2
2
|
export declare const useLabelAlign: (labelAlign?: TLabelAlign) => TLabelAlign;
|
package/esm/formGroup/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TLabelAlign } from "../../formField/
|
|
1
|
+
import { TLabelAlign } from "../../formField/types";
|
|
2
2
|
import { TFormLayoutColumns } from "../../formLayout/types";
|
|
3
3
|
import { IControlClasses, ITotalState } from "../types";
|
|
4
4
|
interface IGetCustomControlClassesParams {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TLabelAlign } from "../../formField/
|
|
1
|
+
import { TLabelAlign } from "../../formField/types";
|
|
2
2
|
import { TFormLayoutColumns, TFormLayoutMode } from "../../formLayout/types";
|
|
3
3
|
import { ILabelClasses, ITotalState } from "../types";
|
|
4
4
|
interface IApplyCustomLabelClassesProps {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TLabelAlign } from "../../../formField/
|
|
1
|
+
import { TLabelAlign } from "../../../formField/types";
|
|
2
2
|
import { TFormLayoutColumns } from "../../../formLayout/types";
|
|
3
3
|
import { TFormSectionMode, TFormSectionType } from "../../../formSection/types";
|
|
4
4
|
import { ITotalState } from "../../types";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TLabelAlign } from "../../../formField/
|
|
1
|
+
import { TLabelAlign } from "../../../formField/types";
|
|
2
2
|
import { TFormLayoutColumns } from "../../../formLayout/types";
|
|
3
3
|
export declare const getOneLabelOneControlClasses: (labelAlign: TLabelAlign, columns: TFormLayoutColumns) => {
|
|
4
4
|
controlClasses1: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TLabelAlign } from "../../../formField/
|
|
1
|
+
import { TLabelAlign } from "../../../formField/types";
|
|
2
2
|
import { TFormLayoutColumns } from "../../../formLayout/types";
|
|
3
3
|
import { ITotalState } from "../../types";
|
|
4
4
|
export declare const getOneLabelTwoControlsClasses: (totalState: ITotalState, columns: TFormLayoutColumns, labelAlign: TLabelAlign) => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TLabelAlign } from "../../../formField/
|
|
1
|
+
import { TLabelAlign } from "../../../formField/types";
|
|
2
2
|
import { TFormLayoutColumns } from "../../../formLayout/types";
|
|
3
3
|
export declare const getTwoLabelsOneControlClasses: (labelAlign: TLabelAlign, columns: TFormLayoutColumns) => {
|
|
4
4
|
controlClasses1: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TLabelAlign } from "../../../formField/
|
|
1
|
+
import { TLabelAlign } from "../../../formField/types";
|
|
2
2
|
import { TFormLayoutColumns } from "../../../formLayout/types";
|
|
3
3
|
export declare const getTwoLabelsTwoControlsClasses: (labelAlign1: TLabelAlign, columns: TFormLayoutColumns) => {
|
|
4
4
|
controlClasses1: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TLabelAlign } from "../../../formField/
|
|
1
|
+
import { TLabelAlign } from "../../../formField/types";
|
|
2
2
|
import { TFormLayoutColumns } from "../../../formLayout/types";
|
|
3
3
|
import { TFormSectionMode, TFormSectionType } from "../../../formSection/types";
|
|
4
4
|
import { ITotalState } from "../../types";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TLabelAlign } from "../../../formField/
|
|
1
|
+
import { TLabelAlign } from "../../../formField/types";
|
|
2
2
|
import { TFormLayoutColumns } from "../../../formLayout/types";
|
|
3
3
|
import { ILabelClasses } from "./types";
|
|
4
4
|
export declare const getOneLabelOneControlClasses: (labelAlign: TLabelAlign, columns: TFormLayoutColumns) => ILabelClasses;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TLabelAlign } from "../../../formField/
|
|
1
|
+
import { TLabelAlign } from "../../../formField/types";
|
|
2
2
|
import { TFormLayoutColumns } from "../../../formLayout/types";
|
|
3
3
|
import { ILabelClasses } from "./types";
|
|
4
4
|
export declare const getOneLabelTwoControlsClasses: (labelAlign: TLabelAlign, columns: TFormLayoutColumns, elementsState: any) => ILabelClasses;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TLabelAlign } from "../../../formField/
|
|
1
|
+
import { TLabelAlign } from "../../../formField/types";
|
|
2
2
|
import { TFormLayoutColumns } from "../../../formLayout/types";
|
|
3
3
|
import { ILabelClasses } from "./types";
|
|
4
4
|
export declare const getTwoLabelsOneControlClasses: (labelAlign: TLabelAlign, columns: TFormLayoutColumns) => ILabelClasses;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TLabelAlign } from "../../../formField/
|
|
1
|
+
import { TLabelAlign } from "../../../formField/types";
|
|
2
2
|
import { TFormLayoutColumns } from "../../../formLayout/types";
|
|
3
3
|
import { ILabelClasses } from "./types";
|
|
4
4
|
export declare const getTwoLabelsTwoControlsClasses: (labelAlign: TLabelAlign, columns: TFormLayoutColumns) => ILabelClasses;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { TLabelAlign } from "../../formField/
|
|
1
|
+
import { TLabelAlign } from "../../formField/types";
|
|
2
2
|
import { TFormLayoutColumns } from "../../formLayout/types";
|
|
3
3
|
export declare const getListClasses: (align: TLabelAlign | undefined, columns: TFormLayoutColumns, isFirstLabel?: boolean) => string;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { TLabelAlign } from "../../formField/
|
|
1
|
+
import { TLabelAlign } from "../../formField/types";
|
|
2
2
|
import { TFormLayoutColumns } from "../../formLayout/types";
|
|
3
3
|
export declare const getToggleClasses: (columns: TFormLayoutColumns, labelAlign?: TLabelAlign) => string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { IFormFieldWithLabel, TLabelAlign } from "../../formField/
|
|
2
|
+
import { IFormFieldWithLabel, TLabelAlign } from "../../formField/types";
|
|
3
3
|
import { TFormLayoutMode } from "../../formLayout/types";
|
|
4
4
|
import { IElementsState } from "../types";
|
|
5
5
|
export interface IControlNode extends Pick<IFormFieldWithLabel, "isReadOnly" | "readOnlyValue"> {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { ILoadingBase } from "../commonHelpers/loading";
|
|
3
3
|
import { Exclusive } from "../commonHelpers/types/exclusive";
|
|
4
4
|
import { IZenComponentProps } from "../commonHelpers/zenComponent";
|
|
5
|
-
import { TLabelAlign } from "../formField/
|
|
5
|
+
import { TLabelAlign } from "../formField/types";
|
|
6
6
|
import { TFormSectionType } from "../formSection/types";
|
|
7
7
|
import { IFormStepper } from "../formStepper/formStepper";
|
|
8
8
|
import { IFormStepperButtons } from "../formStepperButtons/formStepperButtons";
|
|
@@ -2,7 +2,7 @@ import { ICard } from "../card/card";
|
|
|
2
2
|
import { ILoadingBase } from "../commonHelpers/loading";
|
|
3
3
|
import { Exclusive } from "../commonHelpers/types/exclusive";
|
|
4
4
|
import { IZenComponentProps, IZenFormLayoutItem } from "../commonHelpers/zenComponent";
|
|
5
|
-
import { TLabelAlign } from "../formField/
|
|
5
|
+
import { TLabelAlign } from "../formField/types";
|
|
6
6
|
import { TFormLayoutMode } from "../formLayout/types";
|
|
7
7
|
export declare const FORM_SECTION = "FORM_SECTION";
|
|
8
8
|
export type TFormSectionMode = TFormLayoutMode;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FC, PropsWithChildren } from "react";
|
|
2
2
|
import { TFormSectionMode, TFormSectionType } from "../types";
|
|
3
|
-
import { TLabelAlign } from "../../formField/
|
|
3
|
+
import { TLabelAlign } from "../../formField/types";
|
|
4
4
|
export interface IFormSectionProviderProps extends PropsWithChildren {
|
|
5
5
|
isFormSection?: boolean;
|
|
6
6
|
labelAlign?: TLabelAlign;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { IFormFieldComponent } from "../formField/
|
|
2
|
+
import { IFormFieldComponent } from "../formField/types";
|
|
3
3
|
import { IGroupButtonRawDefault, TGroupButtonRaw } from "./types";
|
|
4
4
|
import "./groupButtonRaw.less";
|
|
5
5
|
export interface IGroupButtonRaw extends IGroupButtonRawDefault {
|
|
@@ -2,9 +2,9 @@ import React from "react";
|
|
|
2
2
|
import { IAdvancedEntitiesNavigatorDialog, IGroupItem, IGroupsFilterTotalState } from "./groupsFilterInterfaces";
|
|
3
3
|
import "./groupsFilterRaw.less";
|
|
4
4
|
import { IZenComponentProps } from "../commonHelpers/zenComponent";
|
|
5
|
-
import { IFormFieldComponent } from "../formField/formField";
|
|
6
5
|
import { IChipsParent } from "../chip/chip";
|
|
7
6
|
import { TGroupsFilterRaw } from "./types";
|
|
7
|
+
import { IFormFieldComponent } from "../formField/types";
|
|
8
8
|
interface IGroupsFilterOptions {
|
|
9
9
|
/**
|
|
10
10
|
* @deprecated
|
|
@@ -4,7 +4,7 @@ injectString("cs", "GroupCompanyId", "Skupina spole\u010Dnosti");
|
|
|
4
4
|
injectString("da-DK", "GroupCompanyId", "Virksomhedsgruppe");
|
|
5
5
|
injectString("de", "GroupCompanyId", "Unternehmensgruppe");
|
|
6
6
|
injectString("en", "GroupCompanyId", "Company group");
|
|
7
|
-
injectString("es", "GroupCompanyId", "Grupo
|
|
7
|
+
injectString("es", "GroupCompanyId", "Grupo Empresa");
|
|
8
8
|
injectString("fi-FI", "GroupCompanyId", "Yritysryhm\xE4");
|
|
9
9
|
injectString("fr", "GroupCompanyId", "Groupe Entreprise");
|
|
10
10
|
injectString("fr-FR", "GroupCompanyId", "Groupe Entreprise");
|
|
@@ -198,7 +198,7 @@ injectString("de", "GroupPowertrainAndFuelTypeId", "Antriebs- und Kraftstoffart"
|
|
|
198
198
|
injectString("en", "GroupPowertrainAndFuelTypeId", "Powertrain and Fuel Type");
|
|
199
199
|
injectString("es", "GroupPowertrainAndFuelTypeId", "Tipo de sistema de propulsi\xF3n y combustible");
|
|
200
200
|
injectString("fi-FI", "GroupPowertrainAndFuelTypeId", "Voimansiirto ja polttoainetyyppi");
|
|
201
|
-
injectString("fr", "GroupPowertrainAndFuelTypeId", "
|
|
201
|
+
injectString("fr", "GroupPowertrainAndFuelTypeId", "Groupe motopropulseur et type de carburant");
|
|
202
202
|
injectString("fr-FR", "GroupPowertrainAndFuelTypeId", "Groupe motopropulseur et type de carburant");
|
|
203
203
|
injectString("hu-HU", "GroupPowertrainAndFuelTypeId", "Hajt\xE1sl\xE1nc \xE9s \xFCzemanyag t\xEDpusa");
|
|
204
204
|
injectString("id", "GroupPowertrainAndFuelTypeId", "Powertrain dan Tipe Bahan Bakar");
|
|
@@ -30,7 +30,7 @@ export const HeaderTitle = ({ id, children, className, pageName, subline, isBeta
|
|
|
30
30
|
});
|
|
31
31
|
return [b, b.length && !allowBookmarkWithBack ? o.filter(el => el.type !== Bookmark) : o];
|
|
32
32
|
}, [children, allowBookmarkWithBack]);
|
|
33
|
-
return _jsxs("header", { id: id, className: clsNames, children: [_jsxs("div", { className: classNames(["zen-page-header__main-line", driveMainLineClassName || ""]), children: [back.length ? back : null, _jsx("h1", { className: classNames(["zen-page-header__page-name", drivePageNameClassName || ""]), children: pageName }), isBeta ? _jsx(BetaPill, { feedbackAction: feedBackAction, betaOptionAction: betaOptionAction, className: "zen-page-header__beta" }) : null, other.length ? other : null] }), subline || ""] });
|
|
33
|
+
return _jsxs("header", { id: id, className: clsNames, children: [_jsxs("div", { className: classNames(["zen-page-header__main-line", driveMainLineClassName || ""]), children: [back.length ? back : null, pageName ? _jsx("h1", { className: classNames(["zen-page-header__page-name", drivePageNameClassName || ""]), children: pageName }) : null, isBeta ? _jsx(BetaPill, { feedbackAction: feedBackAction, betaOptionAction: betaOptionAction, className: "zen-page-header__beta" }) : null, other.length ? other : null] }), subline || ""] });
|
|
34
34
|
};
|
|
35
35
|
HeaderTitle.displayName = HeaderTitleDisplayName;
|
|
36
36
|
export const TRANSLATIONS = [
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo } from "react";
|
|
3
|
+
import { classNames } from "../commonHelpers/classNames/classNames";
|
|
4
|
+
import { useUniqueId } from "../commonHelpers/useUniqueId";
|
|
5
|
+
export const ImageAdjustFilter = ({ className, title, description, focusable = false }) => {
|
|
6
|
+
const uniqueId = useUniqueId();
|
|
7
|
+
const classes = useMemo(() => classNames([
|
|
8
|
+
"zen-svg-image",
|
|
9
|
+
className !== null && className !== void 0 ? className : ""
|
|
10
|
+
]), [className]);
|
|
11
|
+
return _jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 180 180", focusable: focusable ? "true" : undefined, tabIndex: focusable ? 0 : undefined, role: focusable || title || description ? undefined : "presentation", className: classes, "aria-labelledby": title && focusable ? uniqueId : undefined, "data-name": "ImageAdjustFilter", children: [title ? _jsx("title", { id: uniqueId, children: title }) : null, description ? _jsx("desc", { children: description }) : null, _jsx("circle", { cx: "90", cy: "91", r: "90", fill: "#EFF1F2" }), _jsx("mask", { id: "mask0_28535_79659", style: { maskType: "alpha" }, maskUnits: "userSpaceOnUse", x: "0", y: "0", width: "180", height: "180", children: _jsx("circle", { cx: "90", cy: "90", r: "90", fill: "#D9D9D9" }) }), _jsxs("g", { mask: "url(#mask0_28535_79659)", children: [_jsx("rect", { x: "29.0156", y: "27.001", width: "214.137", height: "118.084", rx: "2.11987", fill: "#E6EBEF" }), _jsx("rect", { x: "28", y: "62.0273", width: "214.662", height: "46.5352", rx: "2.11987", fill: "white" }), _jsx("rect", { x: "28", y: "108.562", width: "214.662", height: "121.092", rx: "2.11987", fill: "#E6EBEF" }), _jsx("rect", { x: "40.0073", y: "74.5371", width: "66.0499", height: "21.0159", rx: "2.11987", fill: "#A6B8C9" }), _jsx("rect", { width: "21.5163", height: "21.0159", rx: "2.11987", transform: "matrix(-1 0 0 1 129.076 74.5371)", fill: "#A6B8C9" }), _jsx("rect", { x: "38.5049", y: "76.0381", width: "66.0499", height: "21.0159", rx: "2.11987", fill: "#E6EBEF" }), _jsx("rect", { x: "143.086", y: "74.5371", width: "99.5753", height: "21.0159", rx: "2.11987", fill: "#E6EBEF" }), _jsx("rect", { x: "106.06", y: "76.0381", width: "21.0159", height: "21.0159", rx: "2.11987", fill: "#E6EBEF" }), _jsx("path", { d: "M116.567 91.0498L111.8 84.67H121.334L116.567 91.0498Z", fill: "#4E677E" }), _jsx("rect", { x: "44.5117", y: "80.542", width: "2.00151", height: "13.0098", fill: "#4E677E" }), _jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M103.919 93.0928V146.847L118.339 133.077L119.116 132.409H143.574V130.545L103.919 93.0928Z", fill: "#A6B8C9" }), _jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M103.919 91.3301V145.085L118.339 131.314L119.116 130.647H143.574L103.919 91.3301Z", fill: "#43596D" })] })] });
|
|
12
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo } from "react";
|
|
3
|
+
import { classNames } from "../commonHelpers/classNames/classNames";
|
|
4
|
+
import { useUniqueId } from "../commonHelpers/useUniqueId";
|
|
5
|
+
export const ImageNoMatchingAssets = ({ className, title, description, focusable = false }) => {
|
|
6
|
+
const uniqueId = useUniqueId();
|
|
7
|
+
const classes = useMemo(() => classNames([
|
|
8
|
+
"zen-svg-image",
|
|
9
|
+
className !== null && className !== void 0 ? className : ""
|
|
10
|
+
]), [className]);
|
|
11
|
+
return _jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 180 180", focusable: focusable ? "true" : undefined, tabIndex: focusable ? 0 : undefined, role: focusable || title || description ? undefined : "presentation", className: classes, "aria-labelledby": title && focusable ? uniqueId : undefined, "data-name": "ImageNoMatchingAssets", children: [title ? _jsx("title", { id: uniqueId, children: title }) : null, description ? _jsx("desc", { children: description }) : null, _jsx("circle", { cx: "90", cy: "90", r: "90", fill: "#F2F5F7" }), _jsx("path", { d: "M49.2449 51.725C49.3822 50.7362 50.2276 50 51.2259 50H74.186C74.5236 50 74.8558 50.0855 75.1514 50.2484L86.4138 56.4562C86.7095 56.6191 87.0417 56.7046 87.3793 56.7046H148.02C149.245 56.7046 150.183 57.7961 149.997 59.0072L140.609 120.349C140.46 121.325 139.62 122.046 138.632 122.046H41.7812C40.5673 122.046 39.6333 120.974 39.8001 119.771L49.2449 51.725Z", fill: "#A6B8C9" }), _jsx("path", { d: "M133.485 61.9948L72.6656 61.9948C72.2202 61.9948 71.7875 61.8461 71.4362 61.5723L60.3485 52.9308C59.9974 52.6571 59.5649 52.5085 59.1197 52.5083L36.4957 52.5007C35.3909 52.5003 34.4951 53.3958 34.495 54.5006L34.4949 56.4822L57.8171 56.49C58.2567 56.4902 58.6839 56.6352 59.0329 56.9025L68.4542 64.1218C68.8031 64.3892 69.2304 64.5342 69.67 64.5343L71.9774 64.5351L132.998 71.2804C134.095 71.4017 135.083 70.6107 135.205 69.5134L135.485 67L135.485 63.9948C135.485 62.8902 134.589 61.9948 133.485 61.9948Z", fill: "white" }), _jsx("path", { d: "M34.5737 56.0856C34.525 54.9485 35.4337 54 36.5719 54H59.0006C59.4538 54 59.8936 54.1539 60.2479 54.4366L71.3174 63.268C71.6716 63.5507 72.1114 63.7046 72.5647 63.7046H133.447C134.513 63.7046 135.391 64.5406 135.444 65.6053L138.245 121.947C138.302 123.089 137.391 124.046 136.248 124.046H39.4005C38.3293 124.046 37.4482 123.202 37.4024 122.132L34.5737 56.0856Z", fill: "#E6EBEF" }), _jsx("path", { d: "M39.5 129.759C39.5 130.425 41.0596 130.966 41.75 130.966H44.25C44.9404 130.966 45.5 130.425 45.5 129.759V118.897H56.75C57.4404 118.897 58 118.356 58 117.69V115.276C58 114.609 57.4404 113 56.75 113L45.5 114.069V103.207C45.5 102.54 44.1904 100.5 43.5 100.5L41.75 102C41.0596 102 40.5 102.54 40.5 103.207V114.069H29.25C28.5596 114.069 28 114.609 28 115.276L27.5 116.5C27.5 117.167 28.5596 118.897 29.25 118.897L39.5 119V129.759Z", fill: "#4E677E" }), _jsx("path", { d: "M43.5 100C44.0523 100 44.5 100.448 44.5 101V112.499H56C56.5522 112.499 56.9998 112.947 57 113.499V116.499C57 117.051 56.5523 117.499 56 117.499H44.5V129C44.5 129.552 44.0523 130 43.5 130H40.5C39.9479 130 39.5 129.552 39.5 129V117.499H28C27.4477 117.499 27 117.051 27 116.499V113.499C27.0002 112.947 27.4478 112.499 28 112.499H39.5V101C39.5 100.448 39.9479 100 40.5 100H43.5Z", fill: "#A6B8C9" }), _jsx("rect", { x: "59.0488", y: "97", width: "4", height: "8", rx: "1", transform: "rotate(34.7836 59.0488 97)", fill: "#4E677E" }), _jsx("rect", { x: "70.3809", y: "111", width: "4", height: "8", rx: "1", transform: "rotate(80.7533 70.3809 111)", fill: "#4E677E" }), _jsx("rect", { x: "69.9941", y: "127.125", width: "4", height: "8", rx: "1", transform: "rotate(105.407 69.9941 127.125)", fill: "#4E677E" })] });
|
|
12
|
+
};
|