@orbe-agro/client-core 5.6.145 → 5.6.146
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/@ecme/components/layouts/PostLoginLayout/components/CollapsibleSide.stories.js +25 -0
- package/dist/@ecme/components/layouts/PostLoginLayout/components/CollapsibleSide.stories.js.map +1 -0
- package/dist/@ecme/components/layouts/PostLoginLayout/components/ContentOverlay.stories.js +22 -0
- package/dist/@ecme/components/layouts/PostLoginLayout/components/ContentOverlay.stories.js.map +1 -0
- package/dist/@ecme/components/layouts/PostLoginLayout/components/FrameLessSide.stories.js +22 -0
- package/dist/@ecme/components/layouts/PostLoginLayout/components/FrameLessSide.stories.js.map +1 -0
- package/dist/@ecme/components/layouts/PostLoginLayout/components/StackedSide.stories.js +25 -0
- package/dist/@ecme/components/layouts/PostLoginLayout/components/StackedSide.stories.js.map +1 -0
- package/dist/@ecme/components/layouts/PostLoginLayout/components/TopBarClassic.stories.js +25 -0
- package/dist/@ecme/components/layouts/PostLoginLayout/components/TopBarClassic.stories.js.map +1 -0
- package/dist/@ecme/components/template/Footer.js +1 -1
- package/dist/@ecme/components/template/Header.stories.js +42 -0
- package/dist/@ecme/components/template/Header.stories.js.map +1 -0
- package/dist/@ecme/components/template/Search.js +32 -2
- package/dist/@ecme/components/template/Search.js.map +1 -1
- package/dist/@ecme/components/template/Search.stories.js +61 -0
- package/dist/@ecme/components/template/Search.stories.js.map +1 -0
- package/dist/@ecme/index.js +3 -0
- package/dist/@ecme/index.js.map +1 -1
- package/dist/@ecme/locales/index.js +4 -1
- package/dist/@ecme/locales/index.js.map +1 -1
- package/dist/@ecme/locales/initAll.js +26 -0
- package/dist/@ecme/locales/initAll.js.map +1 -0
- package/dist/@ecme/locales/lang/en/common.js +43 -0
- package/dist/@ecme/locales/lang/en/common.js.map +1 -1
- package/dist/@ecme/locales/lang/en/index.js +3 -1
- package/dist/@ecme/locales/lang/en/index.js.map +1 -1
- package/dist/@ecme/locales/lang/ptBR/common.js +43 -0
- package/dist/@ecme/locales/lang/ptBR/common.js.map +1 -1
- package/dist/@ecme/locales/lang/ptBR/index.js +3 -1
- package/dist/@ecme/locales/lang/ptBR/index.js.map +1 -1
- package/dist/@ecme/locales/lang/ptBR/nav.js +307 -4
- package/dist/@ecme/locales/lang/ptBR/nav.js.map +1 -1
- package/dist/@ecme/views/auth/lang/index.js +2 -2
- package/dist/@ecme/views/auth/lang/index.js.map +1 -1
- package/dist/@types/@ecme/components/template/Search.d.ts.map +1 -1
- package/dist/@types/@ecme/locales/index.d.ts +1 -0
- package/dist/@types/@ecme/locales/index.d.ts.map +1 -1
- package/dist/@types/@ecme/locales/initAll.d.ts +3 -0
- package/dist/@types/@ecme/locales/initAll.d.ts.map +1 -0
- package/dist/@types/@ecme/locales/lang/en/common.d.ts +43 -0
- package/dist/@types/@ecme/locales/lang/en/common.d.ts.map +1 -1
- package/dist/@types/@ecme/locales/lang/en/index.d.ts +98 -0
- package/dist/@types/@ecme/locales/lang/en/index.d.ts.map +1 -1
- package/dist/@types/@ecme/locales/lang/ptBR/common.d.ts.map +1 -1
- package/dist/@types/@ecme/locales/lang/ptBR/index.d.ts +98 -0
- package/dist/@types/@ecme/locales/lang/ptBR/index.d.ts.map +1 -1
- package/dist/@types/@ecme/locales/lang/ptBR/nav.d.ts.map +1 -1
- package/dist/base/locales/index.js +2 -2
- package/dist/base/locales/index.js.map +1 -1
- package/lib/@ecme/components/layouts/PostLoginLayout/components/CollapsibleSide.stories.tsx +38 -0
- package/lib/@ecme/components/layouts/PostLoginLayout/components/ContentOverlay.stories.tsx +35 -0
- package/lib/@ecme/components/layouts/PostLoginLayout/components/FrameLessSide.stories.tsx +35 -0
- package/lib/@ecme/components/layouts/PostLoginLayout/components/StackedSide.stories.tsx +38 -0
- package/lib/@ecme/components/layouts/PostLoginLayout/components/TopBarClassic.stories.tsx +38 -0
- package/lib/@ecme/components/template/Header.stories.tsx +46 -0
- package/lib/@ecme/components/template/Search.stories.tsx +79 -0
- package/lib/@ecme/components/template/Search.tsx +41 -14
- package/lib/@ecme/locales/index.ts +4 -0
- package/lib/@ecme/locales/initAll.ts +25 -0
- package/lib/@ecme/locales/lang/en/common.ts +43 -0
- package/lib/@ecme/locales/lang/en/index.ts +2 -0
- package/lib/@ecme/locales/lang/ptBR/common.ts +44 -1
- package/lib/@ecme/locales/lang/ptBR/index.ts +2 -0
- package/lib/@ecme/locales/lang/ptBR/nav.ts +308 -5
- package/lib/@ecme/views/auth/lang/index.ts +2 -2
- package/lib/base/locales/index.ts +2 -2
- package/package.json +1 -1
|
@@ -1,4 +1,59 @@
|
|
|
1
1
|
declare const _default: {
|
|
2
|
+
base: {
|
|
3
|
+
layout: {
|
|
4
|
+
search: {
|
|
5
|
+
results: {
|
|
6
|
+
navTree: string;
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
profile: {
|
|
10
|
+
dropdown: {
|
|
11
|
+
title: string;
|
|
12
|
+
options: {
|
|
13
|
+
profile: string;
|
|
14
|
+
settings: string;
|
|
15
|
+
activity: string;
|
|
16
|
+
signOut: string;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
themeConfig: {
|
|
21
|
+
title: string;
|
|
22
|
+
options: {
|
|
23
|
+
darkMode: string;
|
|
24
|
+
darkModeDesc: string;
|
|
25
|
+
direction: string;
|
|
26
|
+
directionDesc: string;
|
|
27
|
+
theme: string;
|
|
28
|
+
layout: string;
|
|
29
|
+
layoutCollapsible: string;
|
|
30
|
+
layoutStacked: string;
|
|
31
|
+
layoutTopbar: string;
|
|
32
|
+
layoutFrameless: string;
|
|
33
|
+
layoutOverlay: string;
|
|
34
|
+
layoutBlank: string;
|
|
35
|
+
};
|
|
36
|
+
buttons: {
|
|
37
|
+
copyConfig: string;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
notifications: {
|
|
41
|
+
title: string;
|
|
42
|
+
actions: {
|
|
43
|
+
readAll: string;
|
|
44
|
+
};
|
|
45
|
+
status: {
|
|
46
|
+
empty: string;
|
|
47
|
+
};
|
|
48
|
+
buttons: {
|
|
49
|
+
viewAll: string;
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
footer: {
|
|
53
|
+
notice: string;
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
};
|
|
2
57
|
pages: {
|
|
3
58
|
auth: {
|
|
4
59
|
forgotPassword: {
|
|
@@ -105,6 +160,49 @@ declare const _default: {
|
|
|
105
160
|
of: string;
|
|
106
161
|
all: string;
|
|
107
162
|
};
|
|
163
|
+
layout: {
|
|
164
|
+
search: {
|
|
165
|
+
results: {
|
|
166
|
+
navTree: string;
|
|
167
|
+
};
|
|
168
|
+
};
|
|
169
|
+
profile: {
|
|
170
|
+
dropdown: {
|
|
171
|
+
options: {
|
|
172
|
+
profile: string;
|
|
173
|
+
settings: string;
|
|
174
|
+
activity: string;
|
|
175
|
+
signOut: string;
|
|
176
|
+
};
|
|
177
|
+
};
|
|
178
|
+
};
|
|
179
|
+
themeConfig: {
|
|
180
|
+
title: string;
|
|
181
|
+
options: {
|
|
182
|
+
darkMode: string;
|
|
183
|
+
darkModeDesc: string;
|
|
184
|
+
direction: string;
|
|
185
|
+
directionDesc: string;
|
|
186
|
+
theme: string;
|
|
187
|
+
layout: string;
|
|
188
|
+
layoutCollapsible: string;
|
|
189
|
+
layoutStacked: string;
|
|
190
|
+
layoutTopbar: string;
|
|
191
|
+
layoutFrameless: string;
|
|
192
|
+
layoutOverlay: string;
|
|
193
|
+
layoutBlank: string;
|
|
194
|
+
};
|
|
195
|
+
buttons: {
|
|
196
|
+
copyConfig: string;
|
|
197
|
+
};
|
|
198
|
+
};
|
|
199
|
+
notifications: {
|
|
200
|
+
title: string;
|
|
201
|
+
actions: {
|
|
202
|
+
readAll: string;
|
|
203
|
+
};
|
|
204
|
+
};
|
|
205
|
+
};
|
|
108
206
|
};
|
|
109
207
|
nav: {
|
|
110
208
|
modules: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../lib/@ecme/locales/lang/en/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../lib/@ecme/locales/lang/en/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,wBAKC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../../../../lib/@ecme/locales/lang/ptBR/common.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,cAAc,CAAA;
|
|
1
|
+
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../../../../lib/@ecme/locales/lang/ptBR/common.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,cAAc,CAAA;wBAwI9B,OAAO,QAAQ;AArIpB,wBAqIoB"}
|
|
@@ -1,4 +1,59 @@
|
|
|
1
1
|
declare const _default: {
|
|
2
|
+
base: {
|
|
3
|
+
layout: {
|
|
4
|
+
search: {
|
|
5
|
+
results: {
|
|
6
|
+
navTree: string;
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
profile: {
|
|
10
|
+
dropdown: {
|
|
11
|
+
title: string;
|
|
12
|
+
options: {
|
|
13
|
+
profile: string;
|
|
14
|
+
settings: string;
|
|
15
|
+
activity: string;
|
|
16
|
+
signOut: string;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
themeConfig: {
|
|
21
|
+
title: string;
|
|
22
|
+
options: {
|
|
23
|
+
darkMode: string;
|
|
24
|
+
darkModeDesc: string;
|
|
25
|
+
direction: string;
|
|
26
|
+
directionDesc: string;
|
|
27
|
+
theme: string;
|
|
28
|
+
layout: string;
|
|
29
|
+
layoutCollapsible: string;
|
|
30
|
+
layoutStacked: string;
|
|
31
|
+
layoutTopbar: string;
|
|
32
|
+
layoutFrameless: string;
|
|
33
|
+
layoutOverlay: string;
|
|
34
|
+
layoutBlank: string;
|
|
35
|
+
};
|
|
36
|
+
buttons: {
|
|
37
|
+
copyConfig: string;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
notifications: {
|
|
41
|
+
title: string;
|
|
42
|
+
actions: {
|
|
43
|
+
readAll: string;
|
|
44
|
+
};
|
|
45
|
+
status: {
|
|
46
|
+
empty: string;
|
|
47
|
+
};
|
|
48
|
+
buttons: {
|
|
49
|
+
viewAll: string;
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
footer: {
|
|
53
|
+
notice: string;
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
};
|
|
2
57
|
pages: {
|
|
3
58
|
auth: {
|
|
4
59
|
forgotPassword: {
|
|
@@ -105,6 +160,49 @@ declare const _default: {
|
|
|
105
160
|
of: string;
|
|
106
161
|
all: string;
|
|
107
162
|
};
|
|
163
|
+
layout: {
|
|
164
|
+
search: {
|
|
165
|
+
results: {
|
|
166
|
+
navTree: string;
|
|
167
|
+
};
|
|
168
|
+
};
|
|
169
|
+
profile: {
|
|
170
|
+
dropdown: {
|
|
171
|
+
options: {
|
|
172
|
+
profile: string;
|
|
173
|
+
settings: string;
|
|
174
|
+
activity: string;
|
|
175
|
+
signOut: string;
|
|
176
|
+
};
|
|
177
|
+
};
|
|
178
|
+
};
|
|
179
|
+
themeConfig: {
|
|
180
|
+
title: string;
|
|
181
|
+
options: {
|
|
182
|
+
darkMode: string;
|
|
183
|
+
darkModeDesc: string;
|
|
184
|
+
direction: string;
|
|
185
|
+
directionDesc: string;
|
|
186
|
+
theme: string;
|
|
187
|
+
layout: string;
|
|
188
|
+
layoutCollapsible: string;
|
|
189
|
+
layoutStacked: string;
|
|
190
|
+
layoutTopbar: string;
|
|
191
|
+
layoutFrameless: string;
|
|
192
|
+
layoutOverlay: string;
|
|
193
|
+
layoutBlank: string;
|
|
194
|
+
};
|
|
195
|
+
buttons: {
|
|
196
|
+
copyConfig: string;
|
|
197
|
+
};
|
|
198
|
+
};
|
|
199
|
+
notifications: {
|
|
200
|
+
title: string;
|
|
201
|
+
actions: {
|
|
202
|
+
readAll: string;
|
|
203
|
+
};
|
|
204
|
+
};
|
|
205
|
+
};
|
|
108
206
|
};
|
|
109
207
|
nav: {
|
|
110
208
|
modules: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../lib/@ecme/locales/lang/ptBR/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../lib/@ecme/locales/lang/ptBR/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,wBAKC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nav.d.ts","sourceRoot":"","sources":["../../../../../../lib/@ecme/locales/lang/ptBR/nav.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,WAAW,CAAA;
|
|
1
|
+
{"version":3,"file":"nav.d.ts","sourceRoot":"","sources":["../../../../../../lib/@ecme/locales/lang/ptBR/nav.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,WAAW,CAAA;wBA8UxB,OAAO,KAAK;AAtUjB,wBAsUiB"}
|
|
@@ -3,8 +3,8 @@ import en from "./lang/en/index.js";
|
|
|
3
3
|
import ptBR from "./lang/ptBR/index.js";
|
|
4
4
|
import i18n from "i18next";
|
|
5
5
|
function addBaseLocaleResources() {
|
|
6
|
-
i18n.addResourceBundle("en", "translation", en);
|
|
7
|
-
i18n.addResourceBundle("ptBR", "translation", ptBR);
|
|
6
|
+
i18n.addResourceBundle("en", "translation", en, true, true);
|
|
7
|
+
i18n.addResourceBundle("ptBR", "translation", ptBR, true, true);
|
|
8
8
|
}
|
|
9
9
|
addBaseLocaleResources();
|
|
10
10
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../lib/base/locales/index.ts"],"sourcesContent":["import i18n from '@/locales'\nimport en from './lang/en'\nimport ptBR from './lang/ptBR'\n\nexport function addBaseLocaleResources() {\n i18n.addResourceBundle('en', 'translation', en)\n i18n.addResourceBundle('ptBR', 'translation', ptBR)\n}\n\naddBaseLocaleResources()\n"],"names":[],"mappings":";;;;AAIO,SAAS,yBAAyB;AACrC,OAAK,kBAAkB,MAAM,eAAe,
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../lib/base/locales/index.ts"],"sourcesContent":["import i18n from '@/locales'\nimport en from './lang/en'\nimport ptBR from './lang/ptBR'\n\nexport function addBaseLocaleResources() {\n i18n.addResourceBundle('en', 'translation', en, true, true)\n i18n.addResourceBundle('ptBR', 'translation', ptBR, true, true)\n}\n\naddBaseLocaleResources()\n"],"names":[],"mappings":";;;;AAIO,SAAS,yBAAyB;AACrC,OAAK,kBAAkB,MAAM,eAAe,IAAI,MAAM,IAAI;AAC1D,OAAK,kBAAkB,QAAQ,eAAe,MAAM,MAAM,IAAI;AAClE;AAEA,uBAAA;"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react'
|
|
2
|
+
import { BrowserRouter } from 'react-router-dom'
|
|
3
|
+
import CollapsibleSide from './CollapsibleSide'
|
|
4
|
+
|
|
5
|
+
const meta = {
|
|
6
|
+
title: '@ecme/Layouts/PostLogin/CollapsibleSide',
|
|
7
|
+
component: CollapsibleSide,
|
|
8
|
+
parameters: {
|
|
9
|
+
layout: 'fullscreen',
|
|
10
|
+
},
|
|
11
|
+
tags: ['autodocs'],
|
|
12
|
+
decorators: [
|
|
13
|
+
(Story) => (
|
|
14
|
+
<BrowserRouter>
|
|
15
|
+
<Story />
|
|
16
|
+
</BrowserRouter>
|
|
17
|
+
),
|
|
18
|
+
],
|
|
19
|
+
} satisfies Meta<typeof CollapsibleSide>
|
|
20
|
+
|
|
21
|
+
export default meta
|
|
22
|
+
|
|
23
|
+
type TStory = StoryObj<typeof meta>
|
|
24
|
+
|
|
25
|
+
export const Default: TStory = {
|
|
26
|
+
args: {
|
|
27
|
+
pageTitle: 'Dashboard',
|
|
28
|
+
},
|
|
29
|
+
render: (args) => (
|
|
30
|
+
<CollapsibleSide {...args}>
|
|
31
|
+
<div className="p-4">
|
|
32
|
+
<div className="rounded border border-gray-200 p-4">
|
|
33
|
+
Conteudo da pagina
|
|
34
|
+
</div>
|
|
35
|
+
</div>
|
|
36
|
+
</CollapsibleSide>
|
|
37
|
+
),
|
|
38
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react'
|
|
2
|
+
import { BrowserRouter } from 'react-router-dom'
|
|
3
|
+
import ContentOverlay from './ContentOverlay'
|
|
4
|
+
|
|
5
|
+
const meta = {
|
|
6
|
+
title: '@ecme/Layouts/PostLogin/ContentOverlay',
|
|
7
|
+
component: ContentOverlay,
|
|
8
|
+
parameters: {
|
|
9
|
+
layout: 'fullscreen',
|
|
10
|
+
},
|
|
11
|
+
tags: ['autodocs'],
|
|
12
|
+
decorators: [
|
|
13
|
+
(Story) => (
|
|
14
|
+
<BrowserRouter>
|
|
15
|
+
<Story />
|
|
16
|
+
</BrowserRouter>
|
|
17
|
+
),
|
|
18
|
+
],
|
|
19
|
+
} satisfies Meta<typeof ContentOverlay>
|
|
20
|
+
|
|
21
|
+
export default meta
|
|
22
|
+
|
|
23
|
+
type TStory = StoryObj<typeof meta>
|
|
24
|
+
|
|
25
|
+
export const Default: TStory = {
|
|
26
|
+
render: () => (
|
|
27
|
+
<ContentOverlay>
|
|
28
|
+
<div className="p-4">
|
|
29
|
+
<div className="rounded border border-gray-200 bg-white p-4 dark:bg-gray-900">
|
|
30
|
+
Conteudo da pagina
|
|
31
|
+
</div>
|
|
32
|
+
</div>
|
|
33
|
+
</ContentOverlay>
|
|
34
|
+
),
|
|
35
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react'
|
|
2
|
+
import { BrowserRouter } from 'react-router-dom'
|
|
3
|
+
import FrameLessSide from './FrameLessSide'
|
|
4
|
+
|
|
5
|
+
const meta = {
|
|
6
|
+
title: '@ecme/Layouts/PostLogin/FrameLessSide',
|
|
7
|
+
component: FrameLessSide,
|
|
8
|
+
parameters: {
|
|
9
|
+
layout: 'fullscreen',
|
|
10
|
+
},
|
|
11
|
+
tags: ['autodocs'],
|
|
12
|
+
decorators: [
|
|
13
|
+
(Story) => (
|
|
14
|
+
<BrowserRouter>
|
|
15
|
+
<Story />
|
|
16
|
+
</BrowserRouter>
|
|
17
|
+
),
|
|
18
|
+
],
|
|
19
|
+
} satisfies Meta<typeof FrameLessSide>
|
|
20
|
+
|
|
21
|
+
export default meta
|
|
22
|
+
|
|
23
|
+
type TStory = StoryObj<typeof meta>
|
|
24
|
+
|
|
25
|
+
export const Default: TStory = {
|
|
26
|
+
render: () => (
|
|
27
|
+
<FrameLessSide>
|
|
28
|
+
<div className="p-4">
|
|
29
|
+
<div className="rounded border border-gray-200 bg-white p-4 dark:bg-gray-900">
|
|
30
|
+
Conteudo da pagina
|
|
31
|
+
</div>
|
|
32
|
+
</div>
|
|
33
|
+
</FrameLessSide>
|
|
34
|
+
),
|
|
35
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react'
|
|
2
|
+
import { BrowserRouter } from 'react-router-dom'
|
|
3
|
+
import StackedSide from './StackedSide'
|
|
4
|
+
|
|
5
|
+
const meta = {
|
|
6
|
+
title: '@ecme/Layouts/PostLogin/StackedSide',
|
|
7
|
+
component: StackedSide,
|
|
8
|
+
parameters: {
|
|
9
|
+
layout: 'fullscreen',
|
|
10
|
+
},
|
|
11
|
+
tags: ['autodocs'],
|
|
12
|
+
decorators: [
|
|
13
|
+
(Story) => (
|
|
14
|
+
<BrowserRouter>
|
|
15
|
+
<Story />
|
|
16
|
+
</BrowserRouter>
|
|
17
|
+
),
|
|
18
|
+
],
|
|
19
|
+
} satisfies Meta<typeof StackedSide>
|
|
20
|
+
|
|
21
|
+
export default meta
|
|
22
|
+
|
|
23
|
+
type TStory = StoryObj<typeof meta>
|
|
24
|
+
|
|
25
|
+
export const Default: TStory = {
|
|
26
|
+
args: {
|
|
27
|
+
pageTitle: 'Dashboard',
|
|
28
|
+
},
|
|
29
|
+
render: (args) => (
|
|
30
|
+
<StackedSide {...args}>
|
|
31
|
+
<div className="p-4">
|
|
32
|
+
<div className="rounded border border-gray-200 p-4">
|
|
33
|
+
Conteudo da pagina
|
|
34
|
+
</div>
|
|
35
|
+
</div>
|
|
36
|
+
</StackedSide>
|
|
37
|
+
),
|
|
38
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react'
|
|
2
|
+
import { BrowserRouter } from 'react-router-dom'
|
|
3
|
+
import TopBarClassic from './TopBarClassic'
|
|
4
|
+
|
|
5
|
+
const meta = {
|
|
6
|
+
title: '@ecme/Layouts/PostLogin/TopBarClassic',
|
|
7
|
+
component: TopBarClassic,
|
|
8
|
+
parameters: {
|
|
9
|
+
layout: 'fullscreen',
|
|
10
|
+
},
|
|
11
|
+
tags: ['autodocs'],
|
|
12
|
+
decorators: [
|
|
13
|
+
(Story) => (
|
|
14
|
+
<BrowserRouter>
|
|
15
|
+
<Story />
|
|
16
|
+
</BrowserRouter>
|
|
17
|
+
),
|
|
18
|
+
],
|
|
19
|
+
} satisfies Meta<typeof TopBarClassic>
|
|
20
|
+
|
|
21
|
+
export default meta
|
|
22
|
+
|
|
23
|
+
type TStory = StoryObj<typeof meta>
|
|
24
|
+
|
|
25
|
+
export const Default: TStory = {
|
|
26
|
+
args: {
|
|
27
|
+
pageTitle: 'Dashboard',
|
|
28
|
+
},
|
|
29
|
+
render: (args) => (
|
|
30
|
+
<TopBarClassic {...args}>
|
|
31
|
+
<div className="p-4">
|
|
32
|
+
<div className="rounded border border-gray-200 p-4">
|
|
33
|
+
Conteudo da pagina
|
|
34
|
+
</div>
|
|
35
|
+
</div>
|
|
36
|
+
</TopBarClassic>
|
|
37
|
+
),
|
|
38
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react'
|
|
2
|
+
import Header from './Header'
|
|
3
|
+
|
|
4
|
+
const meta = {
|
|
5
|
+
title: '@ecme/Template/Header',
|
|
6
|
+
component: Header,
|
|
7
|
+
parameters: {
|
|
8
|
+
layout: 'fullscreen',
|
|
9
|
+
},
|
|
10
|
+
tags: ['autodocs'],
|
|
11
|
+
argTypes: {
|
|
12
|
+
container: {
|
|
13
|
+
control: 'boolean',
|
|
14
|
+
},
|
|
15
|
+
className: {
|
|
16
|
+
control: 'text',
|
|
17
|
+
},
|
|
18
|
+
wrapperClass: {
|
|
19
|
+
control: 'text',
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
} satisfies Meta<typeof Header>
|
|
23
|
+
|
|
24
|
+
export default meta
|
|
25
|
+
|
|
26
|
+
type TStory = StoryObj<typeof meta>
|
|
27
|
+
|
|
28
|
+
export const Default: TStory = {
|
|
29
|
+
args: {
|
|
30
|
+
container: false,
|
|
31
|
+
className: '',
|
|
32
|
+
wrapperClass: '',
|
|
33
|
+
},
|
|
34
|
+
render: (args) => (
|
|
35
|
+
<Header
|
|
36
|
+
{...args}
|
|
37
|
+
headerStart={
|
|
38
|
+
<div className="px-4 text-sm font-semibold">Minha Marca</div>
|
|
39
|
+
}
|
|
40
|
+
headerMiddle={<div className="text-sm">Área central</div>}
|
|
41
|
+
headerEnd={
|
|
42
|
+
<div className="px-4 text-sm text-gray-600">Usuário</div>
|
|
43
|
+
}
|
|
44
|
+
/>
|
|
45
|
+
),
|
|
46
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react'
|
|
2
|
+
import { useEffect } from 'react'
|
|
3
|
+
import { BrowserRouter } from 'react-router-dom'
|
|
4
|
+
import navigationConfig from '@/configs/navigation.config'
|
|
5
|
+
import type { NavigationTree } from '@/@types/navigation'
|
|
6
|
+
import { useSessionUser } from '@/store/authStore'
|
|
7
|
+
import Search from './Search'
|
|
8
|
+
|
|
9
|
+
const collectAuthorityPaths = (navTree: NavigationTree[]): string[] => {
|
|
10
|
+
return navTree.reduce((acc: string[], node) => {
|
|
11
|
+
if (node.path) {
|
|
12
|
+
acc.push(node.path)
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
if (node.subMenu?.length) {
|
|
16
|
+
acc.push(...collectAuthorityPaths(node.subMenu))
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
return acc
|
|
20
|
+
}, [])
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const allAuthority = Array.from(new Set(collectAuthorityPaths(navigationConfig)))
|
|
24
|
+
|
|
25
|
+
const WithSimulatedAuthorities = ({
|
|
26
|
+
children,
|
|
27
|
+
}: {
|
|
28
|
+
children: React.ReactNode
|
|
29
|
+
}) => {
|
|
30
|
+
useEffect(() => {
|
|
31
|
+
const previousUser = useSessionUser.getState().user
|
|
32
|
+
|
|
33
|
+
useSessionUser.setState({
|
|
34
|
+
user: {
|
|
35
|
+
...previousUser,
|
|
36
|
+
authority: allAuthority,
|
|
37
|
+
},
|
|
38
|
+
})
|
|
39
|
+
|
|
40
|
+
return () => {
|
|
41
|
+
useSessionUser.setState({ user: previousUser })
|
|
42
|
+
}
|
|
43
|
+
}, [])
|
|
44
|
+
|
|
45
|
+
return <>{children}</>
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const meta = {
|
|
49
|
+
title: '@ecme/Template/Search',
|
|
50
|
+
component: Search,
|
|
51
|
+
parameters: {
|
|
52
|
+
layout: 'padded',
|
|
53
|
+
},
|
|
54
|
+
tags: ['autodocs'],
|
|
55
|
+
decorators: [
|
|
56
|
+
(Story) => (
|
|
57
|
+
<BrowserRouter>
|
|
58
|
+
<WithSimulatedAuthorities>
|
|
59
|
+
<Story />
|
|
60
|
+
</WithSimulatedAuthorities>
|
|
61
|
+
</BrowserRouter>
|
|
62
|
+
),
|
|
63
|
+
],
|
|
64
|
+
argTypes: {
|
|
65
|
+
className: {
|
|
66
|
+
control: 'text',
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
} satisfies Meta<typeof Search>
|
|
70
|
+
|
|
71
|
+
export default meta
|
|
72
|
+
|
|
73
|
+
type TStory = StoryObj<typeof meta>
|
|
74
|
+
|
|
75
|
+
export const Default: TStory = {
|
|
76
|
+
args: {
|
|
77
|
+
className: '',
|
|
78
|
+
},
|
|
79
|
+
}
|
|
@@ -2,22 +2,11 @@ import { NavigationTree } from '@/@types/navigation'
|
|
|
2
2
|
import Button from '@/components/ui/Button'
|
|
3
3
|
import Dialog from '@/components/ui/Dialog'
|
|
4
4
|
import ScrollBar from '@/components/ui/ScrollBar'
|
|
5
|
-
import navigationIcon from '@/configs/navigation-icon.config'
|
|
6
5
|
import navigationConfig from '@/configs/navigation.config'
|
|
7
6
|
import { NAV_ITEM_TYPE_ITEM } from '@/constants/navigation.constant'
|
|
8
|
-
import {
|
|
9
|
-
GUIDE_PREFIX_PATH,
|
|
10
|
-
UI_COMPONENTS_PREFIX_PATH,
|
|
11
|
-
} from '@/constants/route.constant'
|
|
7
|
+
import { useSessionUser } from '@/store/authStore'
|
|
12
8
|
import classNames from '@/utils/classNames'
|
|
13
9
|
import withHeaderItem from '@/utils/hoc/withHeaderItem'
|
|
14
|
-
import {
|
|
15
|
-
filterDeep,
|
|
16
|
-
findDeep,
|
|
17
|
-
findPathDeep,
|
|
18
|
-
findValueDeep,
|
|
19
|
-
} from 'deepdash-es/standalone'
|
|
20
|
-
import { flatten, flattenDeep } from 'lodash'
|
|
21
10
|
import debounce from 'lodash/debounce'
|
|
22
11
|
import { useEffect, useMemo, useRef, useState } from 'react'
|
|
23
12
|
import Highlighter from 'react-highlight-words'
|
|
@@ -42,6 +31,38 @@ type SearchResult = {
|
|
|
42
31
|
data: SearchData[]
|
|
43
32
|
}
|
|
44
33
|
|
|
34
|
+
const filterNavigationByAuthority = (
|
|
35
|
+
navTree: NavigationTree[],
|
|
36
|
+
userAuthority: string[],
|
|
37
|
+
): NavigationTree[] => {
|
|
38
|
+
return navTree.reduce((acc: NavigationTree[], nav) => {
|
|
39
|
+
if (nav.excludeWhenHasPaths && nav.excludeWhenHasPaths.length > 0) {
|
|
40
|
+
const shouldExclude = nav.excludeWhenHasPaths.some((path) =>
|
|
41
|
+
userAuthority.includes(path),
|
|
42
|
+
)
|
|
43
|
+
|
|
44
|
+
if (shouldExclude) {
|
|
45
|
+
return acc
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
if (nav.subMenu && nav.subMenu.length > 0) {
|
|
50
|
+
const filteredSubMenu = filterNavigationByAuthority(
|
|
51
|
+
nav.subMenu,
|
|
52
|
+
userAuthority,
|
|
53
|
+
)
|
|
54
|
+
|
|
55
|
+
if (filteredSubMenu.length > 0) {
|
|
56
|
+
acc.push({ ...nav, subMenu: filteredSubMenu })
|
|
57
|
+
}
|
|
58
|
+
} else if ((nav.path && userAuthority.includes(nav.path)) || !nav.path) {
|
|
59
|
+
acc.push(nav)
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
return acc
|
|
63
|
+
}, [])
|
|
64
|
+
}
|
|
65
|
+
|
|
45
66
|
const ListItem = (props: {
|
|
46
67
|
icon: string
|
|
47
68
|
label: string
|
|
@@ -98,6 +119,7 @@ const _Search = ({ className }: { className?: string }) => {
|
|
|
98
119
|
const [searchDialogOpen, setSearchDialogOpen] = useState(false)
|
|
99
120
|
const [searchResult, setSearchResult] = useState<SearchResult[]>([])
|
|
100
121
|
const [noResult, setNoResult] = useState(false)
|
|
122
|
+
const userAuthority = useSessionUser((state) => state.user.authority)
|
|
101
123
|
|
|
102
124
|
const inputRef = useRef<HTMLInputElement>(null)
|
|
103
125
|
|
|
@@ -121,6 +143,10 @@ const _Search = ({ className }: { className?: string }) => {
|
|
|
121
143
|
|
|
122
144
|
const flatNavTree = useMemo(() => {
|
|
123
145
|
const arr: NavigationTreeFlat[] = []
|
|
146
|
+
const filteredNavigationTree = filterNavigationByAuthority(
|
|
147
|
+
navigationConfig,
|
|
148
|
+
userAuthority || [],
|
|
149
|
+
)
|
|
124
150
|
|
|
125
151
|
const makeflat = (item: NavigationTree, parents: string[]) => {
|
|
126
152
|
if (Array.isArray(item.subMenu) && item.subMenu.length > 0) {
|
|
@@ -131,11 +157,12 @@ const _Search = ({ className }: { className?: string }) => {
|
|
|
131
157
|
arr.push({ ...item, parents })
|
|
132
158
|
}
|
|
133
159
|
|
|
134
|
-
|
|
160
|
+
filteredNavigationTree.forEach(function f(item) {
|
|
135
161
|
makeflat(item, [t(item.translateKey)])
|
|
136
162
|
})
|
|
163
|
+
|
|
137
164
|
return arr
|
|
138
|
-
}, [
|
|
165
|
+
}, [userAuthority, t])
|
|
139
166
|
|
|
140
167
|
const filterNavigationTreeFlat = (
|
|
141
168
|
text: string,
|