@servicetitan/navigation 13.0.0-canary.256.b43c6d7.0 → 13.0.0-canary.256.b93dc10.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/dist/components/counter-tag.d.ts +1 -1
- package/dist/components/counter-tag.d.ts.map +1 -1
- package/dist/components/counter-tag.js.map +1 -1
- package/dist/components/profile-dropdown/interface.d.ts +55 -0
- package/dist/components/profile-dropdown/interface.d.ts.map +1 -0
- package/dist/components/profile-dropdown/interface.js +3 -0
- package/dist/components/profile-dropdown/interface.js.map +1 -0
- package/dist/components/profile-dropdown/profile-dropdown-legacy.stories.d.ts +5 -1
- package/dist/components/profile-dropdown/profile-dropdown-legacy.stories.d.ts.map +1 -1
- package/dist/components/profile-dropdown/profile-dropdown-stacked.stories.d.ts +5 -1
- package/dist/components/profile-dropdown/profile-dropdown-stacked.stories.d.ts.map +1 -1
- package/dist/components/profile-dropdown/profile-dropdown.d.ts +9 -79
- package/dist/components/profile-dropdown/profile-dropdown.d.ts.map +1 -1
- package/dist/components/profile-dropdown/profile-dropdown.js +17 -14
- package/dist/components/profile-dropdown/profile-dropdown.js.map +1 -1
- package/dist/components/profile-dropdown/profile-dropdown.stories.d.ts +5 -1
- package/dist/components/profile-dropdown/profile-dropdown.stories.d.ts.map +1 -1
- package/dist/components/titan-layout/interface-internal.d.ts +12 -0
- package/dist/components/titan-layout/interface-internal.d.ts.map +1 -1
- package/dist/components/titan-layout/interface-internal.js.map +1 -1
- package/dist/components/titan-layout/interface.d.ts +55 -4
- package/dist/components/titan-layout/interface.d.ts.map +1 -1
- package/dist/components/titan-layout/interface.js.map +1 -1
- package/dist/components/titan-layout/layout-header-dark.d.ts.map +1 -1
- package/dist/components/titan-layout/layout-header-dark.js +24 -12
- package/dist/components/titan-layout/layout-header-dark.js.map +1 -1
- package/dist/components/titan-layout/layout-header-links-internal.d.ts +22 -3
- package/dist/components/titan-layout/layout-header-links-internal.d.ts.map +1 -1
- package/dist/components/titan-layout/layout-header-links-internal.js +15 -18
- package/dist/components/titan-layout/layout-header-links-internal.js.map +1 -1
- package/dist/components/titan-layout/layout-header-links.d.ts +2 -3
- package/dist/components/titan-layout/layout-header-links.d.ts.map +1 -1
- package/dist/components/titan-layout/layout-header-links.js +25 -5
- package/dist/components/titan-layout/layout-header-links.js.map +1 -1
- package/dist/components/titan-layout/layout-header.d.ts +2 -0
- package/dist/components/titan-layout/layout-header.d.ts.map +1 -1
- package/dist/components/titan-layout/layout-header.js +25 -16
- package/dist/components/titan-layout/layout-header.js.map +1 -1
- package/dist/components/titan-layout/layout-header.module.less +37 -1
- package/dist/components/titan-layout/layout-header.module.less.d.ts +3 -0
- package/dist/components/titan-layout/layout-profile.d.ts +8 -5
- package/dist/components/titan-layout/layout-profile.d.ts.map +1 -1
- package/dist/components/titan-layout/layout-profile.js +29 -21
- package/dist/components/titan-layout/layout-profile.js.map +1 -1
- package/dist/components/titan-layout/layout-sidebar-links-internal.d.ts +48 -24
- package/dist/components/titan-layout/layout-sidebar-links-internal.d.ts.map +1 -1
- package/dist/components/titan-layout/layout-sidebar-links-internal.js +62 -51
- package/dist/components/titan-layout/layout-sidebar-links-internal.js.map +1 -1
- package/dist/components/titan-layout/layout-sidebar-links.d.ts +2 -2
- package/dist/components/titan-layout/layout-sidebar-links.d.ts.map +1 -1
- package/dist/components/titan-layout/layout-sidebar-links.js +27 -14
- package/dist/components/titan-layout/layout-sidebar-links.js.map +1 -1
- package/dist/components/titan-layout/layout-sidebar.d.ts +1 -1
- package/dist/components/titan-layout/layout-sidebar.d.ts.map +1 -1
- package/dist/components/titan-layout/layout-sidebar.js +81 -104
- package/dist/components/titan-layout/layout-sidebar.js.map +1 -1
- package/dist/components/titan-layout/layout-sidebar.module.less +74 -22
- package/dist/components/titan-layout/titan-layout-default.stories.d.ts +16 -0
- package/dist/components/titan-layout/titan-layout-default.stories.d.ts.map +1 -0
- package/dist/components/titan-layout/titan-layout-legacy.stories.d.ts +10 -0
- package/dist/components/titan-layout/titan-layout-legacy.stories.d.ts.map +1 -0
- package/dist/components/titan-layout/titan-layout-stacked.stories.d.ts +10 -0
- package/dist/components/titan-layout/titan-layout-stacked.stories.d.ts.map +1 -0
- package/dist/components/titan-layout/titan-layout.d.ts +3 -1
- package/dist/components/titan-layout/titan-layout.d.ts.map +1 -1
- package/dist/components/titan-layout/titan-layout.js +30 -11
- package/dist/components/titan-layout/titan-layout.js.map +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/test/data.d.ts +0 -22
- package/dist/test/data.d.ts.map +1 -1
- package/dist/test/data.js +0 -197
- package/dist/test/data.js.map +1 -1
- package/dist/test/titan-layout.d.ts +16 -0
- package/dist/test/titan-layout.d.ts.map +1 -0
- package/dist/test/titan-layout.js +21 -0
- package/dist/test/titan-layout.js.map +1 -0
- package/dist/utils/navigation.d.ts +0 -2
- package/dist/utils/navigation.d.ts.map +1 -1
- package/dist/utils/navigation.js.map +1 -1
- package/package.json +4 -4
- package/src/components/counter-tag.tsx +1 -1
- package/src/components/profile-dropdown/interface.ts +47 -0
- package/src/components/profile-dropdown/profile-dropdown-legacy.stories.tsx +3 -3
- package/src/components/profile-dropdown/profile-dropdown-stacked.stories.tsx +3 -3
- package/src/components/profile-dropdown/profile-dropdown.stories.tsx +39 -39
- package/src/components/profile-dropdown/profile-dropdown.tsx +37 -104
- package/src/components/titan-layout/interface-internal.ts +13 -0
- package/src/components/titan-layout/interface.ts +59 -7
- package/src/components/titan-layout/layout-header-dark.tsx +21 -5
- package/src/components/titan-layout/layout-header-links-internal.tsx +41 -54
- package/src/components/titan-layout/layout-header-links.tsx +64 -8
- package/src/components/titan-layout/layout-header.module.less +37 -1
- package/src/components/titan-layout/layout-header.module.less.d.ts +3 -0
- package/src/components/titan-layout/layout-header.tsx +26 -13
- package/src/components/titan-layout/layout-profile.tsx +51 -28
- package/src/components/titan-layout/layout-sidebar-links-internal.tsx +155 -102
- package/src/components/titan-layout/layout-sidebar-links.tsx +45 -12
- package/src/components/titan-layout/layout-sidebar.module.less +74 -22
- package/src/components/titan-layout/layout-sidebar.tsx +55 -80
- package/src/components/titan-layout/{titan-layout.stories.tsx → titan-layout-default.stories.tsx} +100 -84
- package/src/components/titan-layout/titan-layout-legacy.stories.tsx +24 -0
- package/src/components/titan-layout/titan-layout-stacked.stories.tsx +30 -0
- package/src/components/titan-layout/titan-layout.tsx +35 -12
- package/src/index.ts +0 -1
- package/src/test/data.tsx +0 -165
- package/src/test/titan-layout.tsx +34 -0
- package/src/utils/navigation.ts +0 -3
- package/dist/components/titan-layout/titan-layout.stories.d.ts +0 -29
- package/dist/components/titan-layout/titan-layout.stories.d.ts.map +0 -1
- package/dist/utils/navigation-legacy.d.ts +0 -88
- package/dist/utils/navigation-legacy.d.ts.map +0 -1
- package/dist/utils/navigation-legacy.js +0 -3
- package/dist/utils/navigation-legacy.js.map +0 -1
- package/src/utils/navigation-legacy.ts +0 -106
package/src/test/data.tsx
CHANGED
|
@@ -44,7 +44,6 @@ import {
|
|
|
44
44
|
NavigationSubmenuItemData,
|
|
45
45
|
} from '../utils/navigation';
|
|
46
46
|
import { NavLinkComponentProps } from '../utils/navigation-context';
|
|
47
|
-
import { HeaderNavigationItemData } from '../utils/navigation-legacy';
|
|
48
47
|
import * as Styles from './data-stories.module.less';
|
|
49
48
|
|
|
50
49
|
export const NavLinkMock = forwardRef<any, NavLinkComponentProps>(
|
|
@@ -115,31 +114,6 @@ export const SearchIcon = () => (
|
|
|
115
114
|
</svg>
|
|
116
115
|
);
|
|
117
116
|
|
|
118
|
-
const getItem = (
|
|
119
|
-
id: string,
|
|
120
|
-
data: Partial<HeaderNavigationItemData>
|
|
121
|
-
): HeaderNavigationItemData => ({
|
|
122
|
-
id,
|
|
123
|
-
to: '/' + id,
|
|
124
|
-
title: id[0].toUpperCase() + id.substring(1),
|
|
125
|
-
hint: id,
|
|
126
|
-
icon: undefined,
|
|
127
|
-
iconActive: undefined,
|
|
128
|
-
...data,
|
|
129
|
-
submenu: data.submenu
|
|
130
|
-
? {
|
|
131
|
-
...data.submenu,
|
|
132
|
-
groups: data.submenu.groups.map(group => ({
|
|
133
|
-
...group,
|
|
134
|
-
links: group.links.map(link => ({
|
|
135
|
-
...link,
|
|
136
|
-
to: `/${id}/${link.to}`,
|
|
137
|
-
})),
|
|
138
|
-
})),
|
|
139
|
-
}
|
|
140
|
-
: undefined,
|
|
141
|
-
});
|
|
142
|
-
|
|
143
117
|
const getNavItem = (id: string, data: Partial<NavigationItemData>): NavigationItemData => ({
|
|
144
118
|
id,
|
|
145
119
|
to: '/' + id,
|
|
@@ -179,145 +153,6 @@ const getGroup = (
|
|
|
179
153
|
links,
|
|
180
154
|
});
|
|
181
155
|
|
|
182
|
-
export const items = {
|
|
183
|
-
calendar: getItem('calendar', {
|
|
184
|
-
iconName: 'event',
|
|
185
|
-
icon: SvgSchedule,
|
|
186
|
-
iconActive: SvgScheduleActive,
|
|
187
|
-
}),
|
|
188
|
-
schedule: getItem('schedule', {
|
|
189
|
-
iconName: 'event',
|
|
190
|
-
icon: SvgSchedule,
|
|
191
|
-
iconActive: SvgScheduleActive,
|
|
192
|
-
}),
|
|
193
|
-
calls: getItem('calls', {
|
|
194
|
-
iconName: 'local_phone',
|
|
195
|
-
icon: SvgCalls,
|
|
196
|
-
iconActive: SvgCallsActive,
|
|
197
|
-
counter: 1234,
|
|
198
|
-
}),
|
|
199
|
-
dashboard: getItem('dashboard', {
|
|
200
|
-
iconName: 'odometer',
|
|
201
|
-
icon: SvgDashboard,
|
|
202
|
-
iconActive: SvgDashboardActive,
|
|
203
|
-
}),
|
|
204
|
-
dispatch: getItem('dispatch', {
|
|
205
|
-
iconName: 'location_disabled',
|
|
206
|
-
icon: SvgDispatch,
|
|
207
|
-
iconActive: SvgDispatchActive,
|
|
208
|
-
tag: { value: 3 },
|
|
209
|
-
}),
|
|
210
|
-
fleet: getItem('fleet', {
|
|
211
|
-
iconName: 'fleet-pro',
|
|
212
|
-
icon: SvgFleetPro,
|
|
213
|
-
iconActive: SvgFleetProActive,
|
|
214
|
-
title: 'Fleet Pro',
|
|
215
|
-
}),
|
|
216
|
-
followUps: getItem('followUps', {
|
|
217
|
-
iconName: 'flag',
|
|
218
|
-
icon: SvgFollowUp,
|
|
219
|
-
iconActive: SvgFollowUpActive,
|
|
220
|
-
title: 'Follow Up',
|
|
221
|
-
}),
|
|
222
|
-
followUpsWithSubmenu: getItem('followUps', {
|
|
223
|
-
iconName: 'flag',
|
|
224
|
-
icon: SvgFollowUp,
|
|
225
|
-
iconActive: SvgFollowUpActive,
|
|
226
|
-
title: 'Follow Up',
|
|
227
|
-
submenu: {
|
|
228
|
-
groups: [
|
|
229
|
-
getGroup('', [
|
|
230
|
-
getSubItem('estimates', { title: 'Unsold Estimates' }),
|
|
231
|
-
getSubItem('sold', { title: 'Sold Estimates' }),
|
|
232
|
-
getSubItem('surveys', { title: 'Surveys' }),
|
|
233
|
-
]),
|
|
234
|
-
],
|
|
235
|
-
},
|
|
236
|
-
}),
|
|
237
|
-
inventory: getItem('inventory', {
|
|
238
|
-
iconName: 'toys',
|
|
239
|
-
icon: SvgInventory,
|
|
240
|
-
iconActive: SvgInventoryActive,
|
|
241
|
-
}),
|
|
242
|
-
purchasing: getItem('purchasing', { iconComponent: InventoryIcon }),
|
|
243
|
-
purchasingWithSubmenu: getItem('purchasing', {
|
|
244
|
-
iconName: 'toys',
|
|
245
|
-
icon: SvgInventory,
|
|
246
|
-
iconActive: SvgInventoryActive,
|
|
247
|
-
counter: true,
|
|
248
|
-
submenu: {
|
|
249
|
-
groups: [
|
|
250
|
-
getGroup('Purchase', [
|
|
251
|
-
getSubItem('repl', { title: 'Replenishment' }),
|
|
252
|
-
getSubItem('orders', { title: 'Purchase Orders' }),
|
|
253
|
-
getSubItem('receipts', { title: 'Receipts' }),
|
|
254
|
-
getSubItem('returns', { title: 'Returns' }),
|
|
255
|
-
]),
|
|
256
|
-
],
|
|
257
|
-
},
|
|
258
|
-
}),
|
|
259
|
-
accounting: getItem('accounting', {
|
|
260
|
-
iconName: 'assignment',
|
|
261
|
-
icon: SvgAccounting,
|
|
262
|
-
iconActive: SvgAccountingActive,
|
|
263
|
-
counter: true,
|
|
264
|
-
}),
|
|
265
|
-
accountingWithSubmenu: getItem('accounting', {
|
|
266
|
-
iconName: 'assignment',
|
|
267
|
-
icon: SvgAccounting,
|
|
268
|
-
iconActive: SvgAccountingActive,
|
|
269
|
-
counter: 1,
|
|
270
|
-
submenu: {
|
|
271
|
-
groups: [
|
|
272
|
-
getGroup('Accounts Receivable', [
|
|
273
|
-
getSubItem('export', {
|
|
274
|
-
title: 'Batch/Export Transactions',
|
|
275
|
-
counter: true,
|
|
276
|
-
}),
|
|
277
|
-
getSubItem('ar', { title: 'AR Management' }),
|
|
278
|
-
getSubItem('invoices', { title: 'Invoices', counter: 3 }),
|
|
279
|
-
getSubItem('payments', { title: 'Customer Payments', counter: 2 }),
|
|
280
|
-
getSubItem('deposits', { title: 'Bank Deposits' }),
|
|
281
|
-
]),
|
|
282
|
-
getGroup('Accounts Payable', [getSubItem('bills', { title: 'Bills' })]),
|
|
283
|
-
getGroup('Financing', [getSubItem('dashboard', { title: 'Dashboard' })]),
|
|
284
|
-
getGroup('Others', [getSubItem('at', { title: 'Accounting Audit Trail' })]),
|
|
285
|
-
],
|
|
286
|
-
},
|
|
287
|
-
}),
|
|
288
|
-
marketing: getItem('marketing', {
|
|
289
|
-
iconName: 'bullhorn',
|
|
290
|
-
icon: SvgMarketing,
|
|
291
|
-
iconActive: SvgMarketingActive,
|
|
292
|
-
}),
|
|
293
|
-
priceBook: getItem('pricebook', {
|
|
294
|
-
iconName: 'book',
|
|
295
|
-
icon: SvgPriceBook,
|
|
296
|
-
iconActive: SvgPriceBookActive,
|
|
297
|
-
}),
|
|
298
|
-
pointOfSale: getItem('pointOfSale', {
|
|
299
|
-
iconName: 'cash-register',
|
|
300
|
-
icon: SvgPos,
|
|
301
|
-
iconActive: SvgPosActive,
|
|
302
|
-
title: 'Point Of Sale',
|
|
303
|
-
}),
|
|
304
|
-
projects: getItem('projects', {
|
|
305
|
-
iconName: 'folder_special',
|
|
306
|
-
icon: SvgProjects,
|
|
307
|
-
iconActive: SvgProjectsActive,
|
|
308
|
-
}),
|
|
309
|
-
reports: getItem('reports', {
|
|
310
|
-
iconName: 'folder_special',
|
|
311
|
-
icon: SvgReports,
|
|
312
|
-
iconActive: SvgReportsActive,
|
|
313
|
-
}),
|
|
314
|
-
tasks: getItem('tasks', {
|
|
315
|
-
iconName: 'format_list_bulleted',
|
|
316
|
-
icon: SvgTasks,
|
|
317
|
-
iconActive: SvgTasksActive,
|
|
318
|
-
}),
|
|
319
|
-
};
|
|
320
|
-
|
|
321
156
|
export const navItems = {
|
|
322
157
|
calendar: getNavItem('calendar', {
|
|
323
158
|
icon: SvgSchedule,
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { createContext, useContext } from 'react';
|
|
2
|
+
import { TitanLayoutProps } from '../components/titan-layout';
|
|
3
|
+
|
|
4
|
+
export interface LayoutContentArgs {
|
|
5
|
+
header: boolean;
|
|
6
|
+
sideTop: boolean;
|
|
7
|
+
extraText: boolean;
|
|
8
|
+
search: boolean;
|
|
9
|
+
longContent: boolean;
|
|
10
|
+
wideContent: boolean;
|
|
11
|
+
minWidth: boolean;
|
|
12
|
+
emptyNav: boolean;
|
|
13
|
+
overflowItems: boolean;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export const getDefaultArgs = (): LayoutContentArgs => ({
|
|
17
|
+
header: true,
|
|
18
|
+
sideTop: true,
|
|
19
|
+
extraText: true,
|
|
20
|
+
search: true,
|
|
21
|
+
longContent: true,
|
|
22
|
+
wideContent: false,
|
|
23
|
+
minWidth: false,
|
|
24
|
+
emptyNav: false,
|
|
25
|
+
overflowItems: true,
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
const DefaultPropsContext = createContext<Partial<TitanLayoutProps>>({});
|
|
29
|
+
export const withDefaultLayoutProps = (props: Partial<TitanLayoutProps>) => (Story: any) => (
|
|
30
|
+
<DefaultPropsContext.Provider value={props}>
|
|
31
|
+
<Story />
|
|
32
|
+
</DefaultPropsContext.Provider>
|
|
33
|
+
);
|
|
34
|
+
export const useDefaultLayoutProps = () => useContext(DefaultPropsContext);
|
package/src/utils/navigation.ts
CHANGED
|
@@ -2,9 +2,6 @@ import { IconProps } from '@servicetitan/anvil2';
|
|
|
2
2
|
import { CounterTagData, CounterTagValue } from './counter-tag';
|
|
3
3
|
|
|
4
4
|
export interface NavigationItemData extends NavigationLinkData {
|
|
5
|
-
/** flag if the link is not shown (based on FG and/or user permissions) */
|
|
6
|
-
isHidden?: boolean;
|
|
7
|
-
|
|
8
5
|
/** svg icon (anvil2) of inactive item */
|
|
9
6
|
icon: IconProps['svg'] | undefined;
|
|
10
7
|
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
interface LayoutContentArgs {
|
|
2
|
-
header: boolean;
|
|
3
|
-
sideTop: boolean;
|
|
4
|
-
extraText: boolean;
|
|
5
|
-
search: boolean;
|
|
6
|
-
longContent: boolean;
|
|
7
|
-
wideContent: boolean;
|
|
8
|
-
minWidth: boolean;
|
|
9
|
-
emptyNav: boolean;
|
|
10
|
-
}
|
|
11
|
-
declare const _default: {
|
|
12
|
-
title: string;
|
|
13
|
-
decorators: ((Story: any) => import("react/jsx-runtime").JSX.Element)[];
|
|
14
|
-
parameters: {};
|
|
15
|
-
argTypes: {};
|
|
16
|
-
args: LayoutContentArgs;
|
|
17
|
-
};
|
|
18
|
-
export default _default;
|
|
19
|
-
export declare const TitanLayoutLegacy: (args: LayoutContentArgs) => import("react/jsx-runtime").JSX.Element;
|
|
20
|
-
export declare const TitanLayoutLegacyTopNav: (args: LayoutContentArgs) => import("react/jsx-runtime").JSX.Element;
|
|
21
|
-
export declare const TitanLayoutLegacyTop: (args: LayoutContentArgs) => import("react/jsx-runtime").JSX.Element;
|
|
22
|
-
export declare const TitanLayoutAnvil1: (args: LayoutContentArgs) => import("react/jsx-runtime").JSX.Element;
|
|
23
|
-
export declare const TitanLayoutAnvil1TopNav: (args: LayoutContentArgs) => import("react/jsx-runtime").JSX.Element;
|
|
24
|
-
export declare const TitanLayoutAnvil1Top: (args: LayoutContentArgs) => import("react/jsx-runtime").JSX.Element;
|
|
25
|
-
export declare const TitanLayoutAnvil1TopOverflow: (args: LayoutContentArgs) => import("react/jsx-runtime").JSX.Element;
|
|
26
|
-
export declare const TitanLayoutAnvil2: (args: LayoutContentArgs) => import("react/jsx-runtime").JSX.Element;
|
|
27
|
-
export declare const TitanLayoutAnvil2TopNav: (args: LayoutContentArgs) => import("react/jsx-runtime").JSX.Element;
|
|
28
|
-
export declare const TitanLayoutAnvil2Top: (args: LayoutContentArgs) => import("react/jsx-runtime").JSX.Element;
|
|
29
|
-
//# sourceMappingURL=titan-layout.stories.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"titan-layout.stories.d.ts","sourceRoot":"","sources":["../../../src/components/titan-layout/titan-layout.stories.tsx"],"names":[],"mappings":"AA0BA,UAAU,iBAAiB;IACvB,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,OAAO,CAAC;IACnB,MAAM,EAAE,OAAO,CAAC;IAChB,WAAW,EAAE,OAAO,CAAC;IACrB,WAAW,EAAE,OAAO,CAAC;IACrB,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,OAAO,CAAC;CACrB;;;;;;UAgBQ,iBAAiB;;AAd1B,wBAeE;AA0QF,eAAO,MAAM,iBAAiB,GAAI,MAAM,iBAAiB,4CASxD,CAAC;AAEF,eAAO,MAAM,uBAAuB,GAAI,MAAM,iBAAiB,4CAS9D,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAAI,MAAM,iBAAiB,4CAS3D,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAI,MAAM,iBAAiB,4CAMxD,CAAC;AAEF,eAAO,MAAM,uBAAuB,GAAI,MAAM,iBAAiB,4CAM9D,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAAI,MAAM,iBAAiB,4CAY3D,CAAC;AAEF,eAAO,MAAM,4BAA4B,GAAI,MAAM,iBAAiB,4CAMnE,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAI,MAAM,iBAAiB,4CAQxD,CAAC;AAEF,eAAO,MAAM,uBAAuB,GAAI,MAAM,iBAAiB,4CAQ9D,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAAI,MAAM,iBAAiB,4CAQ3D,CAAC"}
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
import { IconProps } from '@servicetitan/anvil2';
|
|
2
|
-
import { IconPropsStrict } from '@servicetitan/design-system';
|
|
3
|
-
import { FC, HTMLAttributeAnchorTarget } from 'react';
|
|
4
|
-
import { CounterTagData, CounterTagValue } from './counter-tag';
|
|
5
|
-
import { NavigationSubmenuData } from './navigation';
|
|
6
|
-
export interface HeaderNavigationItemData extends HeaderNavigationItemLinkProps {
|
|
7
|
-
/** link description */
|
|
8
|
-
hint: string;
|
|
9
|
-
/** flag if the link is not shown (based on FG and/or user permissions) */
|
|
10
|
-
isHidden?: boolean;
|
|
11
|
-
/** custom className (can be used for mdi icons) */
|
|
12
|
-
iconClassName?: string;
|
|
13
|
-
/** anvil's icon name of item */
|
|
14
|
-
iconName?: IconPropsStrict['name'];
|
|
15
|
-
/** svg icon (anvil2) of inactive item */
|
|
16
|
-
icon: IconProps['svg'] | undefined;
|
|
17
|
-
/** svg icon (anvil2) of active item */
|
|
18
|
-
iconActive: IconProps['svg'] | undefined;
|
|
19
|
-
/** icon component of item (<svg />) */
|
|
20
|
-
iconComponent?: FC;
|
|
21
|
-
/** item tag (optional). shown if it is set and true or greater than 0 */
|
|
22
|
-
counter?: CounterTagValue;
|
|
23
|
-
tag?: CounterTagData;
|
|
24
|
-
/** class name of link item */
|
|
25
|
-
className?: string;
|
|
26
|
-
/** optional submenu of link item */
|
|
27
|
-
submenu?: NavigationSubmenuData;
|
|
28
|
-
}
|
|
29
|
-
export interface HeaderNavigationItemLinkProps {
|
|
30
|
-
/** link id */
|
|
31
|
-
id: string;
|
|
32
|
-
/** link href */
|
|
33
|
-
to: string;
|
|
34
|
-
/** link title */
|
|
35
|
-
title: string;
|
|
36
|
-
/** callback to return active state. By default, it compares link href with current pathname */
|
|
37
|
-
isActive?: boolean | ((pathname: string) => boolean);
|
|
38
|
-
}
|
|
39
|
-
export interface HeaderNavigationTriggerPropsStrict {
|
|
40
|
-
/** unique identifier */
|
|
41
|
-
id: string;
|
|
42
|
-
/** item title (used for mobile) */
|
|
43
|
-
title: string;
|
|
44
|
-
/** tooltip text */
|
|
45
|
-
tooltip?: string;
|
|
46
|
-
/** item description */
|
|
47
|
-
hint?: string;
|
|
48
|
-
/** container class name */
|
|
49
|
-
className?: string;
|
|
50
|
-
/** item label */
|
|
51
|
-
label?: string;
|
|
52
|
-
/** label class name */
|
|
53
|
-
labelClassName?: string;
|
|
54
|
-
/** isActive */
|
|
55
|
-
isActive?: boolean;
|
|
56
|
-
/** counter value shown for item */
|
|
57
|
-
counter?: CounterTagValue;
|
|
58
|
-
tag?: CounterTagData;
|
|
59
|
-
/** counter component class name */
|
|
60
|
-
counterClassName?: string;
|
|
61
|
-
/** icon component class name */
|
|
62
|
-
iconClassName?: string;
|
|
63
|
-
/** IconComponent custom icon component */
|
|
64
|
-
iconComponent?: FC;
|
|
65
|
-
/** iconName name of anvil icon */
|
|
66
|
-
iconName?: IconPropsStrict['name'];
|
|
67
|
-
/** svg icon (anvil2) of inactive item */
|
|
68
|
-
icon: IconProps['svg'] | undefined;
|
|
69
|
-
/** svg icon (anvil2) of active item */
|
|
70
|
-
iconActive?: IconProps['svg'];
|
|
71
|
-
}
|
|
72
|
-
export interface HeaderNavigationTriggerProps extends HeaderNavigationTriggerPropsStrict {
|
|
73
|
-
/** unstrict props */
|
|
74
|
-
[key: string]: any;
|
|
75
|
-
}
|
|
76
|
-
export interface HeaderNavigationLinkPropsStrict extends Omit<HeaderNavigationTriggerPropsStrict, 'isActive'> {
|
|
77
|
-
/** link href */
|
|
78
|
-
to: string;
|
|
79
|
-
/** isActive */
|
|
80
|
-
isActive?: boolean | ((pathname: string) => boolean);
|
|
81
|
-
/** link html target */
|
|
82
|
-
target?: HTMLAttributeAnchorTarget;
|
|
83
|
-
}
|
|
84
|
-
export interface HeaderNavigationLinkProps extends HeaderNavigationLinkPropsStrict {
|
|
85
|
-
/** unstrict props */
|
|
86
|
-
[key: string]: any;
|
|
87
|
-
}
|
|
88
|
-
//# sourceMappingURL=navigation-legacy.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"navigation-legacy.d.ts","sourceRoot":"","sources":["../../src/utils/navigation-legacy.ts"],"names":[],"mappings":"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"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utils/navigation-legacy.ts"],"sourcesContent":["import { IconProps } from '@servicetitan/anvil2';\nimport { IconPropsStrict } from '@servicetitan/design-system';\nimport { FC, HTMLAttributeAnchorTarget } from 'react';\nimport { CounterTagData, CounterTagValue } from './counter-tag';\nimport { NavigationSubmenuData } from './navigation';\n\nexport interface HeaderNavigationItemData extends HeaderNavigationItemLinkProps {\n /** link description */\n hint: string;\n\n /** flag if the link is not shown (based on FG and/or user permissions) */\n isHidden?: boolean;\n\n /** custom className (can be used for mdi icons) */\n iconClassName?: string;\n\n /** anvil's icon name of item */\n iconName?: IconPropsStrict['name'];\n\n /** svg icon (anvil2) of inactive item */\n icon: IconProps['svg'] | undefined;\n\n /** svg icon (anvil2) of active item */\n iconActive: IconProps['svg'] | undefined;\n\n /** icon component of item (<svg />) */\n iconComponent?: FC;\n\n /** item tag (optional). shown if it is set and true or greater than 0 */\n counter?: CounterTagValue;\n tag?: CounterTagData;\n\n /** class name of link item */\n className?: string;\n\n /** optional submenu of link item */\n submenu?: NavigationSubmenuData;\n}\n\nexport interface HeaderNavigationItemLinkProps {\n /** link id */\n id: string;\n\n /** link href */\n to: string;\n\n /** link title */\n title: string;\n\n /** callback to return active state. By default, it compares link href with current pathname */\n isActive?: boolean | ((pathname: string) => boolean);\n}\n\nexport interface HeaderNavigationTriggerPropsStrict {\n /** unique identifier */\n id: string;\n /** item title (used for mobile) */\n title: string;\n /** tooltip text */\n tooltip?: string;\n /** item description */\n hint?: string;\n /** container class name */\n className?: string;\n /** item label */\n label?: string;\n /** label class name */\n labelClassName?: string;\n /** isActive */\n isActive?: boolean;\n /** counter value shown for item */\n counter?: CounterTagValue;\n tag?: CounterTagData;\n /** counter component class name */\n counterClassName?: string;\n /** icon component class name */\n iconClassName?: string;\n /** IconComponent custom icon component */\n iconComponent?: FC;\n /** iconName name of anvil icon */\n iconName?: IconPropsStrict['name'];\n /** svg icon (anvil2) of inactive item */\n icon: IconProps['svg'] | undefined;\n /** svg icon (anvil2) of active item */\n iconActive?: IconProps['svg'];\n}\n\nexport interface HeaderNavigationTriggerProps extends HeaderNavigationTriggerPropsStrict {\n /** unstrict props */\n [key: string]: any;\n}\n\nexport interface HeaderNavigationLinkPropsStrict\n extends Omit<HeaderNavigationTriggerPropsStrict, 'isActive'> {\n /** link href */\n to: string;\n /** isActive */\n isActive?: boolean | ((pathname: string) => boolean);\n /** link html target */\n target?: HTMLAttributeAnchorTarget;\n}\n\nexport interface HeaderNavigationLinkProps extends HeaderNavigationLinkPropsStrict {\n /** unstrict props */\n [key: string]: any;\n}\n"],"names":[],"mappings":"AAsGA,WAGC"}
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
import { IconProps } from '@servicetitan/anvil2';
|
|
2
|
-
import { IconPropsStrict } from '@servicetitan/design-system';
|
|
3
|
-
import { FC, HTMLAttributeAnchorTarget } from 'react';
|
|
4
|
-
import { CounterTagData, CounterTagValue } from './counter-tag';
|
|
5
|
-
import { NavigationSubmenuData } from './navigation';
|
|
6
|
-
|
|
7
|
-
export interface HeaderNavigationItemData extends HeaderNavigationItemLinkProps {
|
|
8
|
-
/** link description */
|
|
9
|
-
hint: string;
|
|
10
|
-
|
|
11
|
-
/** flag if the link is not shown (based on FG and/or user permissions) */
|
|
12
|
-
isHidden?: boolean;
|
|
13
|
-
|
|
14
|
-
/** custom className (can be used for mdi icons) */
|
|
15
|
-
iconClassName?: string;
|
|
16
|
-
|
|
17
|
-
/** anvil's icon name of item */
|
|
18
|
-
iconName?: IconPropsStrict['name'];
|
|
19
|
-
|
|
20
|
-
/** svg icon (anvil2) of inactive item */
|
|
21
|
-
icon: IconProps['svg'] | undefined;
|
|
22
|
-
|
|
23
|
-
/** svg icon (anvil2) of active item */
|
|
24
|
-
iconActive: IconProps['svg'] | undefined;
|
|
25
|
-
|
|
26
|
-
/** icon component of item (<svg />) */
|
|
27
|
-
iconComponent?: FC;
|
|
28
|
-
|
|
29
|
-
/** item tag (optional). shown if it is set and true or greater than 0 */
|
|
30
|
-
counter?: CounterTagValue;
|
|
31
|
-
tag?: CounterTagData;
|
|
32
|
-
|
|
33
|
-
/** class name of link item */
|
|
34
|
-
className?: string;
|
|
35
|
-
|
|
36
|
-
/** optional submenu of link item */
|
|
37
|
-
submenu?: NavigationSubmenuData;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
export interface HeaderNavigationItemLinkProps {
|
|
41
|
-
/** link id */
|
|
42
|
-
id: string;
|
|
43
|
-
|
|
44
|
-
/** link href */
|
|
45
|
-
to: string;
|
|
46
|
-
|
|
47
|
-
/** link title */
|
|
48
|
-
title: string;
|
|
49
|
-
|
|
50
|
-
/** callback to return active state. By default, it compares link href with current pathname */
|
|
51
|
-
isActive?: boolean | ((pathname: string) => boolean);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
export interface HeaderNavigationTriggerPropsStrict {
|
|
55
|
-
/** unique identifier */
|
|
56
|
-
id: string;
|
|
57
|
-
/** item title (used for mobile) */
|
|
58
|
-
title: string;
|
|
59
|
-
/** tooltip text */
|
|
60
|
-
tooltip?: string;
|
|
61
|
-
/** item description */
|
|
62
|
-
hint?: string;
|
|
63
|
-
/** container class name */
|
|
64
|
-
className?: string;
|
|
65
|
-
/** item label */
|
|
66
|
-
label?: string;
|
|
67
|
-
/** label class name */
|
|
68
|
-
labelClassName?: string;
|
|
69
|
-
/** isActive */
|
|
70
|
-
isActive?: boolean;
|
|
71
|
-
/** counter value shown for item */
|
|
72
|
-
counter?: CounterTagValue;
|
|
73
|
-
tag?: CounterTagData;
|
|
74
|
-
/** counter component class name */
|
|
75
|
-
counterClassName?: string;
|
|
76
|
-
/** icon component class name */
|
|
77
|
-
iconClassName?: string;
|
|
78
|
-
/** IconComponent custom icon component */
|
|
79
|
-
iconComponent?: FC;
|
|
80
|
-
/** iconName name of anvil icon */
|
|
81
|
-
iconName?: IconPropsStrict['name'];
|
|
82
|
-
/** svg icon (anvil2) of inactive item */
|
|
83
|
-
icon: IconProps['svg'] | undefined;
|
|
84
|
-
/** svg icon (anvil2) of active item */
|
|
85
|
-
iconActive?: IconProps['svg'];
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
export interface HeaderNavigationTriggerProps extends HeaderNavigationTriggerPropsStrict {
|
|
89
|
-
/** unstrict props */
|
|
90
|
-
[key: string]: any;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
export interface HeaderNavigationLinkPropsStrict
|
|
94
|
-
extends Omit<HeaderNavigationTriggerPropsStrict, 'isActive'> {
|
|
95
|
-
/** link href */
|
|
96
|
-
to: string;
|
|
97
|
-
/** isActive */
|
|
98
|
-
isActive?: boolean | ((pathname: string) => boolean);
|
|
99
|
-
/** link html target */
|
|
100
|
-
target?: HTMLAttributeAnchorTarget;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
export interface HeaderNavigationLinkProps extends HeaderNavigationLinkPropsStrict {
|
|
104
|
-
/** unstrict props */
|
|
105
|
-
[key: string]: any;
|
|
106
|
-
}
|