@geotab/zenith 3.9.0-beta.1 → 3.9.0-beta.3
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 +0 -7
- package/dist/card/card.d.ts +1 -1
- package/dist/card/card.js +1 -1
- package/dist/{title → card/components}/title.d.ts +1 -1
- package/dist/card/components/title.js +26 -0
- package/dist/card/helpers/getIconTypeFromStatus.d.ts +1 -1
- package/dist/dataGrid/withSelectableRows/components/bulkActions/bulkActions.d.ts +3 -5
- package/dist/dataGrid/withSelectableRows/components/bulkActions/bulkActions.js +38 -2
- package/dist/dateInputInner/dateInputInnerControlBlock.js +5 -2
- package/dist/index.css +34 -32
- package/dist/index.d.ts +2 -1
- package/dist/index.js +22 -20
- package/dist/table/children/useTableChildren.d.ts +1 -1
- package/dist/table/children/useTableChildren.js +3 -3
- package/dist/table/selectable/useSelectableRows.d.ts +0 -8
- package/dist/table/selectable/useSelectableRows.js +7 -14
- package/dist/table/table.js +7 -1
- package/esm/card/card.d.ts +1 -1
- package/esm/card/card.js +1 -1
- package/esm/{title → card/components}/title.d.ts +1 -1
- package/esm/card/components/title.js +22 -0
- package/esm/card/helpers/getIconTypeFromStatus.d.ts +1 -1
- package/esm/dataGrid/withSelectableRows/components/bulkActions/bulkActions.d.ts +3 -5
- package/esm/dataGrid/withSelectableRows/components/bulkActions/bulkActions.js +38 -2
- package/esm/dateInputInner/dateInputInnerControlBlock.js +5 -2
- package/esm/index.d.ts +2 -1
- package/esm/index.js +2 -1
- package/esm/table/children/useTableChildren.d.ts +1 -1
- package/esm/table/children/useTableChildren.js +3 -3
- package/esm/table/selectable/useSelectableRows.d.ts +0 -8
- package/esm/table/selectable/useSelectableRows.js +7 -14
- package/esm/table/table.js +7 -1
- package/package.json +1 -1
- package/dist/title/title.js +0 -27
- package/esm/title/title.js +0 -23
package/README.md
CHANGED
|
@@ -45,13 +45,6 @@ Now components are ready for usage.
|
|
|
45
45
|
|
|
46
46
|
Zenith library provides components defined in Zenith Design System. It includes very basic blocks like colors, icons, font presets, atom components like buttons, checkboxes etc and high order components - header, table, filters bar etc. List of existing components can be found in [Storybook](https://developers.geotab.com/zenith-storybook/index.html).
|
|
47
47
|
|
|
48
|
-
## Documentation
|
|
49
|
-
|
|
50
|
-
- [Development Guide](docs/DEVELOPMENT.md) - Creating components, adding icons, testing, code style
|
|
51
|
-
- [Build Process](docs/BUILD.md) - How the build system works
|
|
52
|
-
- [Release Process](docs/RELEASE.md) - How to publish new versions of Zenith
|
|
53
|
-
- [Translations](docs/TRANSLATIONS.md) - How translations work and how to manage them
|
|
54
|
-
|
|
55
48
|
## Change log
|
|
56
49
|
|
|
57
50
|
### 3.8.0
|
package/dist/card/card.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { FC, FunctionComponent, ReactNode } from "react";
|
|
2
2
|
import { IAbsoluteSize, TContainerSize } from "../cardContainer/cardContainer";
|
|
3
3
|
import { TCardStatus } from "./components/status";
|
|
4
|
-
import { TIconType } from "
|
|
4
|
+
import { TIconType } from "./components/title";
|
|
5
5
|
import { IActions } from "./components/actions";
|
|
6
6
|
import { IContent } from "./components/content";
|
|
7
7
|
import "./card.less";
|
package/dist/card/card.js
CHANGED
|
@@ -71,7 +71,7 @@ const cardContainer_1 = require("../cardContainer/cardContainer");
|
|
|
71
71
|
const deviceType_1 = require("../commonHelpers/hooks/deviceType");
|
|
72
72
|
const useDeviceType_1 = require("../commonHelpers/hooks/useDeviceType");
|
|
73
73
|
const status_1 = require("./components/status");
|
|
74
|
-
const title_1 = require("
|
|
74
|
+
const title_1 = require("./components/title");
|
|
75
75
|
const actions_1 = require("./components/actions");
|
|
76
76
|
const content_1 = require("./components/content");
|
|
77
77
|
const useCardSize_1 = require("./hooks/useCardSize");
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FunctionComponent } from "react";
|
|
2
2
|
import "./title.less";
|
|
3
|
-
import { IIcon } from "
|
|
3
|
+
import { IIcon } from "../../icons/icon";
|
|
4
4
|
export type TIconType = "info" | "warning" | "error" | "success" | "default";
|
|
5
5
|
interface ITitle {
|
|
6
6
|
isMobile: boolean;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Title = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const classNames_1 = require("../../commonHelpers/classNames/classNames");
|
|
7
|
+
const useDriveClassName_1 = require("../../utils/theme/useDriveClassName");
|
|
8
|
+
const useDrive_1 = require("../../utils/theme/useDrive");
|
|
9
|
+
const iconChevronRightSmall_1 = require("../../icons/iconChevronRightSmall");
|
|
10
|
+
const Title = ({ isMobile, link, target, title, id, icon, iconType, className = "", onClick }) => {
|
|
11
|
+
const driveClassNames = (0, useDriveClassName_1.useDriveClassName)("zen-card-title");
|
|
12
|
+
const isDrive = (0, useDrive_1.useDrive)();
|
|
13
|
+
const iconClassName = iconType ? `zen-card-title__icon--${iconType}` : "";
|
|
14
|
+
const iconSize = (0, react_1.useMemo)(() => (isDrive ? "huge" : "large"), [isDrive]);
|
|
15
|
+
const iconElement = (0, react_1.useMemo)(() => (icon ? (0, jsx_runtime_1.jsx)("div", { className: (0, classNames_1.classNames)(["zen-card-title__icon", iconClassName]), children: (0, react_1.createElement)(icon, { size: iconSize }) }) : null), [icon, iconSize, iconClassName]);
|
|
16
|
+
const chevron = (0, react_1.useMemo)(() => ((0, jsx_runtime_1.jsx)("span", { className: "zen-card-title__link-chevron", children: (0, jsx_runtime_1.jsx)(iconChevronRightSmall_1.IconChevronRightSmall, { size: iconSize, className: "zen-card-title__chevron-icon" }) })), [iconSize]);
|
|
17
|
+
const titleClasses = (0, classNames_1.classNames)(["zen-card-title", driveClassNames || "", onClick ? "zen-card-title__clickable" : ""]);
|
|
18
|
+
if (onClick) {
|
|
19
|
+
return ((0, jsx_runtime_1.jsxs)("button", { type: "button", className: titleClasses, onClick: onClick, children: [iconElement, (0, jsx_runtime_1.jsxs)("span", { title: title, id: id, className: (0, classNames_1.classNames)(["zen-card-title__text", isMobile && !isDrive ? "zen-card-title__text--mobile" : "", className]), children: [title, chevron] })] }));
|
|
20
|
+
}
|
|
21
|
+
if (link) {
|
|
22
|
+
return ((0, jsx_runtime_1.jsxs)("a", { id: id, className: titleClasses, href: link, target: target, children: [iconElement, (0, jsx_runtime_1.jsxs)("span", { title: title, className: (0, classNames_1.classNames)(["zen-card-title__link-text"]), children: [title, chevron] })] }));
|
|
23
|
+
}
|
|
24
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: titleClasses, children: [iconElement, (0, jsx_runtime_1.jsx)("span", { title: title, id: id, className: (0, classNames_1.classNames)(["zen-card-title__text", isMobile && !isDrive ? "zen-card-title__text--mobile" : "", className]), children: title })] }));
|
|
25
|
+
};
|
|
26
|
+
exports.Title = Title;
|
|
@@ -7,21 +7,19 @@ import { DeviceType } from "../../../../commonHelpers/hooks/deviceType";
|
|
|
7
7
|
type TBulkAction = IBulkActionLink | IBulkActionButton;
|
|
8
8
|
export interface IBulkActionsProps extends IZenComponentProps {
|
|
9
9
|
selected: number;
|
|
10
|
-
/**
|
|
11
|
-
* When `true`, displays "All selected" instead of a count, and enables action buttons
|
|
12
|
-
* even when `selected` is 0 (i.e., cross-page "select all" is active).
|
|
13
|
-
*/
|
|
14
10
|
allSelected?: boolean;
|
|
15
11
|
onClearSelection: () => void;
|
|
12
|
+
onSelectAll?: () => void;
|
|
16
13
|
gridType?: DeviceType;
|
|
17
14
|
children?: ReactElement<TBulkAction> | null | (ReactElement<TBulkAction> | null)[];
|
|
15
|
+
turnOffSelectAll?: boolean;
|
|
18
16
|
}
|
|
19
17
|
export interface IBulkActions extends IBulkActionsProps {
|
|
20
18
|
ActionLink: (props: IBulkActionLink) => ReactNode;
|
|
21
19
|
ActionButton: (props: IBulkActionButton) => ReactNode;
|
|
22
20
|
}
|
|
23
21
|
export declare const BulkActions: {
|
|
24
|
-
({ selected, allSelected, className, onClearSelection, gridType, children }: IBulkActionsProps): import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
({ selected, allSelected, className, onClearSelection, onSelectAll, gridType, children, turnOffSelectAll }: IBulkActionsProps): import("react/jsx-runtime").JSX.Element;
|
|
25
23
|
ActionLink: ({ title, icon, link, disabled, type, ref }: IBulkActionLink) => import("react/jsx-runtime").JSX.Element;
|
|
26
24
|
ActionButton: ({ title, icon, clickHandler, onClick, disabled, type, ref }: IBulkActionButton) => import("react/jsx-runtime").JSX.Element;
|
|
27
25
|
translations: string[];
|
|
@@ -89,6 +89,33 @@ injectString("zh-Hans", "Clear selection", "\u6E05\u9664\u9009\u62E9");
|
|
|
89
89
|
injectString("zh-TW", "Clear selection", "\u6E05\u9664\u9078\u53D6\u9805\u76EE");
|
|
90
90
|
injectString("ro-RO", "Clear selection", "\u0218terge\u021Bi selec\u021Bia");
|
|
91
91
|
injectString("ar-SA", "Clear selection", "\u0645\u0633\u062D \u0627\u0644\u062A\u062D\u062F\u064A\u062F");
|
|
92
|
+
injectString("cs", "Select all", "Vybrat v\u0161e");
|
|
93
|
+
injectString("da-DK", "Select all", "V\xE6lg alle");
|
|
94
|
+
injectString("de", "Select all", "Alle ausw\xE4hlen");
|
|
95
|
+
injectString("en", "Select all", "Select all");
|
|
96
|
+
injectString("es", "Select all", "Seleccionar todo");
|
|
97
|
+
injectString("fi-FI", "Select all", "Valitse kaikki");
|
|
98
|
+
injectString("fr", "Select all", "S\xE9lectionner tout");
|
|
99
|
+
injectString("fr-FR", "Select all", "S\xE9lectionner tout");
|
|
100
|
+
injectString("hu-HU", "Select all", "V\xE1laszd ki az \xF6sszeset.");
|
|
101
|
+
injectString("id", "Select all", "Pilih semua");
|
|
102
|
+
injectString("it", "Select all", "Selezionare tutto");
|
|
103
|
+
injectString("ja", "Select all", "\u3059\u3079\u3066\u9078\u629E");
|
|
104
|
+
injectString("ko-KR", "Select all", "\uBAA8\uB450 \uC120\uD0DD");
|
|
105
|
+
injectString("ms", "Select all", "Pilih semua");
|
|
106
|
+
injectString("nb-NO", "Select all", "Velg alle");
|
|
107
|
+
injectString("nl", "Select all", "Alles selecteren");
|
|
108
|
+
injectString("pl", "Select all", "Wybierz wszystko");
|
|
109
|
+
injectString("pt-BR", "Select all", "Selecionar tudo");
|
|
110
|
+
injectString("pt-PT", "Select all", "Selecionar tudo");
|
|
111
|
+
injectString("sk-SK", "Select all", "Vyber v\u0161etko.");
|
|
112
|
+
injectString("sv", "Select all", "V\xE4lj alla");
|
|
113
|
+
injectString("th", "Select all", "\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E17\u0E31\u0E49\u0E07\u0E2B\u0E21\u0E14");
|
|
114
|
+
injectString("tr", "Select all", "T\xFCm\xFCn\xFC se\xE7");
|
|
115
|
+
injectString("zh-Hans", "Select all", "\u5168\u9009");
|
|
116
|
+
injectString("zh-TW", "Select all", "\u5168\u9078");
|
|
117
|
+
injectString("ro-RO", "Select all", "Selecta\u021Bi tot");
|
|
118
|
+
injectString("ar-SA", "Select all", "\u062A\u062D\u062F\u064A\u062F \u0627\u0644\u0643\u0644");
|
|
92
119
|
injectString("cs", "More", "V\xEDce");
|
|
93
120
|
injectString("da-DK", "More", "Mere");
|
|
94
121
|
injectString("de", "More", "Mehr");
|
|
@@ -128,13 +155,16 @@ const useNonFittingElements_1 = require("../../../../header/hooks/useNonFittingE
|
|
|
128
155
|
const useResizeObserver_1 = require("../../../../commonHelpers/hooks/useResizeObserver");
|
|
129
156
|
const menu_1 = require("../../../../menu/menu");
|
|
130
157
|
const iconDotVertical_1 = require("../../../../icons/iconDotVertical");
|
|
158
|
+
const button_1 = require("../../../../button/button");
|
|
131
159
|
const BulkActions = ({
|
|
132
160
|
selected,
|
|
133
161
|
allSelected,
|
|
134
162
|
className,
|
|
135
163
|
onClearSelection,
|
|
164
|
+
onSelectAll,
|
|
136
165
|
gridType = deviceType_1.DeviceType.Desktop,
|
|
137
|
-
children
|
|
166
|
+
children,
|
|
167
|
+
turnOffSelectAll
|
|
138
168
|
}) => {
|
|
139
169
|
var _a;
|
|
140
170
|
const {
|
|
@@ -178,7 +208,13 @@ const BulkActions = ({
|
|
|
178
208
|
}), (0, jsx_runtime_1.jsx)("span", {
|
|
179
209
|
className: "zen-bulk-actions__number-of-selected ellipsis",
|
|
180
210
|
children: text
|
|
181
|
-
}), (0, jsx_runtime_1.
|
|
211
|
+
}), onSelectAll && !turnOffSelectAll ? (0, jsx_runtime_1.jsx)(button_1.Button, {
|
|
212
|
+
type: "tertiary",
|
|
213
|
+
className: "zen-bulk-actions__select-all",
|
|
214
|
+
disabled: allSelected,
|
|
215
|
+
onClick: onSelectAll,
|
|
216
|
+
children: translate("Select all")
|
|
217
|
+
}) : null, (0, jsx_runtime_1.jsxs)("div", {
|
|
182
218
|
className: "zen-bulk-actions__action-button-holder",
|
|
183
219
|
ref: buttonHolder,
|
|
184
220
|
children: [react_1.Children.map(visibleElements, element => (0, react_1.cloneElement)(element, {
|
|
@@ -116,12 +116,15 @@ const DateInputInnerControlBlock = props => {
|
|
|
116
116
|
value: timePickerValue,
|
|
117
117
|
onChange: timeChangeHandler,
|
|
118
118
|
isMobileView: isMobileView,
|
|
119
|
-
fullWidth: true
|
|
119
|
+
fullWidth: true,
|
|
120
|
+
// eslint-disable-next-line
|
|
121
|
+
// @ts-ignore
|
|
122
|
+
dataTimeId: id
|
|
120
123
|
}), isHasTimeError ? (0, jsx_runtime_1.jsx)(formFieldError_1.FormFieldError, {
|
|
121
124
|
id: timeErrorId,
|
|
122
125
|
error: translate("The time must be set")
|
|
123
126
|
}) : null]
|
|
124
|
-
}) : null, [isActiveField, isHasTimeError,
|
|
127
|
+
}) : null, [selectTime, isActiveField, isHasTimeError, timePickerValue, timeChangeHandler, isMobileView, id, timeErrorId, translate]);
|
|
125
128
|
return (0, jsx_runtime_1.jsxs)("div", {
|
|
126
129
|
className: (0, classNames_1.classNames)(["zen-date-input-inner__control-block", className || ""]),
|
|
127
130
|
children: [title ? (0, jsx_runtime_1.jsx)("label", {
|
package/dist/index.css
CHANGED
|
@@ -3125,12 +3125,8 @@ html:lang(ar) .zen-title-text--mobile {
|
|
|
3125
3125
|
text-transform: none;
|
|
3126
3126
|
text-decoration: none;
|
|
3127
3127
|
}
|
|
3128
|
-
.zen-title {
|
|
3128
|
+
.zen-card-title {
|
|
3129
3129
|
display: flex;
|
|
3130
|
-
margin: 0;
|
|
3131
|
-
font-size: inherit;
|
|
3132
|
-
font-weight: inherit;
|
|
3133
|
-
line-height: inherit;
|
|
3134
3130
|
gap: 8px;
|
|
3135
3131
|
align-items: center;
|
|
3136
3132
|
box-sizing: border-box;
|
|
@@ -3138,10 +3134,10 @@ html:lang(ar) .zen-title-text--mobile {
|
|
|
3138
3134
|
min-width: 0;
|
|
3139
3135
|
text-decoration: none;
|
|
3140
3136
|
}
|
|
3141
|
-
.zen-title * {
|
|
3137
|
+
.zen-card-title * {
|
|
3142
3138
|
box-sizing: border-box;
|
|
3143
3139
|
}
|
|
3144
|
-
.zen-title__icon {
|
|
3140
|
+
.zen-card-title__icon {
|
|
3145
3141
|
height: 24px;
|
|
3146
3142
|
width: 24px;
|
|
3147
3143
|
flex: 0 0 auto;
|
|
@@ -3153,32 +3149,30 @@ html:lang(ar) .zen-title-text--mobile {
|
|
|
3153
3149
|
background-color: var(--accents-general--main);
|
|
3154
3150
|
box-sizing: border-box;
|
|
3155
3151
|
}
|
|
3156
|
-
.zen-title__icon--success {
|
|
3152
|
+
.zen-card-title__icon--success {
|
|
3157
3153
|
fill: var(--accents-success--detail);
|
|
3158
3154
|
background-color: var(--accents-success--main);
|
|
3159
3155
|
}
|
|
3160
|
-
.zen-title__icon--error {
|
|
3156
|
+
.zen-card-title__icon--error {
|
|
3161
3157
|
fill: var(--accents-error--detail);
|
|
3162
3158
|
background-color: var(--accents-error--main);
|
|
3163
3159
|
}
|
|
3164
|
-
.zen-title__icon--warning {
|
|
3160
|
+
.zen-card-title__icon--warning {
|
|
3165
3161
|
fill: var(--accents-warning--detail);
|
|
3166
3162
|
background-color: var(--accents-warning--main);
|
|
3167
3163
|
}
|
|
3168
|
-
.zen-title__icon--default {
|
|
3164
|
+
.zen-card-title__icon--default {
|
|
3169
3165
|
background-color: var(--backgrounds-content-1);
|
|
3170
3166
|
fill: var(--text-secondary);
|
|
3171
3167
|
}
|
|
3172
|
-
.zen-
|
|
3173
|
-
.zen-title__link {
|
|
3168
|
+
.zen-card-title__link {
|
|
3174
3169
|
display: flex;
|
|
3175
3170
|
gap: 4px;
|
|
3176
3171
|
text-decoration: none;
|
|
3177
3172
|
min-width: 0;
|
|
3178
|
-
align-items: center;
|
|
3179
3173
|
}
|
|
3180
|
-
.zen-title__text,
|
|
3181
|
-
.zen-title__link-text {
|
|
3174
|
+
.zen-card-title__text,
|
|
3175
|
+
.zen-card-title__link-text {
|
|
3182
3176
|
font-family: Roboto, "Segoe UI", Segoe, "Helvetica Neue", Helvetica, sans-serif;
|
|
3183
3177
|
font-size: 0.875rem;
|
|
3184
3178
|
font-style: normal;
|
|
@@ -3196,11 +3190,11 @@ html:lang(ar) .zen-title-text--mobile {
|
|
|
3196
3190
|
text-align: start;
|
|
3197
3191
|
color: var(--text-primary);
|
|
3198
3192
|
}
|
|
3199
|
-
html:lang(ar) .zen-title__text,
|
|
3200
|
-
html:lang(ar) .zen-title__link-text {
|
|
3193
|
+
html:lang(ar) .zen-card-title__text,
|
|
3194
|
+
html:lang(ar) .zen-card-title__link-text {
|
|
3201
3195
|
font-family: "Noto Sans Arabic", Roboto, "Segoe UI", Segoe, "Helvetica Neue", Helvetica, sans-serif;
|
|
3202
3196
|
}
|
|
3203
|
-
.zen-title__link-chevron {
|
|
3197
|
+
.zen-card-title__link-chevron {
|
|
3204
3198
|
display: inline-flex;
|
|
3205
3199
|
align-items: center;
|
|
3206
3200
|
vertical-align: middle;
|
|
@@ -3208,7 +3202,7 @@ html:lang(ar) .zen-title__link-text {
|
|
|
3208
3202
|
height: 16px;
|
|
3209
3203
|
fill: var(--text-primary);
|
|
3210
3204
|
}
|
|
3211
|
-
.zen-title__clickable {
|
|
3205
|
+
.zen-card-title__clickable {
|
|
3212
3206
|
border: none;
|
|
3213
3207
|
background: none;
|
|
3214
3208
|
padding: 0;
|
|
@@ -3216,28 +3210,32 @@ html:lang(ar) .zen-title__link-text {
|
|
|
3216
3210
|
gap: 4px;
|
|
3217
3211
|
cursor: pointer;
|
|
3218
3212
|
}
|
|
3219
|
-
.zen-title--drive .zen-title__text,
|
|
3220
|
-
.zen-title--drive .zen-title__link-text {
|
|
3221
|
-
font-family:
|
|
3222
|
-
font-size:
|
|
3213
|
+
.zen-card-title--drive .zen-card-title__text,
|
|
3214
|
+
.zen-card-title--drive .zen-card-title__link-text {
|
|
3215
|
+
font-family: Roboto, "Segoe UI", Segoe, "Helvetica Neue", Helvetica, sans-serif;
|
|
3216
|
+
font-size: 1rem;
|
|
3223
3217
|
font-style: normal;
|
|
3224
3218
|
font-weight: 500;
|
|
3225
3219
|
letter-spacing: 0.01rem;
|
|
3226
|
-
line-height: 1.
|
|
3220
|
+
line-height: 1.25rem;
|
|
3227
3221
|
text-transform: none;
|
|
3228
3222
|
text-decoration: none;
|
|
3229
3223
|
}
|
|
3230
|
-
.zen-title--drive .zen-
|
|
3224
|
+
html:lang(ar) .zen-card-title--drive .zen-card-title__text,
|
|
3225
|
+
html:lang(ar) .zen-card-title--drive .zen-card-title__link-text {
|
|
3226
|
+
font-family: "Noto Sans Arabic", Roboto, "Segoe UI", Segoe, "Helvetica Neue", Helvetica, sans-serif;
|
|
3227
|
+
}
|
|
3228
|
+
.zen-card-title--drive .zen-card-title__icon {
|
|
3231
3229
|
width: 32px;
|
|
3232
3230
|
height: 32px;
|
|
3233
3231
|
}
|
|
3234
|
-
.zen-title--drive .zen-title__link-chevron {
|
|
3232
|
+
.zen-card-title--drive .zen-card-title__link-chevron {
|
|
3235
3233
|
width: 20px;
|
|
3236
3234
|
height: 20px;
|
|
3237
3235
|
}
|
|
3238
|
-
.zen-title--drive-tablet .zen-title__text,
|
|
3239
|
-
.zen-title--drive-tablet .zen-title__link-text {
|
|
3240
|
-
font-family:
|
|
3236
|
+
.zen-card-title--drive-tablet .zen-card-title__text,
|
|
3237
|
+
.zen-card-title--drive-tablet .zen-card-title__link-text {
|
|
3238
|
+
font-family: Roboto, "Segoe UI", Segoe, "Helvetica Neue", Helvetica, sans-serif;
|
|
3241
3239
|
font-size: 1.125rem;
|
|
3242
3240
|
font-style: normal;
|
|
3243
3241
|
font-weight: 500;
|
|
@@ -3246,11 +3244,15 @@ html:lang(ar) .zen-title__link-text {
|
|
|
3246
3244
|
text-transform: none;
|
|
3247
3245
|
text-decoration: none;
|
|
3248
3246
|
}
|
|
3249
|
-
.zen-title--drive-tablet .zen-
|
|
3247
|
+
html:lang(ar) .zen-card-title--drive-tablet .zen-card-title__text,
|
|
3248
|
+
html:lang(ar) .zen-card-title--drive-tablet .zen-card-title__link-text {
|
|
3249
|
+
font-family: "Noto Sans Arabic", Roboto, "Segoe UI", Segoe, "Helvetica Neue", Helvetica, sans-serif;
|
|
3250
|
+
}
|
|
3251
|
+
.zen-card-title--drive-tablet .zen-card-title__icon {
|
|
3250
3252
|
width: 32px;
|
|
3251
3253
|
height: 32px;
|
|
3252
3254
|
}
|
|
3253
|
-
.zen-title--drive-tablet .zen-title__link-chevron {
|
|
3255
|
+
.zen-card-title--drive-tablet .zen-card-title__link-chevron {
|
|
3254
3256
|
width: 20px;
|
|
3255
3257
|
height: 20px;
|
|
3256
3258
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -20,6 +20,7 @@ export { type ICardButton, CardButton } from "./card/components/cardButton/cardB
|
|
|
20
20
|
export { type ICardToggle, CardToggle } from "./card/components/cardToggle/cardToggle";
|
|
21
21
|
export { type IContent, Content } from "./card/components/content";
|
|
22
22
|
export { type TCardStatus, Status } from "./card/components/status";
|
|
23
|
+
export { Title } from "./card/components/title";
|
|
23
24
|
export { TitleLink } from "./card/components/titleLink";
|
|
24
25
|
export { getDefaultFullWidthValue } from "./card/helpers/getDefaultFullWidthValue";
|
|
25
26
|
export { getIconFromStatus } from "./card/helpers/getIconFromStatus";
|
|
@@ -757,7 +758,6 @@ export { type ITextInputRaw, TextInputRaw } from "./textInputRaw/textInputRaw";
|
|
|
757
758
|
export { type ITextarea, Textarea } from "./textarea/textarea";
|
|
758
759
|
export { type ITextareaRaw, TextareaRaw } from "./textareaRaw/textareaRaw";
|
|
759
760
|
export { type ITimePicker, type TTimePicker, TimePicker } from "./timePicker/timePicker";
|
|
760
|
-
export { Title } from "./title/title";
|
|
761
761
|
export { type IShowToast, useToast } from "./toast/hooks/useToast";
|
|
762
762
|
export { type IToast, Toast } from "./toast/toast";
|
|
763
763
|
export { type IToggleButton, type TToggleButton, ToggleButton } from "./toggleButton/toggleButton";
|
|
@@ -772,6 +772,7 @@ export { getNewFocusableItem, getFirstFocusableItem } from "./utils/keyboardHelp
|
|
|
772
772
|
export { LanguageProvider } from "./utils/localization/languageProvider";
|
|
773
773
|
export { dictionaries, injectString } from "./utils/localization/translationsDictionary";
|
|
774
774
|
export { useDirection } from "./utils/localization/useDirection";
|
|
775
|
+
export { useLanguage } from "./utils/localization/useLanguage";
|
|
775
776
|
export { ThemeDark } from "./utils/theme/themeDark";
|
|
776
777
|
export { ThemeDrive } from "./utils/theme/themeDrive";
|
|
777
778
|
export { ThemeProvider } from "./utils/theme/themeProvider";
|
package/dist/index.js
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
exports.
|
|
5
|
-
exports.
|
|
6
|
-
exports.
|
|
7
|
-
exports.
|
|
8
|
-
exports.
|
|
9
|
-
exports.
|
|
10
|
-
exports.
|
|
11
|
-
exports.
|
|
12
|
-
exports.
|
|
13
|
-
exports.
|
|
14
|
-
exports.
|
|
15
|
-
exports.
|
|
16
|
-
exports.
|
|
17
|
-
exports.
|
|
18
|
-
exports.
|
|
19
|
-
exports.
|
|
20
|
-
exports.Waiting = exports.UserFormatProvider = exports.useDrive = exports.ThemeProvider = exports.ThemeDrive = exports.ThemeDark = exports.useDirection = exports.injectString = exports.dictionaries = exports.LanguageProvider = exports.getFirstFocusableItem = exports.getNewFocusableItem = exports.HeaderButtonsProvider = exports.AbortablePromise = exports.Tooltip = exports.removeArrowClasses = exports.calculateArrowPosition = exports.ToggleButtonRaw = exports.ToggleButton = exports.Toast = exports.useToast = exports.
|
|
3
|
+
exports.getDefaultFullWidthValue = exports.TitleLink = exports.Title = exports.Status = exports.Content = exports.CardToggle = exports.CardButton = exports.Actions = exports.Card = exports.isDifferentPeriod = exports.isValidationDateError = exports.isValidDate = exports.getSelectableYears = exports.isDisableDate = exports.isDisableYear = exports.getAvailablePeriod = exports.toDayStart = exports.setYear = exports.getSameDateOrTheLastForMonth = exports.addMonth = exports.getEndOfWeek = exports.getStartOfWeek = exports.getDayOfWeekOffset = exports.addMonths = exports.addDays = exports.addMinutes = exports.getNewEndDate = exports.getNewStartDate = exports.getCalendarMonthDates = exports.getEndOfMonth = exports.getStartOfMonth = exports.dayNames = exports.Calendar = exports.ButtonType = exports.Button = exports.Bookmark = exports.BetaPillProvider = exports.BetaPill = exports.getBannerOptions = exports.options = exports.DEFAULT_BANNER_UPSELL_SIZE = exports.BannerUpsell = exports.Banner = exports.BannerDisplayName = exports.Anchor = exports.useAlert = exports.Alert = exports.AccordionItem = exports.Accordion = exports.Absolute = void 0;
|
|
4
|
+
exports.GET_LAST_WEEK_OPTION = exports.GET_NEXT_WEEK_OPTION = exports.GET_THIS_WEEK_OPTION = exports.GET_YESTERDAY_OPTION = exports.GET_TODAY_OPTION = exports.DateRange = exports.getLabel = exports.cutSeconds = exports.DateInput = exports.ControlledPopup = exports.deepClone = exports.deepMerge = exports.flattenArrays = exports.echo = exports.useThrottle = exports.useScroll = exports.useResize = exports.useMobile = exports.useGridSize = exports.useDeviceType = exports.useDebouncedMemo = exports.useDebounce = exports.SSRProvider = exports.DeviceType = exports.generateId = exports.hexToRGBA = exports.classNames = exports.getCheckboxState = exports.CheckboxState = exports.Checkbox = exports.resampleArrayEvenly = exports.removeTrendDataFromDatasets = exports.getFormattedLabel = exports.Chart = exports.AccessibleChartTable = exports.AccessibleChartNarrative = exports.simplifyData = exports.collectAllPoints = exports.AccessibleChart = exports.CardsRow = exports.Cards = exports.useAbsoluteSize = exports.isAbsoluteSize = exports.getSizeClass = exports.getContainerSize = exports.CardContainer = exports.useCardSizeState = exports.useCardSize = exports.getMaxNumberOfActions = exports.getIconFromStatus = void 0;
|
|
5
|
+
exports.getRangeOption = exports.FiltersBarDropdownWithCheckbox = exports.FiltersBarDateInput = exports.FiltersBarDateInputDisplayName = exports.useSearchData = exports.useFiltersSelection = exports.usePinnedFilters = exports.useFiltersSearch = exports.Filters = exports.FiltersDisplayName = exports.getAllOption = exports.getFiltersSearchTypeAllOption = exports.ALL_SELECT_OPTION_ID = exports.NOT_POPULATED_NAME = exports.KEYWORD_TYPE = exports.KEYWORD_ID = exports.NO_TYPED_SEARCH_ITEM = exports.FiltersRange = exports.FiltersGroups = exports.FiltersDropdown = exports.FiltersDateRange = exports.FiltersDateInput = exports.FiltersDateInputDisplayName = exports.FiltersChip = exports.FilterButton = exports.FileUpload = exports.FeedbackProvider = exports.FavoriteButton = exports.EmptyState = exports.useDropdownState = exports.Dropdown = exports.LIST_LIMIT = exports.Divider = exports.getFocusableStartInd = exports.isFocusable = exports.isElementInsideContainer = exports.Dialog = exports.GET_DEFAULT_DATE_OPTIONS = exports.GET_THIS_YEAR_OPTION = exports.GET_LAST_YEAR_OPTION = exports.GET_THIS_QUARTER_OPTION = exports.GET_LAST_QUARTER_OPTION = exports.GET_LAST_THREE_MONTH_OPTION = exports.GET_LAST_TWELVE_MONTHS_OPTION = exports.GET_YEAR_TO_DATE_OPTION = exports.GET_LAST_THIRTY_DAYS_OPTION = exports.GET_LAST_SEVEN_DAYS_OPTION = exports.GET_LAST_MONTH_OPTION = exports.GET_NEXT_MONTH_OPTION = exports.GET_THIS_MONTH_OPTION = void 0;
|
|
6
|
+
exports.getLayoutColumns = exports.CustomColumns = exports.Column = exports.FormGroupItem = exports.isTwoRowsStructure = exports.hasWidthProp = exports.getListClasses = exports.getLabelNode = exports.getOneLabelZeroControlsClasses = exports.getLabelListClasses = exports.getControlNode = exports.getZeroLabelsTwoControls = exports.getZeroLabelOneControlClasses = exports.getControlListClasses = exports.FormGroupProvider = exports.FormGroupContext = exports.applyCustomLabelClasses = exports.useToggleList = exports.useToggle = exports.useSectionType = exports.useMode = exports.useLabelAlign = exports.useElements = exports.getEmptyState = exports.useInitializeState = exports.useStateToElements = exports.useElementsState = exports.FormGroup = exports.ReviewListToggle = exports.ListToggle = exports.FormGroupToggle = exports.FormGroupList = exports.CustomRow = exports.useWidth = exports.useSkeleton = exports.useCounter = exports.FormField = exports.FormFieldSkeleton = exports.FormFieldBanner = exports.FooterButtons = exports.TriggerContextProvider = exports.TriggerContext = exports.FiltersBarActions = exports.FiltersBar = exports.FiltersBarDisplayName = exports.ResetButton = exports.PERIOD_THIRTY_DAYS_STEP_OPTION = exports.PERIOD_SEVEN_DAYS_STEP_OPTION = exports.PERIOD_ONE_DAY_STEP_OPTION = exports.isValidDateFn = void 0;
|
|
7
|
+
exports.Header = exports.HeaderType = exports.groupsFilterTotalStateDefault = exports.compareFilters = exports.toFilterState = exports.simplifyFilterState = exports.mergeItems = exports.getId = exports.mapFilterState = exports.isFilterState = exports.isEntireOrganization = exports.isIdEntity = exports.createLinkedTree = exports.getGroupDescription = exports.isSystemGroup = exports.makeBoolHash = exports.allSystemGroups = exports.defaultPrivateGroupId = exports.rootDefectGroups = exports.rootGroups = exports.rootSecurityGroups = exports.systemSecurityGroups = exports.getDefaultFilterState = exports.DEFAULT_RELATION_OPERATOR = exports.ENTIRE_ORGANIZATION_GROUP_ID = exports.RelationOperator = exports.FilterMenuStep = exports.GroupsFilter = exports.GroupButton = exports.removeSameTypeClasses = exports.convertClassesToState = exports.GridLayout = exports.getCurrentIndex = exports.FormStepperButtons = exports.useFormStepper = exports.FormStepper = exports.STEPPER_LAST_STEP = exports.FormSection = exports.getChildrenWithCustomColumns = exports.attachSeparators = exports.applySecondColumn = exports.applyGridPropsTwoColumns = exports.applyFirstColumn = exports.useLayoutColumns = exports.useFormButtons = exports.useColumns = exports.FormLayout = exports.TwoColumnsGrid = exports.OneColumnGrid = exports.LayoutColumn = void 0;
|
|
8
|
+
exports.IconBackward = exports.IconAutoSize = exports.IconAudio = exports.IconAttachmentFile = exports.IconAttachment2 = exports.IconAttachment = exports.IconAt = exports.IconArrowUpPath = exports.IconArrowTopRight = exports.IconArrowTopLeft = exports.IconArrowTopCircle = exports.IconArrowTop = exports.IconArrowRightPath = exports.IconArrowRightCircle = exports.IconArrowRight = exports.IconArrowLeftPath = exports.IconArrowLeftCircle = exports.IconArrowLeft = exports.IconArrowDownPath = exports.IconArrowBottomRight = exports.IconArrowBottomLeft = exports.IconArrowBottomCircle = exports.IconArrowBottom = exports.IconArchive2 = exports.IconArchive = exports.IconAnchor2 = exports.IconAnchor = exports.IconAlignmentRight = exports.IconAlignmentLeft = exports.IconAlignmentJustify = exports.IconAlignmentCenter = exports.IconAlignTopBox = exports.IconAlignRightBox = exports.IconAlignLeft = exports.IconAlignBottom = exports.IconAirpods = exports.IconAirplay = exports.IconAiSparkles2 = exports.IconAiSparkles = exports.IconAiImages = exports.IconAddPeople = exports.IconActivity = exports.useCustomMenu = exports.HeaderMenu = exports.HeaderMenuDisplayName = exports.HeaderButton = exports.HeaderButtonDisplayName = exports.HeaderBack = exports.HeaderBackDisplayName = exports.HeaderDisplayName = void 0;
|
|
9
|
+
exports.IconCalendar = exports.IconCalculator = exports.IconBusiness = exports.IconBulletList = exports.IconBulkSelect = exports.IconBuilding = exports.IconBucket = exports.IconBubbles = exports.IconBubbleNotification = exports.IconBubbleAnnotation6 = exports.IconBubbleAnnotation5 = exports.IconBubbleAnnotation4 = exports.IconBubbleAnnotation2 = exports.IconBubbleAnnotation = exports.IconBubble6 = exports.IconBubble5 = exports.IconBubble4 = exports.IconBubble3 = exports.IconBubble2 = exports.IconBubble = exports.IconBrush = exports.IconBrowser = exports.IconBrokenLink = exports.IconBranches = exports.IconBookmarkSelectedHover = exports.IconBookmarkPlus = exports.IconBookmarkFill = exports.IconBookmarkDelete = exports.IconBookmarkCheck = exports.IconBookmark = exports.IconBook2 = exports.IconBook = exports.IconBold = exports.IconBluetooth = exports.IconBitcoin = exports.IconBeta = exports.IconBell = exports.IconBatteryMedium = exports.IconBatteryLow2 = exports.IconBatteryLow = exports.IconBatteryLoading = exports.IconBatteryFull = exports.IconBatteryError = exports.IconBasket2 = exports.IconBasket = exports.IconBagLuggage2 = exports.IconBagLuggage = exports.IconBag2 = exports.IconBag = exports.IconBadge = void 0;
|
|
10
|
+
exports.IconCloudSync = exports.IconCloudQuestion = exports.IconCloudOff2 = exports.IconCloudOff = exports.IconCloudLines = exports.IconCloudDownload = exports.IconCloudCheck = exports.IconCloud2 = exports.IconCloud = exports.IconCloseSquare = exports.IconCloseCircle = exports.IconClose = exports.IconClockTimer = exports.IconClockSnooze = exports.IconClock2 = exports.IconClock = exports.IconClipboard2 = exports.IconClipboard = exports.IconCircle = exports.IconChromecast = exports.IconChevronTopSmall = exports.IconChevronTop = exports.IconChevronRightSmall = exports.IconChevronRight = exports.IconChevronLeftSmall = exports.IconChevronLeft = exports.IconChevronGrabberVertical = exports.IconChevronGrabberHorizontal = exports.IconChevronDownSmall = exports.IconChevronDoubleUp = exports.IconChevronDoubleRight = exports.IconChevronDoubleLeft = exports.IconChevronDoubleDown = exports.IconChevronBottom = exports.IconCheckbox = exports.IconCheckRadio = exports.IconCheck = exports.IconChart8 = exports.IconChart7 = exports.IconChart6 = exports.IconChart5 = exports.IconChart4 = exports.IconChart3 = exports.IconChart2 = exports.IconChart = exports.IconCanBus = exports.IconCameraAction = exports.IconCamera3 = exports.IconCamera2 = exports.IconCamera = void 0;
|
|
11
|
+
exports.IconDocumentWithLines = exports.IconDocument = exports.IconDock = exports.IconDispatchAsset = exports.IconDisk2 = exports.IconDisk = exports.IconDiamondWarning = exports.IconDeviceUptimeDisconnected = exports.IconDeviceUptime = exports.IconDelete3 = exports.IconDelete2 = exports.IconDelete = exports.IconCycle = exports.IconCursorClick = exports.IconCursorBox = exports.IconCursor3 = exports.IconCursor2 = exports.IconCursor = exports.IconCup = exports.IconCryptoCoin = exports.IconCrypto = exports.IconCrop = exports.IconCreditCard3 = exports.IconCreditCard2 = exports.IconCreditCard = exports.IconCornerUpRight = exports.IconCornerUpLeft = exports.IconCornerRightUp = exports.IconCornerRightDown = exports.IconCornerLeftUp = exports.IconCornerLeftDown = exports.IconCornerDownRight = exports.IconCornerDownLeft = exports.IconCopy5 = exports.IconCopy4 = exports.IconCopy3 = exports.IconCopy2 = exports.IconCopy = exports.IconConstruction = exports.IconConsole = exports.IconConnectDevices = exports.IconCompass = exports.IconCommunity = exports.IconColorPicker = exports.IconColor = exports.IconCode2 = exports.IconCode = exports.IconCmd2 = exports.IconCmd = exports.IconCloudUpload = void 0;
|
|
12
|
+
exports.IconFolderDownload = exports.IconFolderDelete = exports.IconFolderCloud2 = exports.IconFolderCloud = exports.IconFolderBookmarks = exports.IconFolderAdd = exports.IconFolder2 = exports.IconFolder = exports.IconFocus = exports.IconFingerPrint = exports.IconFilterDesc = exports.IconFilterAsc = exports.IconFilter3Desc = exports.IconFilter3Asc = exports.IconFilter3 = exports.IconFilter2 = exports.IconFilter = exports.IconFileSync5 = exports.IconFileSync4 = exports.IconFileSync3 = exports.IconFileSync2 = exports.IconFileSync = exports.IconFileLocked = exports.IconFileCopy = exports.IconFile = exports.IconFaceId = exports.IconEyeOff = exports.IconEye = exports.IconExpand = exports.IconException = exports.IconExcel = exports.IconEvse = exports.IconEuro = exports.IconEthereum = exports.IconEsc = exports.IconEmailNotification = exports.IconEmail2 = exports.IconEmail = exports.IconEditSmall = exports.IconEditBig = exports.IconEdit2 = exports.IconEdit = exports.IconDvir = exports.IconDriver = exports.IconDrive = exports.IconDownload = exports.IconDotVertical = exports.IconDotHorizontal = exports.IconDotGrid = exports.IconDollar = void 0;
|
|
13
|
+
exports.IconLayoutColumn = exports.IconLayoutBottom = exports.IconLayout = exports.IconLayers = exports.IconLaptop = exports.IconLab = exports.IconKeyboardUp2 = exports.IconKeyboardUp = exports.IconKeyboardDown = exports.IconKeyboard = exports.IconItalic = exports.IconInspect = exports.IconInfoSquare = exports.IconInfoCircle = exports.IconInbox = exports.IconImages2 = exports.IconImages = exports.IconImage = exports.IconImac = exports.IconIcon = exports.IconITS = exports.IconHourglass = exports.IconHomeSimple = exports.IconHomeRoof = exports.IconHomeDoor2 = exports.IconHomeDoor = exports.IconHistory = exports.IconHexonalWarning = exports.IconHeart = exports.IconHeadphones = exports.IconHarness = exports.IconGrids2 = exports.IconGrids = exports.IconGraphStatistics = exports.IconGraphPresentation = exports.IconGraphLines = exports.IconGraphChart = exports.IconGraph = exports.IconGrab = exports.IconGlobus = exports.IconGift = exports.IconGeotabSales = exports.IconGeotabDrive = exports.IconGamepad = exports.IconFuelGas = exports.IconFork = exports.IconFolders = exports.IconFolderUpload = exports.IconFolderShared = exports.IconFolderRestricted = void 0;
|
|
14
|
+
exports.IconMoon = exports.IconMoney = exports.IconMobi = exports.IconMinusSquare = exports.IconMinusCircle = exports.IconMinus = exports.IconMinimize = exports.IconMicrophone2 = exports.IconMicrophone = exports.IconMenuCircle = exports.IconMenu3 = exports.IconMenu2 = exports.IconMenu = exports.IconMemory2 = exports.IconMemory = exports.IconMedal = exports.IconMarketplace = exports.IconMap = exports.IconMagicEyes = exports.IconMagic2 = exports.IconMagic = exports.IconMacbook = exports.IconLowDataQuality = exports.IconLogout = exports.IconLogin = exports.IconLock = exports.IconLocationOff = exports.IconLocationMap = exports.IconLocationCompass = exports.IconLoader = exports.IconList = exports.IconLinkLines = exports.IconLink3 = exports.IconLink2 = exports.IconLink = exports.IconLightning = exports.IconLightBulb = exports.IconLifeBuoy = exports.IconLeaf = exports.IconLayoutWindow5 = exports.IconLayoutWindow4 = exports.IconLayoutWindow3 = exports.IconLayoutWindow2 = exports.IconLayoutWindow = exports.IconLayoutTopbar = exports.IconLayoutTop = exports.IconLayoutSidebar = exports.IconLayoutSearch = exports.IconLayoutRight = exports.IconLayoutLeft = void 0;
|
|
15
|
+
exports.IconPlusSquare = exports.IconPlusLines = exports.IconPlusFile = exports.IconPlusCircle = exports.IconPlus = exports.IconPlay = exports.IconPinLocation3 = exports.IconPinLocation2 = exports.IconPinLocation = exports.IconPin2 = exports.IconPin = exports.IconPhoneMobile = exports.IconPhone = exports.IconPerformance = exports.IconPercent = exports.IconPeopleLike = exports.IconPeopleGroup2 = exports.IconPeopleGroup = exports.IconPeople = exports.IconPencil2 = exports.IconPencil = exports.IconPause = exports.IconPassword = exports.IconPaperPlane = exports.IconPackage3 = exports.IconPackage2 = exports.IconPackage = exports.IconPDF = exports.IconOptAlt = exports.IconOpt = exports.IconOpen2 = exports.IconOpen = exports.IconOnDuty = exports.IconNumberedList = exports.IconNotifications = exports.IconNotificationOff = exports.IconNotificationBell = exports.IconNotificationAlarm = exports.IconNote = exports.IconNewspaper = exports.IconNews = exports.IconNavigationFooterExpanded = exports.IconNavigationFooterCollapsed = exports.IconMyGeotab = exports.IconMyAdmin = exports.IconMove2 = exports.IconMove = exports.IconMouseScrollUp = exports.IconMouseScrollDown = exports.IconMouse = void 0;
|
|
16
|
+
exports.IconSign = exports.IconSidebar = exports.IconShield4 = exports.IconShield3 = exports.IconShield2 = exports.IconShield = exports.IconShare3 = exports.IconShare = exports.IconSettings8 = exports.IconSettings7 = exports.IconSettings6 = exports.IconSettings4 = exports.IconSettings3 = exports.IconSettings2 = exports.IconSettings1 = exports.IconServer3 = exports.IconServer2 = exports.IconServer = exports.IconSend = exports.IconSecuredLines = exports.IconSecured = exports.IconSeatbelt = exports.IconSearchPage = exports.IconSearchLines = exports.IconSearchDocument = exports.IconSearch = exports.IconSdCard = exports.IconRuler = exports.IconRoute = exports.IconRotateRepeat2 = exports.IconRotateRepeat = exports.IconRotateCounterclockwise = exports.IconRotateClockwise = exports.IconResizeSmall = exports.IconResizeBig = exports.IconRepeat2 = exports.IconRepeat = exports.IconRemovePeople = exports.IconRefrigeration = exports.IconRedo2 = exports.IconRedo = exports.IconRecord = exports.IconReceipt = exports.IconRadar = exports.IconQuestion = exports.IconPuzzle = exports.IconPullRequest = exports.IconProcessor = exports.IconPrinter = exports.IconPound = void 0;
|
|
17
|
+
exports.IconVolumeOn = exports.IconVolumeOff = exports.IconVolumeMinimum = exports.IconVolumeHalf = exports.IconVolumeFull = exports.IconVolumeDown = exports.IconVoice = exports.IconVisitPage = exports.IconVideoReplay = exports.IconVideo2 = exports.IconVideo = exports.IconUsbHub = exports.IconUsb = exports.IconUpload = exports.IconUnlocked = exports.IconUndock = exports.IconUndo2 = exports.IconUndo = exports.IconUnderline = exports.IconUmbrella = exports.IconTrailer = exports.IconThumbsUp = exports.IconThumbsDown = exports.IconThermometer = exports.IconThermograph = exports.IconTextSize = exports.IconTelevision2 = exports.IconTelevision = exports.IconTarget3 = exports.IconTarget2 = exports.IconTarget = exports.IconTachographTimeCard = exports.IconTachograph = exports.IconTable = exports.IconSupport = exports.IconSun = exports.IconStrikeThrough = exports.IconStore = exports.IconStorage = exports.IconStopwatch = exports.IconStarFilled = exports.IconStarAi = exports.IconStar = exports.IconSquare = exports.IconSpeaker = exports.IconSortVertical = exports.IconSortHorizontal = exports.IconSort2Vertical = exports.IconSort2Horizontal = exports.IconSmiley = void 0;
|
|
18
|
+
exports.MiniTabs = exports.MiniTabsSize = exports.isLink = exports.isButton = exports.findPrevFocusable = exports.findNextFocusable = exports.findLastFocusable = exports.findFirstFocusable = exports.Menu = exports.ControlledMenu = exports.isDragNotClick = exports.changeOrder = exports.ListItem = exports.List = exports.ItemData = exports.ItemCompact = exports.LineChartMini = exports.getDefaultDatasetStyle = exports.htmlLegendPlugin = exports.LEGEND_PLUGIN_ID = exports.LineChart = exports.useLayoutSize = exports.LayoutFullScreenProvider = exports.useLayoutFullScreen = exports.LayoutFullScreenElementProvider = exports.useLayoutFullScreenElement = exports.Layout = exports.ImageTapToUpload = exports.ImageNothingFound = exports.ImageNoMatchingAssets = exports.ImageLooking = exports.ImageCloudUpload = exports.ImageAdjustFilter = exports.IconZoom2 = exports.IconZoom = exports.IconZone = exports.IconYen = exports.IconWrite = exports.IconWrench = exports.IconWorld = exports.IconWorkday = exports.IconWifi2 = exports.IconWifi = exports.IconWhisper = exports.IconWebcam = exports.IconWatch2 = exports.IconWatch = exports.IconWarning = exports.IconWallet1 = exports.IconWallet = void 0;
|
|
19
|
+
exports.NestedData = exports.TabBarContent = exports.TabBar = exports.SummaryTileBarDisplayName = exports.SummaryTileBar = exports.getTypeClassName = exports.SummaryTileTrigger = exports.SummaryTile = exports.SummaryTileDisplayName = exports.SummaryTileSize = exports.SummaryTileType = exports.Summary = exports.Summaries = exports.Stepper = exports.SortControl = exports.SortDirections = exports.Skeleton = exports.LazyContent = exports.SidePanel = exports.CUSTOM_POPUP_COMPONENT_CLASSNAME = exports.SidePanelCloseReason = exports.isChildPopup = exports.SelectField = exports.Select = exports.SearchInput = exports.Range = exports.RadioGroup = exports.Radio = exports.ProgressBar = exports.ProgreesBarSize = exports.ProgressBarType = exports.PrimaryIcon = exports.Popup = exports.PillExpandable = exports.Pill = exports.PaginationType = exports.Pagination = exports.PageLayout = exports.PageContentLayout = exports.PageHeaderMenu = exports.PageHeaderMenuDisplayName = exports.PageHeaderButton = exports.PageHeaderButtonDisplayName = exports.PageHeader = exports.PageHeaderDisplayName = exports.Notification = exports.getPredefinedFocusableItem = exports.DialogContentNew = exports.Modal = exports.MobileSheet = void 0;
|
|
20
|
+
exports.Waiting = exports.UserFormatProvider = exports.useDrive = exports.ThemeProvider = exports.ThemeDrive = exports.ThemeDark = exports.useLanguage = exports.useDirection = exports.injectString = exports.dictionaries = exports.LanguageProvider = exports.getFirstFocusableItem = exports.getNewFocusableItem = exports.HeaderButtonsProvider = exports.AbortablePromise = exports.Tooltip = exports.removeArrowClasses = exports.calculateArrowPosition = exports.ToggleButtonRaw = exports.ToggleButton = exports.Toast = exports.useToast = exports.TimePicker = exports.TextareaRaw = exports.Textarea = exports.TextInputRaw = exports.TextInput = exports.TextIconButton = exports.ButtonIconPosition = exports.Tabs = exports.TabsDisplayName = exports.ActionLinkColumn = exports.CheckboxColumn = exports.MainColumn = exports.ActionsColumn = exports.getSortableValue = exports.ColumnSortDirection = exports.getEmptySelection = exports.Table = exports.useNestedRows = void 0;
|
|
21
21
|
/* eslint-disable max-len */
|
|
22
22
|
var absolute_1 = require("./absolute/absolute");
|
|
23
23
|
Object.defineProperty(exports, "Absolute", { enumerable: true, get: function () { return absolute_1.Absolute; } });
|
|
@@ -88,6 +88,8 @@ var content_1 = require("./card/components/content");
|
|
|
88
88
|
Object.defineProperty(exports, "Content", { enumerable: true, get: function () { return content_1.Content; } });
|
|
89
89
|
var status_1 = require("./card/components/status");
|
|
90
90
|
Object.defineProperty(exports, "Status", { enumerable: true, get: function () { return status_1.Status; } });
|
|
91
|
+
var title_1 = require("./card/components/title");
|
|
92
|
+
Object.defineProperty(exports, "Title", { enumerable: true, get: function () { return title_1.Title; } });
|
|
91
93
|
var titleLink_1 = require("./card/components/titleLink");
|
|
92
94
|
Object.defineProperty(exports, "TitleLink", { enumerable: true, get: function () { return titleLink_1.TitleLink; } });
|
|
93
95
|
var getDefaultFullWidthValue_1 = require("./card/helpers/getDefaultFullWidthValue");
|
|
@@ -1629,8 +1631,6 @@ var textareaRaw_1 = require("./textareaRaw/textareaRaw");
|
|
|
1629
1631
|
Object.defineProperty(exports, "TextareaRaw", { enumerable: true, get: function () { return textareaRaw_1.TextareaRaw; } });
|
|
1630
1632
|
var timePicker_1 = require("./timePicker/timePicker");
|
|
1631
1633
|
Object.defineProperty(exports, "TimePicker", { enumerable: true, get: function () { return timePicker_1.TimePicker; } });
|
|
1632
|
-
var title_1 = require("./title/title");
|
|
1633
|
-
Object.defineProperty(exports, "Title", { enumerable: true, get: function () { return title_1.Title; } });
|
|
1634
1634
|
var useToast_1 = require("./toast/hooks/useToast");
|
|
1635
1635
|
Object.defineProperty(exports, "useToast", { enumerable: true, get: function () { return useToast_1.useToast; } });
|
|
1636
1636
|
var toast_1 = require("./toast/toast");
|
|
@@ -1659,6 +1659,8 @@ Object.defineProperty(exports, "dictionaries", { enumerable: true, get: function
|
|
|
1659
1659
|
Object.defineProperty(exports, "injectString", { enumerable: true, get: function () { return translationsDictionary_1.injectString; } });
|
|
1660
1660
|
var useDirection_1 = require("./utils/localization/useDirection");
|
|
1661
1661
|
Object.defineProperty(exports, "useDirection", { enumerable: true, get: function () { return useDirection_1.useDirection; } });
|
|
1662
|
+
var useLanguage_1 = require("./utils/localization/useLanguage");
|
|
1663
|
+
Object.defineProperty(exports, "useLanguage", { enumerable: true, get: function () { return useLanguage_1.useLanguage; } });
|
|
1662
1664
|
var themeDark_1 = require("./utils/theme/themeDark");
|
|
1663
1665
|
Object.defineProperty(exports, "ThemeDark", { enumerable: true, get: function () { return themeDark_1.ThemeDark; } });
|
|
1664
1666
|
var themeDrive_1 = require("./utils/theme/themeDrive");
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ReactElement, ReactNode, RefObject } from "react";
|
|
2
|
-
export declare const useTableChildren: (children: ReactNode, isMobile: boolean, selected: number, allSelected: boolean, clearSelection: () => void, activeId?: string, gridRef?: RefObject<HTMLElement | null>, onCloseDetailPanel?: () => void) => {
|
|
2
|
+
export declare const useTableChildren: (children: ReactNode, isMobile: boolean, selected: number, allSelected: boolean, clearSelection: () => void, selectAll: () => void, turnOffSelectAll?: boolean, activeId?: string, gridRef?: RefObject<HTMLElement | null>, onCloseDetailPanel?: () => void) => {
|
|
3
3
|
bulkActions: ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | undefined;
|
|
4
4
|
pagination: ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | undefined;
|
|
5
5
|
activePage: number | undefined;
|
|
@@ -27,7 +27,7 @@ const isChildElement = function (child, expectedType) {
|
|
|
27
27
|
}
|
|
28
28
|
return false;
|
|
29
29
|
};
|
|
30
|
-
const useTableChildren = (children, isMobile, selected, allSelected, clearSelection, activeId, gridRef, onCloseDetailPanel) => (0, react_1.useMemo)(() => {
|
|
30
|
+
const useTableChildren = (children, isMobile, selected, allSelected, clearSelection, selectAll, turnOffSelectAll, activeId, gridRef, onCloseDetailPanel) => (0, react_1.useMemo)(() => {
|
|
31
31
|
let bulkActions = undefined;
|
|
32
32
|
let tablePagination = undefined;
|
|
33
33
|
let activePage = undefined;
|
|
@@ -42,7 +42,7 @@ const useTableChildren = (children, isMobile, selected, allSelected, clearSelect
|
|
|
42
42
|
}
|
|
43
43
|
if (isChildElement(child, tableBulkActions_1.TableBulkActions.displayName)) {
|
|
44
44
|
const bulkActionButtons = child.props.children || [];
|
|
45
|
-
bulkActions = ((0, jsx_runtime_1.jsx)(bulkActions_1.BulkActions, { gridType: isMobile ? deviceType_1.DeviceType.Mobile : deviceType_1.DeviceType.Desktop, selected: selected, allSelected: allSelected, onClearSelection: clearSelection, children: bulkActionButtons }));
|
|
45
|
+
bulkActions = ((0, jsx_runtime_1.jsx)(bulkActions_1.BulkActions, { gridType: isMobile ? deviceType_1.DeviceType.Mobile : deviceType_1.DeviceType.Desktop, selected: selected, allSelected: allSelected, onClearSelection: clearSelection, onSelectAll: selectAll, turnOffSelectAll: turnOffSelectAll, children: bulkActionButtons }));
|
|
46
46
|
return;
|
|
47
47
|
}
|
|
48
48
|
if (isChildElement(child, tablePagination_1.TablePagination.displayName)) {
|
|
@@ -103,5 +103,5 @@ const useTableChildren = (children, isMobile, selected, allSelected, clearSelect
|
|
|
103
103
|
detailPanel: detailPanel,
|
|
104
104
|
other: other
|
|
105
105
|
};
|
|
106
|
-
}, [children, clearSelection, isMobile, selected, gridRef, allSelected, activeId, onCloseDetailPanel]);
|
|
106
|
+
}, [children, clearSelection, isMobile, selected, gridRef, allSelected, selectAll, turnOffSelectAll, activeId, onCloseDetailPanel]);
|
|
107
107
|
exports.useTableChildren = useTableChildren;
|
|
@@ -16,14 +16,6 @@ export interface ISelectableRowsOptions<T extends IRowEntity<N>, N extends IEnti
|
|
|
16
16
|
checkboxTitle?: (entity: T | N) => string;
|
|
17
17
|
headerTitle?: (state: SelectionState) => string;
|
|
18
18
|
turnOffSelectAll?: boolean;
|
|
19
|
-
/**
|
|
20
|
-
* When `true`, the header checkbox emits the current page's IDs instead of `{ all: true }`.
|
|
21
|
-
* When `undefined`, falls back to `turnOffSelectAll` for backward compatibility.
|
|
22
|
-
*
|
|
23
|
-
* Note: avoid setting this to `false` alongside `turnOffSelectAll: true` — the checkbox
|
|
24
|
-
* will emit `{ all: true }` while the dropdown hides the "Select all" option, which is inconsistent.
|
|
25
|
-
*/
|
|
26
|
-
checkboxSelectsCurrentPage?: boolean;
|
|
27
19
|
checkboxPlaceholder?: boolean;
|
|
28
20
|
strategy?: TSelectionStrategy;
|
|
29
21
|
selectAll?: boolean;
|
|
@@ -166,6 +166,7 @@ const useSelectableRows = (columns, entities, isMobile, selectMode, setSelectMod
|
|
|
166
166
|
return;
|
|
167
167
|
}
|
|
168
168
|
const newSelections = (0, getCurrentPageSelection_1.getCurrentPageSelection)(entities, selectable);
|
|
169
|
+
setState(newState);
|
|
169
170
|
const newValue = {
|
|
170
171
|
selected: [...newSelections],
|
|
171
172
|
all: false
|
|
@@ -184,16 +185,8 @@ const useSelectableRows = (columns, entities, isMobile, selectMode, setSelectMod
|
|
|
184
185
|
return translate("Deselect all");
|
|
185
186
|
}, [selectable, selectableState, state, translate]);
|
|
186
187
|
const isEntityChecked = (0, react_1.useCallback)((entity, isNested) => (0, isRowChecked_1.isRowChecked)(selections, state, selectable === null || selectable === void 0 ? void 0 : selectable.strategy, entity, isNested), [selections, state, selectable === null || selectable === void 0 ? void 0 : selectable.strategy]);
|
|
187
|
-
const hasSelectable = !!selectable;
|
|
188
|
-
const selectableCheckboxSelectsCurrentPage = selectable === null || selectable === void 0 ? void 0 : selectable.checkboxSelectsCurrentPage;
|
|
189
|
-
const selectableTurnOffSelectAll = selectable === null || selectable === void 0 ? void 0 : selectable.turnOffSelectAll;
|
|
190
|
-
const selectableCheckboxInHeader = selectable === null || selectable === void 0 ? void 0 : selectable.checkboxInHeader;
|
|
191
|
-
const selectableSelectionLimit = selectable === null || selectable === void 0 ? void 0 : selectable.selectionLimit;
|
|
192
|
-
const selectableHeader = selectable === null || selectable === void 0 ? void 0 : selectable.header;
|
|
193
|
-
const checkboxEmitsCurrentPage = selectableCheckboxSelectsCurrentPage !== null && selectableCheckboxSelectsCurrentPage !== void 0 ? selectableCheckboxSelectsCurrentPage : selectableTurnOffSelectAll;
|
|
194
|
-
const checkboxInHeaderValue = selectableCheckboxInHeader !== undefined ? selectableCheckboxInHeader : selectableSelectionLimit !== undefined ? false : undefined;
|
|
195
188
|
const wrapper = (0, react_1.useMemo)(() => {
|
|
196
|
-
if (!
|
|
189
|
+
if (!selectable) {
|
|
197
190
|
return null;
|
|
198
191
|
}
|
|
199
192
|
return {
|
|
@@ -235,23 +228,23 @@ const useSelectableRows = (columns, entities, isMobile, selectMode, setSelectMod
|
|
|
235
228
|
checked: state === interfaces_1.SelectionState.CurrentPage || state === interfaces_1.SelectionState.All,
|
|
236
229
|
indeterminate: state === interfaces_1.SelectionState.Partial,
|
|
237
230
|
onChange: newValue => {
|
|
238
|
-
const newState = newValue ?
|
|
231
|
+
const newState = newValue ? selectable.turnOffSelectAll ? interfaces_1.SelectionState.CurrentPage : interfaces_1.SelectionState.All : interfaces_1.SelectionState.None;
|
|
239
232
|
setState(newState);
|
|
240
233
|
onChangeSelectionState(newState);
|
|
241
234
|
},
|
|
242
235
|
calculateSelectionState: () => selectableState,
|
|
243
|
-
checkboxInHeader:
|
|
244
|
-
header:
|
|
236
|
+
checkboxInHeader: selectable.checkboxInHeader !== undefined ? selectable.checkboxInHeader : selectable.selectionLimit !== undefined ? false : undefined,
|
|
237
|
+
header: selectable.header,
|
|
245
238
|
onSelect: newState => {
|
|
246
239
|
setState(newState);
|
|
247
240
|
onChangeSelectionState(newState);
|
|
248
241
|
},
|
|
249
|
-
turnOffSelectAll:
|
|
242
|
+
turnOffSelectAll: selectable.turnOffSelectAll
|
|
250
243
|
});
|
|
251
244
|
return cell;
|
|
252
245
|
}
|
|
253
246
|
};
|
|
254
|
-
}, [checkboxDisabled, checkboxTitle, checkboxVisible, headerTitle, onChangeSelectionState, onSelectListener,
|
|
247
|
+
}, [checkboxDisabled, checkboxTitle, checkboxVisible, headerTitle, onChangeSelectionState, onSelectListener, selectable, selectableState, state, isMobile, checkboxPlaceholder, isEntityChecked]);
|
|
255
248
|
const selectableFeedWrapper = (0, react_1.useCallback)((primaryData, secondaryData, entity, isNested) => {
|
|
256
249
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
257
250
|
if (!entity) {
|
package/dist/table/table.js
CHANGED
|
@@ -225,6 +225,12 @@ const TableInner = ({
|
|
|
225
225
|
selected: []
|
|
226
226
|
});
|
|
227
227
|
}, [selectable]);
|
|
228
|
+
const selectAll = (0, react_1.useCallback)(() => {
|
|
229
|
+
selectable === null || selectable === void 0 ? void 0 : selectable.onSelect({
|
|
230
|
+
all: true,
|
|
231
|
+
selected: []
|
|
232
|
+
});
|
|
233
|
+
}, [selectable]);
|
|
228
234
|
const [activeIdInternal, setActiveInternal] = (0, react_1.useState)(undefined);
|
|
229
235
|
const activeId = active !== undefined ? active : activeIdInternal;
|
|
230
236
|
const onClickInternal = (0, react_1.useCallback)(id => setActiveInternal(id === activeIdInternal ? undefined : id), [activeIdInternal, setActiveInternal]);
|
|
@@ -241,7 +247,7 @@ const TableInner = ({
|
|
|
241
247
|
detailPanel,
|
|
242
248
|
footer,
|
|
243
249
|
other
|
|
244
|
-
} = (0, useTableChildren_1.useTableChildren)(children, isMobile, selectionQty, ((_c = selectable === null || selectable === void 0 ? void 0 : selectable.selection) === null || _c === void 0 ? void 0 : _c.all) || false, clearSelection, activeId, gridRef, onCloseDetailPanel);
|
|
250
|
+
} = (0, useTableChildren_1.useTableChildren)(children, isMobile, selectionQty, ((_c = selectable === null || selectable === void 0 ? void 0 : selectable.selection) === null || _c === void 0 ? void 0 : _c.all) || false, clearSelection, selectAll, selectable === null || selectable === void 0 ? void 0 : selectable.turnOffSelectAll, activeId, gridRef, onCloseDetailPanel);
|
|
245
251
|
const hasDetailPanel = !!detailPanel;
|
|
246
252
|
const shouldEnableRowClick = hasDetailPanel || !!onClick;
|
|
247
253
|
const activeIdForRow = shouldEnableRowClick ? activeId : undefined;
|
package/esm/card/card.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { FC, FunctionComponent, ReactNode } from "react";
|
|
2
2
|
import { IAbsoluteSize, TContainerSize } from "../cardContainer/cardContainer";
|
|
3
3
|
import { TCardStatus } from "./components/status";
|
|
4
|
-
import { TIconType } from "
|
|
4
|
+
import { TIconType } from "./components/title";
|
|
5
5
|
import { IActions } from "./components/actions";
|
|
6
6
|
import { IContent } from "./components/content";
|
|
7
7
|
import "./card.less";
|
package/esm/card/card.js
CHANGED
|
@@ -5,7 +5,7 @@ import { CardContainer } from "../cardContainer/cardContainer";
|
|
|
5
5
|
import { DeviceType } from "../commonHelpers/hooks/deviceType";
|
|
6
6
|
import { useDeviceType } from "../commonHelpers/hooks/useDeviceType";
|
|
7
7
|
import { Status } from "./components/status";
|
|
8
|
-
import { Title } from "
|
|
8
|
+
import { Title } from "./components/title";
|
|
9
9
|
import { Actions } from "./components/actions";
|
|
10
10
|
import { Content } from "./components/content";
|
|
11
11
|
import { useCardSize } from "./hooks/useCardSize";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FunctionComponent } from "react";
|
|
2
2
|
import "./title.less";
|
|
3
|
-
import { IIcon } from "
|
|
3
|
+
import { IIcon } from "../../icons/icon";
|
|
4
4
|
export type TIconType = "info" | "warning" | "error" | "success" | "default";
|
|
5
5
|
interface ITitle {
|
|
6
6
|
isMobile: boolean;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { createElement, useMemo } from "react";
|
|
3
|
+
import { classNames } from "../../commonHelpers/classNames/classNames";
|
|
4
|
+
import { useDriveClassName } from "../../utils/theme/useDriveClassName";
|
|
5
|
+
import { useDrive } from "../../utils/theme/useDrive";
|
|
6
|
+
import { IconChevronRightSmall } from "../../icons/iconChevronRightSmall";
|
|
7
|
+
export const Title = ({ isMobile, link, target, title, id, icon, iconType, className = "", onClick }) => {
|
|
8
|
+
const driveClassNames = useDriveClassName("zen-card-title");
|
|
9
|
+
const isDrive = useDrive();
|
|
10
|
+
const iconClassName = iconType ? `zen-card-title__icon--${iconType}` : "";
|
|
11
|
+
const iconSize = useMemo(() => (isDrive ? "huge" : "large"), [isDrive]);
|
|
12
|
+
const iconElement = useMemo(() => (icon ? _jsx("div", { className: classNames(["zen-card-title__icon", iconClassName]), children: createElement(icon, { size: iconSize }) }) : null), [icon, iconSize, iconClassName]);
|
|
13
|
+
const chevron = useMemo(() => (_jsx("span", { className: "zen-card-title__link-chevron", children: _jsx(IconChevronRightSmall, { size: iconSize, className: "zen-card-title__chevron-icon" }) })), [iconSize]);
|
|
14
|
+
const titleClasses = classNames(["zen-card-title", driveClassNames || "", onClick ? "zen-card-title__clickable" : ""]);
|
|
15
|
+
if (onClick) {
|
|
16
|
+
return (_jsxs("button", { type: "button", className: titleClasses, onClick: onClick, children: [iconElement, _jsxs("span", { title: title, id: id, className: classNames(["zen-card-title__text", isMobile && !isDrive ? "zen-card-title__text--mobile" : "", className]), children: [title, chevron] })] }));
|
|
17
|
+
}
|
|
18
|
+
if (link) {
|
|
19
|
+
return (_jsxs("a", { id: id, className: titleClasses, href: link, target: target, children: [iconElement, _jsxs("span", { title: title, className: classNames(["zen-card-title__link-text"]), children: [title, chevron] })] }));
|
|
20
|
+
}
|
|
21
|
+
return (_jsxs("div", { className: titleClasses, children: [iconElement, _jsx("span", { title: title, id: id, className: classNames(["zen-card-title__text", isMobile && !isDrive ? "zen-card-title__text--mobile" : "", className]), children: title })] }));
|
|
22
|
+
};
|
|
@@ -7,21 +7,19 @@ import { DeviceType } from "../../../../commonHelpers/hooks/deviceType";
|
|
|
7
7
|
type TBulkAction = IBulkActionLink | IBulkActionButton;
|
|
8
8
|
export interface IBulkActionsProps extends IZenComponentProps {
|
|
9
9
|
selected: number;
|
|
10
|
-
/**
|
|
11
|
-
* When `true`, displays "All selected" instead of a count, and enables action buttons
|
|
12
|
-
* even when `selected` is 0 (i.e., cross-page "select all" is active).
|
|
13
|
-
*/
|
|
14
10
|
allSelected?: boolean;
|
|
15
11
|
onClearSelection: () => void;
|
|
12
|
+
onSelectAll?: () => void;
|
|
16
13
|
gridType?: DeviceType;
|
|
17
14
|
children?: ReactElement<TBulkAction> | null | (ReactElement<TBulkAction> | null)[];
|
|
15
|
+
turnOffSelectAll?: boolean;
|
|
18
16
|
}
|
|
19
17
|
export interface IBulkActions extends IBulkActionsProps {
|
|
20
18
|
ActionLink: (props: IBulkActionLink) => ReactNode;
|
|
21
19
|
ActionButton: (props: IBulkActionButton) => ReactNode;
|
|
22
20
|
}
|
|
23
21
|
export declare const BulkActions: {
|
|
24
|
-
({ selected, allSelected, className, onClearSelection, gridType, children }: IBulkActionsProps): import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
({ selected, allSelected, className, onClearSelection, onSelectAll, gridType, children, turnOffSelectAll }: IBulkActionsProps): import("react/jsx-runtime").JSX.Element;
|
|
25
23
|
ActionLink: ({ title, icon, link, disabled, type, ref }: IBulkActionLink) => import("react/jsx-runtime").JSX.Element;
|
|
26
24
|
ActionButton: ({ title, icon, clickHandler, onClick, disabled, type, ref }: IBulkActionButton) => import("react/jsx-runtime").JSX.Element;
|
|
27
25
|
translations: string[];
|
|
@@ -12,6 +12,7 @@ import { useNonFittingElements } from "../../../../header/hooks/useNonFittingEle
|
|
|
12
12
|
import { useResizeObserver } from "../../../../commonHelpers/hooks/useResizeObserver";
|
|
13
13
|
import { Menu } from "../../../../menu/menu";
|
|
14
14
|
import { IconDotVertical } from "../../../../icons/iconDotVertical";
|
|
15
|
+
import { Button } from "../../../../button/button";
|
|
15
16
|
injectString("cs", "{1} selected", "{1} vybran\xFD/vybran\xE9");
|
|
16
17
|
injectString("da-DK", "{1} selected", "{1} valgt");
|
|
17
18
|
injectString("de", "{1} selected", "{1} ausgew\xE4hlt");
|
|
@@ -93,6 +94,33 @@ injectString("zh-Hans", "Clear selection", "\u6E05\u9664\u9009\u62E9");
|
|
|
93
94
|
injectString("zh-TW", "Clear selection", "\u6E05\u9664\u9078\u53D6\u9805\u76EE");
|
|
94
95
|
injectString("ro-RO", "Clear selection", "\u0218terge\u021Bi selec\u021Bia");
|
|
95
96
|
injectString("ar-SA", "Clear selection", "\u0645\u0633\u062D \u0627\u0644\u062A\u062D\u062F\u064A\u062F");
|
|
97
|
+
injectString("cs", "Select all", "Vybrat v\u0161e");
|
|
98
|
+
injectString("da-DK", "Select all", "V\xE6lg alle");
|
|
99
|
+
injectString("de", "Select all", "Alle ausw\xE4hlen");
|
|
100
|
+
injectString("en", "Select all", "Select all");
|
|
101
|
+
injectString("es", "Select all", "Seleccionar todo");
|
|
102
|
+
injectString("fi-FI", "Select all", "Valitse kaikki");
|
|
103
|
+
injectString("fr", "Select all", "S\xE9lectionner tout");
|
|
104
|
+
injectString("fr-FR", "Select all", "S\xE9lectionner tout");
|
|
105
|
+
injectString("hu-HU", "Select all", "V\xE1laszd ki az \xF6sszeset.");
|
|
106
|
+
injectString("id", "Select all", "Pilih semua");
|
|
107
|
+
injectString("it", "Select all", "Selezionare tutto");
|
|
108
|
+
injectString("ja", "Select all", "\u3059\u3079\u3066\u9078\u629E");
|
|
109
|
+
injectString("ko-KR", "Select all", "\uBAA8\uB450 \uC120\uD0DD");
|
|
110
|
+
injectString("ms", "Select all", "Pilih semua");
|
|
111
|
+
injectString("nb-NO", "Select all", "Velg alle");
|
|
112
|
+
injectString("nl", "Select all", "Alles selecteren");
|
|
113
|
+
injectString("pl", "Select all", "Wybierz wszystko");
|
|
114
|
+
injectString("pt-BR", "Select all", "Selecionar tudo");
|
|
115
|
+
injectString("pt-PT", "Select all", "Selecionar tudo");
|
|
116
|
+
injectString("sk-SK", "Select all", "Vyber v\u0161etko.");
|
|
117
|
+
injectString("sv", "Select all", "V\xE4lj alla");
|
|
118
|
+
injectString("th", "Select all", "\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E17\u0E31\u0E49\u0E07\u0E2B\u0E21\u0E14");
|
|
119
|
+
injectString("tr", "Select all", "T\xFCm\xFCn\xFC se\xE7");
|
|
120
|
+
injectString("zh-Hans", "Select all", "\u5168\u9009");
|
|
121
|
+
injectString("zh-TW", "Select all", "\u5168\u9078");
|
|
122
|
+
injectString("ro-RO", "Select all", "Selecta\u021Bi tot");
|
|
123
|
+
injectString("ar-SA", "Select all", "\u062A\u062D\u062F\u064A\u062F \u0627\u0644\u0643\u0644");
|
|
96
124
|
injectString("cs", "More", "V\xEDce");
|
|
97
125
|
injectString("da-DK", "More", "Mere");
|
|
98
126
|
injectString("de", "More", "Mehr");
|
|
@@ -125,8 +153,10 @@ export const BulkActions = ({
|
|
|
125
153
|
allSelected,
|
|
126
154
|
className,
|
|
127
155
|
onClearSelection,
|
|
156
|
+
onSelectAll,
|
|
128
157
|
gridType = DeviceType.Desktop,
|
|
129
|
-
children
|
|
158
|
+
children,
|
|
159
|
+
turnOffSelectAll
|
|
130
160
|
}) => {
|
|
131
161
|
var _a;
|
|
132
162
|
const {
|
|
@@ -170,7 +200,13 @@ export const BulkActions = ({
|
|
|
170
200
|
}), _jsx("span", {
|
|
171
201
|
className: "zen-bulk-actions__number-of-selected ellipsis",
|
|
172
202
|
children: text
|
|
173
|
-
}),
|
|
203
|
+
}), onSelectAll && !turnOffSelectAll ? _jsx(Button, {
|
|
204
|
+
type: "tertiary",
|
|
205
|
+
className: "zen-bulk-actions__select-all",
|
|
206
|
+
disabled: allSelected,
|
|
207
|
+
onClick: onSelectAll,
|
|
208
|
+
children: translate("Select all")
|
|
209
|
+
}) : null, _jsxs("div", {
|
|
174
210
|
className: "zen-bulk-actions__action-button-holder",
|
|
175
211
|
ref: buttonHolder,
|
|
176
212
|
children: [Children.map(visibleElements, element => cloneElement(element, {
|
|
@@ -108,12 +108,15 @@ export const DateInputInnerControlBlock = props => {
|
|
|
108
108
|
value: timePickerValue,
|
|
109
109
|
onChange: timeChangeHandler,
|
|
110
110
|
isMobileView: isMobileView,
|
|
111
|
-
fullWidth: true
|
|
111
|
+
fullWidth: true,
|
|
112
|
+
// eslint-disable-next-line
|
|
113
|
+
// @ts-ignore
|
|
114
|
+
dataTimeId: id
|
|
112
115
|
}), isHasTimeError ? _jsx(FormFieldError, {
|
|
113
116
|
id: timeErrorId,
|
|
114
117
|
error: translate("The time must be set")
|
|
115
118
|
}) : null]
|
|
116
|
-
}) : null, [isActiveField, isHasTimeError,
|
|
119
|
+
}) : null, [selectTime, isActiveField, isHasTimeError, timePickerValue, timeChangeHandler, isMobileView, id, timeErrorId, translate]);
|
|
117
120
|
return _jsxs("div", {
|
|
118
121
|
className: classNames(["zen-date-input-inner__control-block", className || ""]),
|
|
119
122
|
children: [title ? _jsx("label", {
|
package/esm/index.d.ts
CHANGED
|
@@ -20,6 +20,7 @@ export { type ICardButton, CardButton } from "./card/components/cardButton/cardB
|
|
|
20
20
|
export { type ICardToggle, CardToggle } from "./card/components/cardToggle/cardToggle";
|
|
21
21
|
export { type IContent, Content } from "./card/components/content";
|
|
22
22
|
export { type TCardStatus, Status } from "./card/components/status";
|
|
23
|
+
export { Title } from "./card/components/title";
|
|
23
24
|
export { TitleLink } from "./card/components/titleLink";
|
|
24
25
|
export { getDefaultFullWidthValue } from "./card/helpers/getDefaultFullWidthValue";
|
|
25
26
|
export { getIconFromStatus } from "./card/helpers/getIconFromStatus";
|
|
@@ -757,7 +758,6 @@ export { type ITextInputRaw, TextInputRaw } from "./textInputRaw/textInputRaw";
|
|
|
757
758
|
export { type ITextarea, Textarea } from "./textarea/textarea";
|
|
758
759
|
export { type ITextareaRaw, TextareaRaw } from "./textareaRaw/textareaRaw";
|
|
759
760
|
export { type ITimePicker, type TTimePicker, TimePicker } from "./timePicker/timePicker";
|
|
760
|
-
export { Title } from "./title/title";
|
|
761
761
|
export { type IShowToast, useToast } from "./toast/hooks/useToast";
|
|
762
762
|
export { type IToast, Toast } from "./toast/toast";
|
|
763
763
|
export { type IToggleButton, type TToggleButton, ToggleButton } from "./toggleButton/toggleButton";
|
|
@@ -772,6 +772,7 @@ export { getNewFocusableItem, getFirstFocusableItem } from "./utils/keyboardHelp
|
|
|
772
772
|
export { LanguageProvider } from "./utils/localization/languageProvider";
|
|
773
773
|
export { dictionaries, injectString } from "./utils/localization/translationsDictionary";
|
|
774
774
|
export { useDirection } from "./utils/localization/useDirection";
|
|
775
|
+
export { useLanguage } from "./utils/localization/useLanguage";
|
|
775
776
|
export { ThemeDark } from "./utils/theme/themeDark";
|
|
776
777
|
export { ThemeDrive } from "./utils/theme/themeDrive";
|
|
777
778
|
export { ThemeProvider } from "./utils/theme/themeProvider";
|
package/esm/index.js
CHANGED
|
@@ -21,6 +21,7 @@ export { CardButton } from "./card/components/cardButton/cardButton";
|
|
|
21
21
|
export { CardToggle } from "./card/components/cardToggle/cardToggle";
|
|
22
22
|
export { Content } from "./card/components/content";
|
|
23
23
|
export { Status } from "./card/components/status";
|
|
24
|
+
export { Title } from "./card/components/title";
|
|
24
25
|
export { TitleLink } from "./card/components/titleLink";
|
|
25
26
|
export { getDefaultFullWidthValue } from "./card/helpers/getDefaultFullWidthValue";
|
|
26
27
|
export { getIconFromStatus } from "./card/helpers/getIconFromStatus";
|
|
@@ -742,7 +743,6 @@ export { TextInputRaw } from "./textInputRaw/textInputRaw";
|
|
|
742
743
|
export { Textarea } from "./textarea/textarea";
|
|
743
744
|
export { TextareaRaw } from "./textareaRaw/textareaRaw";
|
|
744
745
|
export { TimePicker } from "./timePicker/timePicker";
|
|
745
|
-
export { Title } from "./title/title";
|
|
746
746
|
export { useToast } from "./toast/hooks/useToast";
|
|
747
747
|
export { Toast } from "./toast/toast";
|
|
748
748
|
export { ToggleButton } from "./toggleButton/toggleButton";
|
|
@@ -756,6 +756,7 @@ export { getNewFocusableItem, getFirstFocusableItem } from "./utils/keyboardHelp
|
|
|
756
756
|
export { LanguageProvider } from "./utils/localization/languageProvider";
|
|
757
757
|
export { dictionaries, injectString } from "./utils/localization/translationsDictionary";
|
|
758
758
|
export { useDirection } from "./utils/localization/useDirection";
|
|
759
|
+
export { useLanguage } from "./utils/localization/useLanguage";
|
|
759
760
|
export { ThemeDark } from "./utils/theme/themeDark";
|
|
760
761
|
export { ThemeDrive } from "./utils/theme/themeDrive";
|
|
761
762
|
export { ThemeProvider } from "./utils/theme/themeProvider";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ReactElement, ReactNode, RefObject } from "react";
|
|
2
|
-
export declare const useTableChildren: (children: ReactNode, isMobile: boolean, selected: number, allSelected: boolean, clearSelection: () => void, activeId?: string, gridRef?: RefObject<HTMLElement | null>, onCloseDetailPanel?: () => void) => {
|
|
2
|
+
export declare const useTableChildren: (children: ReactNode, isMobile: boolean, selected: number, allSelected: boolean, clearSelection: () => void, selectAll: () => void, turnOffSelectAll?: boolean, activeId?: string, gridRef?: RefObject<HTMLElement | null>, onCloseDetailPanel?: () => void) => {
|
|
3
3
|
bulkActions: ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | undefined;
|
|
4
4
|
pagination: ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | undefined;
|
|
5
5
|
activePage: number | undefined;
|
|
@@ -24,7 +24,7 @@ const isChildElement = function (child, expectedType) {
|
|
|
24
24
|
}
|
|
25
25
|
return false;
|
|
26
26
|
};
|
|
27
|
-
export const useTableChildren = (children, isMobile, selected, allSelected, clearSelection, activeId, gridRef, onCloseDetailPanel) => useMemo(() => {
|
|
27
|
+
export const useTableChildren = (children, isMobile, selected, allSelected, clearSelection, selectAll, turnOffSelectAll, activeId, gridRef, onCloseDetailPanel) => useMemo(() => {
|
|
28
28
|
let bulkActions = undefined;
|
|
29
29
|
let tablePagination = undefined;
|
|
30
30
|
let activePage = undefined;
|
|
@@ -39,7 +39,7 @@ export const useTableChildren = (children, isMobile, selected, allSelected, clea
|
|
|
39
39
|
}
|
|
40
40
|
if (isChildElement(child, TableBulkActions.displayName)) {
|
|
41
41
|
const bulkActionButtons = child.props.children || [];
|
|
42
|
-
bulkActions = (_jsx(BulkActions, { gridType: isMobile ? DeviceType.Mobile : DeviceType.Desktop, selected: selected, allSelected: allSelected, onClearSelection: clearSelection, children: bulkActionButtons }));
|
|
42
|
+
bulkActions = (_jsx(BulkActions, { gridType: isMobile ? DeviceType.Mobile : DeviceType.Desktop, selected: selected, allSelected: allSelected, onClearSelection: clearSelection, onSelectAll: selectAll, turnOffSelectAll: turnOffSelectAll, children: bulkActionButtons }));
|
|
43
43
|
return;
|
|
44
44
|
}
|
|
45
45
|
if (isChildElement(child, TablePagination.displayName)) {
|
|
@@ -100,4 +100,4 @@ export const useTableChildren = (children, isMobile, selected, allSelected, clea
|
|
|
100
100
|
detailPanel: detailPanel,
|
|
101
101
|
other: other
|
|
102
102
|
};
|
|
103
|
-
}, [children, clearSelection, isMobile, selected, gridRef, allSelected, activeId, onCloseDetailPanel]);
|
|
103
|
+
}, [children, clearSelection, isMobile, selected, gridRef, allSelected, selectAll, turnOffSelectAll, activeId, onCloseDetailPanel]);
|
|
@@ -16,14 +16,6 @@ export interface ISelectableRowsOptions<T extends IRowEntity<N>, N extends IEnti
|
|
|
16
16
|
checkboxTitle?: (entity: T | N) => string;
|
|
17
17
|
headerTitle?: (state: SelectionState) => string;
|
|
18
18
|
turnOffSelectAll?: boolean;
|
|
19
|
-
/**
|
|
20
|
-
* When `true`, the header checkbox emits the current page's IDs instead of `{ all: true }`.
|
|
21
|
-
* When `undefined`, falls back to `turnOffSelectAll` for backward compatibility.
|
|
22
|
-
*
|
|
23
|
-
* Note: avoid setting this to `false` alongside `turnOffSelectAll: true` — the checkbox
|
|
24
|
-
* will emit `{ all: true }` while the dropdown hides the "Select all" option, which is inconsistent.
|
|
25
|
-
*/
|
|
26
|
-
checkboxSelectsCurrentPage?: boolean;
|
|
27
19
|
checkboxPlaceholder?: boolean;
|
|
28
20
|
strategy?: TSelectionStrategy;
|
|
29
21
|
selectAll?: boolean;
|
|
@@ -157,6 +157,7 @@ export const useSelectableRows = (columns, entities, isMobile, selectMode, setSe
|
|
|
157
157
|
return;
|
|
158
158
|
}
|
|
159
159
|
const newSelections = getCurrentPageSelection(entities, selectable);
|
|
160
|
+
setState(newState);
|
|
160
161
|
const newValue = {
|
|
161
162
|
selected: [...newSelections],
|
|
162
163
|
all: false
|
|
@@ -175,16 +176,8 @@ export const useSelectableRows = (columns, entities, isMobile, selectMode, setSe
|
|
|
175
176
|
return translate("Deselect all");
|
|
176
177
|
}, [selectable, selectableState, state, translate]);
|
|
177
178
|
const isEntityChecked = useCallback((entity, isNested) => isRowChecked(selections, state, selectable === null || selectable === void 0 ? void 0 : selectable.strategy, entity, isNested), [selections, state, selectable === null || selectable === void 0 ? void 0 : selectable.strategy]);
|
|
178
|
-
const hasSelectable = !!selectable;
|
|
179
|
-
const selectableCheckboxSelectsCurrentPage = selectable === null || selectable === void 0 ? void 0 : selectable.checkboxSelectsCurrentPage;
|
|
180
|
-
const selectableTurnOffSelectAll = selectable === null || selectable === void 0 ? void 0 : selectable.turnOffSelectAll;
|
|
181
|
-
const selectableCheckboxInHeader = selectable === null || selectable === void 0 ? void 0 : selectable.checkboxInHeader;
|
|
182
|
-
const selectableSelectionLimit = selectable === null || selectable === void 0 ? void 0 : selectable.selectionLimit;
|
|
183
|
-
const selectableHeader = selectable === null || selectable === void 0 ? void 0 : selectable.header;
|
|
184
|
-
const checkboxEmitsCurrentPage = selectableCheckboxSelectsCurrentPage !== null && selectableCheckboxSelectsCurrentPage !== void 0 ? selectableCheckboxSelectsCurrentPage : selectableTurnOffSelectAll;
|
|
185
|
-
const checkboxInHeaderValue = selectableCheckboxInHeader !== undefined ? selectableCheckboxInHeader : selectableSelectionLimit !== undefined ? false : undefined;
|
|
186
179
|
const wrapper = useMemo(() => {
|
|
187
|
-
if (!
|
|
180
|
+
if (!selectable) {
|
|
188
181
|
return null;
|
|
189
182
|
}
|
|
190
183
|
return {
|
|
@@ -226,23 +219,23 @@ export const useSelectableRows = (columns, entities, isMobile, selectMode, setSe
|
|
|
226
219
|
checked: state === SelectionState.CurrentPage || state === SelectionState.All,
|
|
227
220
|
indeterminate: state === SelectionState.Partial,
|
|
228
221
|
onChange: newValue => {
|
|
229
|
-
const newState = newValue ?
|
|
222
|
+
const newState = newValue ? selectable.turnOffSelectAll ? SelectionState.CurrentPage : SelectionState.All : SelectionState.None;
|
|
230
223
|
setState(newState);
|
|
231
224
|
onChangeSelectionState(newState);
|
|
232
225
|
},
|
|
233
226
|
calculateSelectionState: () => selectableState,
|
|
234
|
-
checkboxInHeader:
|
|
235
|
-
header:
|
|
227
|
+
checkboxInHeader: selectable.checkboxInHeader !== undefined ? selectable.checkboxInHeader : selectable.selectionLimit !== undefined ? false : undefined,
|
|
228
|
+
header: selectable.header,
|
|
236
229
|
onSelect: newState => {
|
|
237
230
|
setState(newState);
|
|
238
231
|
onChangeSelectionState(newState);
|
|
239
232
|
},
|
|
240
|
-
turnOffSelectAll:
|
|
233
|
+
turnOffSelectAll: selectable.turnOffSelectAll
|
|
241
234
|
});
|
|
242
235
|
return cell;
|
|
243
236
|
}
|
|
244
237
|
};
|
|
245
|
-
}, [checkboxDisabled, checkboxTitle, checkboxVisible, headerTitle, onChangeSelectionState, onSelectListener,
|
|
238
|
+
}, [checkboxDisabled, checkboxTitle, checkboxVisible, headerTitle, onChangeSelectionState, onSelectListener, selectable, selectableState, state, isMobile, checkboxPlaceholder, isEntityChecked]);
|
|
246
239
|
const selectableFeedWrapper = useCallback((primaryData, secondaryData, entity, isNested) => {
|
|
247
240
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
248
241
|
if (!entity) {
|
package/esm/table/table.js
CHANGED
|
@@ -175,6 +175,12 @@ const TableInner = ({
|
|
|
175
175
|
selected: []
|
|
176
176
|
});
|
|
177
177
|
}, [selectable]);
|
|
178
|
+
const selectAll = useCallback(() => {
|
|
179
|
+
selectable === null || selectable === void 0 ? void 0 : selectable.onSelect({
|
|
180
|
+
all: true,
|
|
181
|
+
selected: []
|
|
182
|
+
});
|
|
183
|
+
}, [selectable]);
|
|
178
184
|
const [activeIdInternal, setActiveInternal] = useState(undefined);
|
|
179
185
|
const activeId = active !== undefined ? active : activeIdInternal;
|
|
180
186
|
const onClickInternal = useCallback(id => setActiveInternal(id === activeIdInternal ? undefined : id), [activeIdInternal, setActiveInternal]);
|
|
@@ -191,7 +197,7 @@ const TableInner = ({
|
|
|
191
197
|
detailPanel,
|
|
192
198
|
footer,
|
|
193
199
|
other
|
|
194
|
-
} = useTableChildren(children, isMobile, selectionQty, ((_c = selectable === null || selectable === void 0 ? void 0 : selectable.selection) === null || _c === void 0 ? void 0 : _c.all) || false, clearSelection, activeId, gridRef, onCloseDetailPanel);
|
|
200
|
+
} = useTableChildren(children, isMobile, selectionQty, ((_c = selectable === null || selectable === void 0 ? void 0 : selectable.selection) === null || _c === void 0 ? void 0 : _c.all) || false, clearSelection, selectAll, selectable === null || selectable === void 0 ? void 0 : selectable.turnOffSelectAll, activeId, gridRef, onCloseDetailPanel);
|
|
195
201
|
const hasDetailPanel = !!detailPanel;
|
|
196
202
|
const shouldEnableRowClick = hasDetailPanel || !!onClick;
|
|
197
203
|
const activeIdForRow = shouldEnableRowClick ? activeId : undefined;
|
package/package.json
CHANGED
package/dist/title/title.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Title = void 0;
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const react_1 = require("react");
|
|
6
|
-
const classNames_1 = require("../commonHelpers/classNames/classNames");
|
|
7
|
-
const useDrive_1 = require("../utils/theme/useDrive");
|
|
8
|
-
const useDriveClassName_1 = require("../utils/theme/useDriveClassName");
|
|
9
|
-
const iconChevronRightSmall_1 = require("../icons/iconChevronRightSmall");
|
|
10
|
-
const Title = ({ isMobile, link, target, title, id, icon, iconType, className = "", onClick }) => {
|
|
11
|
-
const isDrive = (0, useDrive_1.useDrive)();
|
|
12
|
-
const driveClassName = (0, useDriveClassName_1.useDriveClassName)("zen-title");
|
|
13
|
-
const h3ClassName = (0, classNames_1.classNames)(["zen-title", driveClassName !== null && driveClassName !== void 0 ? driveClassName : ""]);
|
|
14
|
-
const clickableClass = onClick ? "zen-title__clickable" : "";
|
|
15
|
-
const iconClassName = iconType ? `zen-title__icon--${iconType}` : "";
|
|
16
|
-
const iconSize = (0, react_1.useMemo)(() => (isDrive ? "huge" : "large"), [isDrive]);
|
|
17
|
-
const iconElement = (0, react_1.useMemo)(() => (icon ? (0, jsx_runtime_1.jsx)("div", { className: (0, classNames_1.classNames)(["zen-title__icon", iconClassName]), children: (0, react_1.createElement)(icon, { size: iconSize }) }) : null), [icon, iconSize, iconClassName]);
|
|
18
|
-
const chevron = (0, react_1.useMemo)(() => ((0, jsx_runtime_1.jsx)("span", { className: "zen-title__link-chevron", children: (0, jsx_runtime_1.jsx)(iconChevronRightSmall_1.IconChevronRightSmall, { size: iconSize, className: "zen-title__chevron-icon" }) })), [iconSize]);
|
|
19
|
-
if (onClick) {
|
|
20
|
-
return ((0, jsx_runtime_1.jsx)("h3", { className: h3ClassName, children: (0, jsx_runtime_1.jsxs)("button", { type: "button", className: clickableClass, onClick: onClick, children: [iconElement, (0, jsx_runtime_1.jsxs)("span", { title: title, id: id, className: (0, classNames_1.classNames)(["zen-title__text", isMobile && !isDrive ? "zen-title__text--mobile" : "", className]), children: [title, chevron] })] }) }));
|
|
21
|
-
}
|
|
22
|
-
if (link) {
|
|
23
|
-
return ((0, jsx_runtime_1.jsx)("h3", { className: h3ClassName, children: (0, jsx_runtime_1.jsxs)("a", { id: id, className: "zen-title__link", href: link, target: target, children: [iconElement, (0, jsx_runtime_1.jsxs)("span", { title: title, className: (0, classNames_1.classNames)(["zen-title__link-text"]), children: [title, chevron] })] }) }));
|
|
24
|
-
}
|
|
25
|
-
return ((0, jsx_runtime_1.jsxs)("h3", { className: h3ClassName, children: [iconElement, (0, jsx_runtime_1.jsx)("span", { title: title, id: id, className: (0, classNames_1.classNames)(["zen-title__text", isMobile && !isDrive ? "zen-title__text--mobile" : "", className]), children: title })] }));
|
|
26
|
-
};
|
|
27
|
-
exports.Title = Title;
|
package/esm/title/title.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { createElement, useMemo } from "react";
|
|
3
|
-
import { classNames } from "../commonHelpers/classNames/classNames";
|
|
4
|
-
import { useDrive } from "../utils/theme/useDrive";
|
|
5
|
-
import { useDriveClassName } from "../utils/theme/useDriveClassName";
|
|
6
|
-
import { IconChevronRightSmall } from "../icons/iconChevronRightSmall";
|
|
7
|
-
export const Title = ({ isMobile, link, target, title, id, icon, iconType, className = "", onClick }) => {
|
|
8
|
-
const isDrive = useDrive();
|
|
9
|
-
const driveClassName = useDriveClassName("zen-title");
|
|
10
|
-
const h3ClassName = classNames(["zen-title", driveClassName !== null && driveClassName !== void 0 ? driveClassName : ""]);
|
|
11
|
-
const clickableClass = onClick ? "zen-title__clickable" : "";
|
|
12
|
-
const iconClassName = iconType ? `zen-title__icon--${iconType}` : "";
|
|
13
|
-
const iconSize = useMemo(() => (isDrive ? "huge" : "large"), [isDrive]);
|
|
14
|
-
const iconElement = useMemo(() => (icon ? _jsx("div", { className: classNames(["zen-title__icon", iconClassName]), children: createElement(icon, { size: iconSize }) }) : null), [icon, iconSize, iconClassName]);
|
|
15
|
-
const chevron = useMemo(() => (_jsx("span", { className: "zen-title__link-chevron", children: _jsx(IconChevronRightSmall, { size: iconSize, className: "zen-title__chevron-icon" }) })), [iconSize]);
|
|
16
|
-
if (onClick) {
|
|
17
|
-
return (_jsx("h3", { className: h3ClassName, children: _jsxs("button", { type: "button", className: clickableClass, onClick: onClick, children: [iconElement, _jsxs("span", { title: title, id: id, className: classNames(["zen-title__text", isMobile && !isDrive ? "zen-title__text--mobile" : "", className]), children: [title, chevron] })] }) }));
|
|
18
|
-
}
|
|
19
|
-
if (link) {
|
|
20
|
-
return (_jsx("h3", { className: h3ClassName, children: _jsxs("a", { id: id, className: "zen-title__link", href: link, target: target, children: [iconElement, _jsxs("span", { title: title, className: classNames(["zen-title__link-text"]), children: [title, chevron] })] }) }));
|
|
21
|
-
}
|
|
22
|
-
return (_jsxs("h3", { className: h3ClassName, children: [iconElement, _jsx("span", { title: title, id: id, className: classNames(["zen-title__text", isMobile && !isDrive ? "zen-title__text--mobile" : "", className]), children: title })] }));
|
|
23
|
-
};
|