@vc-shell/framework 1.1.24 → 1.1.26

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.
Files changed (83) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/core/composables/useAppInsights/index.ts +2 -2
  3. package/core/composables/useErrorHandler/index.ts +3 -2
  4. package/core/composables/useGlobalSearch/useGlobalSearch.md +263 -0
  5. package/core/composables/usePermissions/index.ts +2 -2
  6. package/core/composables/useTheme/index.ts +74 -26
  7. package/core/composables/useUser/index.ts +29 -8
  8. package/core/composables/useUserManagement/index.ts +45 -0
  9. package/core/interceptors/index.ts +2 -2
  10. package/core/plugins/signalR/index.ts +2 -2
  11. package/core/services/global-search-service/global-search-service.md +203 -0
  12. package/core/services/widget-service.ts +35 -12
  13. package/dist/core/composables/useErrorHandler/index.d.ts.map +1 -1
  14. package/dist/core/composables/useTheme/index.d.ts +14 -5
  15. package/dist/core/composables/useTheme/index.d.ts.map +1 -1
  16. package/dist/core/composables/useUser/index.d.ts +11 -3
  17. package/dist/core/composables/useUser/index.d.ts.map +1 -1
  18. package/dist/core/composables/useUserManagement/index.d.ts +23 -0
  19. package/dist/core/composables/useUserManagement/index.d.ts.map +1 -0
  20. package/dist/core/services/widget-service.d.ts +9 -7
  21. package/dist/core/services/widget-service.d.ts.map +1 -1
  22. package/dist/framework.js +94 -93
  23. package/dist/{index-DvenBxy6.js → index-20xYwcGS.js} +22032 -21961
  24. package/dist/{index-Br7ZwtRW.js → index-3B7GY2EI.js} +1 -1
  25. package/dist/{index-DAnceKLv.js → index-BGUwsXYM.js} +1 -1
  26. package/dist/{index-eOG-NNYN.js → index-BGghog2f.js} +1 -1
  27. package/dist/{index-Cxkjjuah.js → index-BQNK41p5.js} +1 -1
  28. package/dist/{index-CIzLBvgg.js → index-BeIJlP3x.js} +1 -1
  29. package/dist/{index-BnqqEJTE.js → index-BobFEOd-.js} +1 -1
  30. package/dist/{index-BYcoxn-f.js → index-CYbdhec2.js} +1 -1
  31. package/dist/{index-BbuBDu8A.js → index-DQczMBoO.js} +1 -1
  32. package/dist/{index-cuex9jil.js → index-DSNT0XVw.js} +1 -1
  33. package/dist/{index-DoArZBIw.js → index-DXHjWa3b.js} +1 -1
  34. package/dist/{index-Dk1K3-27.js → index-Dcf_1-Il.js} +1 -1
  35. package/dist/{index-CGL9e-cM.js → index-DszRvG1r.js} +1 -1
  36. package/dist/{index-CLAYu8Qj.js → index-DyPpTQJI.js} +1 -1
  37. package/dist/{index-Cmbxdwnl.js → index-Nr1LNRXa.js} +1 -1
  38. package/dist/{index-CRwMOCjN.js → index-RMOqRXFr.js} +1 -1
  39. package/dist/{index-BLmjssqE.js → index-Tsyx9GI7.js} +1 -1
  40. package/dist/index.css +1 -1
  41. package/dist/locales/de.json +6 -0
  42. package/dist/locales/en.json +6 -0
  43. package/dist/shared/components/change-password/change-password.vue.d.ts.map +1 -1
  44. package/dist/shared/components/notifications/components/notification-container/index.d.ts +1 -1
  45. package/dist/shared/components/notifications/components/notification-container/index.d.ts.map +1 -1
  46. package/dist/shared/components/settings-menu/settings-menu.vue.d.ts.map +1 -1
  47. package/dist/shared/components/settings-menu-item/settings-menu-item.vue.d.ts +6 -11
  48. package/dist/shared/components/settings-menu-item/settings-menu-item.vue.d.ts.map +1 -1
  49. package/dist/shared/components/sidebar/sidebar.vue.d.ts +3 -11
  50. package/dist/shared/components/sidebar/sidebar.vue.d.ts.map +1 -1
  51. package/dist/shared/components/theme-selector/theme-selector.vue.d.ts.map +1 -1
  52. package/dist/shared/modules/dynamic/pages/dynamic-blade-form.vue.d.ts.map +1 -1
  53. package/dist/shared/pages/InvitePage/components/invite/Invite.vue.d.ts.map +1 -1
  54. package/dist/shared/pages/LoginPage/components/login/Login.vue.d.ts.map +1 -1
  55. package/dist/shared/pages/ResetPasswordPage/components/reset-password/ResetPassword.vue.d.ts.map +1 -1
  56. package/dist/tsconfig.tsbuildinfo +1 -1
  57. package/dist/ui/components/atoms/vc-icon/vc-icon.vue.d.ts.map +1 -1
  58. package/dist/ui/components/atoms/vc-widget/vc-widget.vue.d.ts.map +1 -1
  59. package/dist/ui/components/organisms/vc-app/vc-app.vue.d.ts.map +1 -1
  60. package/dist/ui/components/organisms/vc-blade/_internal/vc-blade-widget-container/_internal/vc-widget-container-desktop.vue.d.ts.map +1 -1
  61. package/dist/ui/components/organisms/vc-blade/_internal/vc-blade-widget-container/_internal/vc-widget-container-mobile.vue.d.ts.map +1 -1
  62. package/dist/ui/components/organisms/vc-popup/vc-popup.vue.d.ts +1 -1
  63. package/dist/ui/components/organisms/vc-popup/vc-popup.vue.d.ts.map +1 -1
  64. package/package.json +4 -4
  65. package/shared/components/change-password/change-password.vue +2 -3
  66. package/shared/components/logout-button/logout-button.vue +2 -2
  67. package/shared/components/settings-menu/settings-menu.vue +1 -4
  68. package/shared/components/settings-menu-item/settings-menu-item.vue +9 -1
  69. package/shared/components/sidebar/sidebar.vue +6 -1
  70. package/shared/components/theme-selector/theme-selector.vue +11 -11
  71. package/shared/components/user-dropdown-button/_internal/user-info.vue +2 -2
  72. package/shared/modules/dynamic/pages/dynamic-blade-form.vue +1 -0
  73. package/shared/pages/InvitePage/components/invite/Invite.vue +217 -216
  74. package/shared/pages/LoginPage/components/login/Login.vue +3 -2
  75. package/shared/pages/ResetPasswordPage/components/reset-password/ResetPassword.vue +3 -2
  76. package/ui/components/atoms/vc-icon/vc-icon.vue +5 -10
  77. package/ui/components/atoms/vc-widget/vc-widget.vue +13 -6
  78. package/ui/components/molecules/vc-input-dropdown/vc-input-dropdown.stories.ts +0 -2
  79. package/ui/components/organisms/vc-app/vc-app.vue +4 -3
  80. package/ui/components/organisms/vc-blade/_internal/vc-blade-widget-container/_internal/vc-widget-container-desktop.vue +2 -1
  81. package/ui/components/organisms/vc-blade/_internal/vc-blade-widget-container/_internal/vc-widget-container-mobile.vue +2 -0
  82. package/ui/components/organisms/vc-popup/vc-popup.stories.ts +398 -0
  83. package/ui/components/organisms/vc-popup/vc-popup.vue +1 -1
@@ -0,0 +1,398 @@
1
+ import type { Meta, StoryObj } from "@storybook/vue3";
2
+ import { ref } from "vue";
3
+ import { VcPopup } from ".";
4
+ import VcButton from "../../atoms/vc-button/vc-button.vue";
5
+ import VcIcon from "../../atoms/vc-icon/vc-icon.vue";
6
+
7
+ const meta = {
8
+ title: "Organisms/VcPopup",
9
+ component: VcPopup,
10
+ argTypes: {
11
+ title: {
12
+ description: "The title of the popup. Can be overridden by the header slot.",
13
+ control: "text",
14
+ table: {
15
+ type: { summary: "string" },
16
+ category: "Props",
17
+ },
18
+ },
19
+ closable: {
20
+ description: "Determines if the popup can be closed by clicking the close button or outside.",
21
+ control: "boolean",
22
+ table: {
23
+ type: { summary: "boolean" },
24
+ defaultValue: { summary: "true" },
25
+ category: "Props",
26
+ },
27
+ },
28
+ variant: {
29
+ description: "The variant of the popup, affecting its icon and styling.",
30
+ control: "select",
31
+ options: ["default", "error", "warning", "success", "info"],
32
+ table: {
33
+ type: { summary: "'default' | 'error' | 'warning' | 'success' | 'info'" },
34
+ defaultValue: { summary: "default" },
35
+ category: "Props",
36
+ },
37
+ },
38
+ isMobileFullscreen: {
39
+ description: "If true, the popup will take up the full screen on mobile views.",
40
+ control: "boolean",
41
+ table: {
42
+ type: { summary: "boolean" },
43
+ defaultValue: { summary: "false" },
44
+ category: "Props",
45
+ },
46
+ },
47
+ isFullscreen: {
48
+ description: "If true, the popup will take up the full screen on all views.",
49
+ control: "boolean",
50
+ table: {
51
+ type: { summary: "boolean" },
52
+ defaultValue: { summary: "false" },
53
+ category: "Props",
54
+ },
55
+ },
56
+ modalWidth: {
57
+ description: "Custom Tailwind CSS class to set the maximum width of the popup modal.",
58
+ control: "text",
59
+ table: {
60
+ type: { summary: "string" },
61
+ defaultValue: { summary: "tw-max-w-md" },
62
+ category: "Props",
63
+ },
64
+ },
65
+ // Events
66
+ onClose: {
67
+ action: "close",
68
+ description: "Emitted when the popup is requested to close (e.g. by clicking the close button or pressing Esc).",
69
+ table: { category: "Events" },
70
+ },
71
+ // Slots
72
+ header: {
73
+ description: "Slot for custom header content. Overrides the `title` prop.",
74
+ table: { category: "Slots" },
75
+ },
76
+ content: {
77
+ description: "Main content slot for the popup.",
78
+ table: { category: "Slots" },
79
+ },
80
+ footer: {
81
+ description: "Slot for custom footer content. Provides a `close` function in its scope.",
82
+ table: { category: "Slots" },
83
+ },
84
+ },
85
+ args: {
86
+ title: "Default Popup Title",
87
+ closable: true,
88
+ variant: "default",
89
+ isMobileFullscreen: false,
90
+ isFullscreen: false,
91
+ modalWidth: "tw-max-w-md",
92
+ },
93
+ parameters: {
94
+ docs: {
95
+ description: {
96
+ component: `
97
+ VcPopup is a versatile modal dialog component used to display information, alerts, or forms on top of the main content.
98
+ It supports different variants, fullscreen modes, and customization through props and slots.
99
+
100
+ ## Features
101
+ - Customizable title and content.
102
+ - Support for different visual variants (default, error, warning, success, info).
103
+ - Optional fullscreen mode for mobile and desktop.
104
+ - Control over closability.
105
+ - Custom modal width using Tailwind CSS classes.
106
+ - Slots for header, content, and footer customization.
107
+
108
+ ## Usage
109
+
110
+ \`\`\`vue
111
+ <VcPopup
112
+ title="My Popup"
113
+ :closable="true"
114
+ variant="info"
115
+ @close="handleClose"
116
+ >
117
+ <template #content>
118
+ <p>This is the content of the popup.</p>
119
+ </template>
120
+ <template #footer="{ close }">
121
+ <VcButton @click="close">Custom Close</VcButton>
122
+ </template>
123
+ </VcPopup>
124
+ \`\`\`
125
+ `,
126
+ },
127
+ },
128
+ },
129
+ } satisfies Meta<typeof VcPopup>;
130
+
131
+ export default meta;
132
+ type Story = StoryObj<typeof meta>;
133
+
134
+ /**
135
+ * This is the default VcPopup. It displays with a standard title and content.
136
+ * The visibility is controlled by a local ref \`showPopup\`.
137
+ */
138
+ export const Default: Story = {
139
+ render: (args) => ({
140
+ components: { VcPopup, VcButton },
141
+ setup() {
142
+ const showPopup = ref(false);
143
+ const openPopup = () => (showPopup.value = true);
144
+ const closePopup = () => {
145
+ showPopup.value = false;
146
+ args.onClose?.();
147
+ };
148
+ return { args, showPopup, openPopup, closePopup };
149
+ },
150
+ template: `
151
+ <div>
152
+ <VcButton @click="openPopup">Open Default Popup</VcButton>
153
+ <VcPopup v-if="showPopup" v-bind="args" @close="closePopup" >
154
+ <template #content>
155
+ <p class="tw-p-4">This is the main content of the default popup. You can put any HTML structure here.</p>
156
+ <p class="tw-p-4">Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
157
+ </template>
158
+ </VcPopup>
159
+ </div>
160
+ `,
161
+ }),
162
+ args: {
163
+ title: "Default Popup",
164
+ },
165
+ parameters: {
166
+ docs: {
167
+ description: {
168
+ story: "A basic example of VcPopup with a title and simple text content.",
169
+ },
170
+ },
171
+ },
172
+ };
173
+
174
+ /**
175
+ * VcPopup can display different variants. This story shows all available variants side-by-side.
176
+ * Variants include: default, error, warning, success, and info.
177
+ */
178
+ export const Variants: Story = {
179
+ render: (args) => ({
180
+ components: { VcPopup, VcButton },
181
+ setup() {
182
+ const variants = ["default", "error", "warning", "success", "info"] as const;
183
+ type Variant = (typeof variants)[number];
184
+ const showPopup = ref<Record<Variant, boolean>>(
185
+ variants.reduce((acc, v) => ({ ...acc, [v]: false }), {} as Record<Variant, boolean>),
186
+ );
187
+ const openPopup = (variant: Variant) => (showPopup.value[variant] = true);
188
+ const closePopup = (variant: Variant) => {
189
+ showPopup.value[variant] = false;
190
+ args.onClose?.();
191
+ };
192
+ return { args, variants, showPopup, openPopup, closePopup };
193
+ },
194
+ template: `
195
+ <div class="tw-flex tw-flex-wrap tw-gap-4">
196
+ <div v-for="variant in variants" :key="variant">
197
+ <VcButton @click="openPopup(variant)">Open {{ variant }} Popup</VcButton>
198
+ <VcPopup
199
+ v-if="showPopup[variant]"
200
+ v-bind="args"
201
+ :title="variant.charAt(0).toUpperCase() + variant.slice(1) + ' Variant Popup'"
202
+ :variant="variant"
203
+ @close="() => closePopup(variant)"
204
+ >
205
+ <template #content>
206
+ <p class="tw-p-4">This is a popup with the <strong>{{ variant }}</strong> variant.</p>
207
+ <p class="tw-p-4">It includes a relevant icon and specific styling if defined.</p>
208
+ </template>
209
+ </VcPopup>
210
+ </div>
211
+ </div>
212
+ `,
213
+ }),
214
+ parameters: {
215
+ docs: {
216
+ description: {
217
+ story:
218
+ "Demonstrates all available variants of the VcPopup: default, error, warning, success, and info. Each variant might have a distinct icon and color scheme.",
219
+ },
220
+ },
221
+ },
222
+ };
223
+
224
+ /**
225
+ * VcPopup with a custom footer. The footer slot provides access to a \`close\` function.
226
+ */
227
+ export const WithFooter: Story = {
228
+ render: (args) => ({
229
+ components: { VcPopup, VcButton },
230
+ setup() {
231
+ const showPopup = ref(false);
232
+ const openPopup = () => (showPopup.value = true);
233
+ const closePopup = () => {
234
+ showPopup.value = false;
235
+ args.onClose?.();
236
+ };
237
+ return { args, showPopup, openPopup, closePopup };
238
+ },
239
+ template: `
240
+ <div>
241
+ <VcButton @click="openPopup">Open Popup with Footer</VcButton>
242
+ <VcPopup v-if="showPopup" v-bind="args" @close="closePopup" >
243
+ <template #content>
244
+ <p class="tw-p-4">This popup has a custom footer section.</p>
245
+ </template>
246
+ <template #footer="{ close }">
247
+ <div class="tw-flex tw-justify-end tw-w-full tw-gap-3">
248
+ <VcButton variant="outline" @click="close">Cancel</VcButton>
249
+ <VcButton color="primary" @click="() => { alert('Confirmed!'); close(); }">Confirm</VcButton>
250
+ </div>
251
+ </template>
252
+ </VcPopup>
253
+ </div>
254
+ `,
255
+ }),
256
+ args: {
257
+ title: "Popup with Custom Footer",
258
+ },
259
+ parameters: {
260
+ docs: {
261
+ description: {
262
+ story:
263
+ "This story demonstrates how to use the `footer` slot to add custom action buttons or other content to the bottom of the popup. The slot scope provides a `close` function to close the popup.",
264
+ },
265
+ },
266
+ },
267
+ };
268
+
269
+ /**
270
+ * VcPopup in fullscreen mode. The \`isFullscreen\` prop makes the popup cover the entire screen.
271
+ * The \`isMobileFullscreen\` prop can be used for fullscreen behavior only on mobile devices.
272
+ */
273
+ export const Fullscreen: Story = {
274
+ render: (args) => ({
275
+ components: { VcPopup, VcButton },
276
+ setup() {
277
+ const showPopup = ref(false);
278
+ const openPopup = () => (showPopup.value = true);
279
+ const closePopup = () => {
280
+ showPopup.value = false;
281
+ args.onClose?.();
282
+ };
283
+ return { args, showPopup, openPopup, closePopup };
284
+ },
285
+ template: `
286
+ <div>
287
+ <VcButton @click="openPopup">Open Fullscreen Popup</VcButton>
288
+ <VcPopup v-if="showPopup" v-bind="args" @close="closePopup" >
289
+ <template #content>
290
+ <div class="tw-p-4 tw-bg-gray-100 tw-h-full tw-w-full tw-flex tw-items-center tw-justify-center">
291
+ <p>This popup is in fullscreen mode.</p>
292
+ </div>
293
+ </template>
294
+ </VcPopup>
295
+ </div>
296
+ `,
297
+ }),
298
+ args: {
299
+ title: "Fullscreen Popup",
300
+ isFullscreen: true,
301
+ },
302
+ parameters: {
303
+ docs: {
304
+ description: {
305
+ story:
306
+ "Shows the VcPopup in fullscreen mode using the `isFullscreen` prop. For mobile-only fullscreen, use `isMobileFullscreen`.",
307
+ },
308
+ },
309
+ },
310
+ };
311
+
312
+ /**
313
+ * VcPopup with a custom width. The \`modalWidth\` prop accepts Tailwind CSS width classes.
314
+ */
315
+ export const CustomWidth: Story = {
316
+ render: (args) => ({
317
+ components: { VcPopup, VcButton },
318
+ setup() {
319
+ const showPopup = ref(false);
320
+ const openPopup = () => (showPopup.value = true);
321
+ const closePopup = () => {
322
+ showPopup.value = false;
323
+ args.onClose?.();
324
+ };
325
+ return { args, showPopup, openPopup, closePopup };
326
+ },
327
+ template: `
328
+ <div>
329
+ <VcButton @click="openPopup">Open Custom Width Popup</VcButton>
330
+ <VcPopup v-if="showPopup" v-bind="args" @close="closePopup" >
331
+ <template #content>
332
+ <p class="tw-p-4">This popup has a custom width defined by the \`modalWidth\` prop.</p>
333
+ <p class="tw-p-4">Current width class: <strong>{{ args.modalWidth }}</strong></p>
334
+ </template>
335
+ </VcPopup>
336
+ </div>
337
+ `,
338
+ }),
339
+ args: {
340
+ title: "Custom Width Popup",
341
+ modalWidth: "tw-max-w-xl", // Example: 'tw-max-w-lg', 'tw-w-1/2'
342
+ },
343
+ parameters: {
344
+ docs: {
345
+ description: {
346
+ story:
347
+ "Demonstrates how to set a custom width for the VcPopup using the `modalWidth` prop. Any valid Tailwind CSS max-width or width class can be used.",
348
+ },
349
+ },
350
+ },
351
+ };
352
+
353
+ /**
354
+ * VcPopup with a custom header using the header slot.
355
+ * This overrides the \`title\` prop.
356
+ */
357
+ export const CustomHeader: Story = {
358
+ render: (args) => ({
359
+ components: { VcPopup, VcButton, VcIcon },
360
+ setup() {
361
+ const showPopup = ref(false);
362
+ const openPopup = () => (showPopup.value = true);
363
+ const closePopup = () => {
364
+ showPopup.value = false;
365
+ args.onClose?.();
366
+ };
367
+ return { args, showPopup, openPopup, closePopup };
368
+ },
369
+ template: `
370
+ <div>
371
+ <VcButton @click="openPopup">Open Popup with Custom Header</VcButton>
372
+ <VcPopup v-if="showPopup" v-bind="args" @close="closePopup" >
373
+ <template #header>
374
+ <div class="tw-flex tw-items-center tw-gap-2">
375
+ <VcIcon icon="material-settings" class="tw-text-blue-500" />
376
+ <span class="tw-font-bold tw-text-blue-500">Custom Settings Panel</span>
377
+ </div>
378
+ </template>
379
+ <template #content>
380
+ <p class="tw-p-4">This popup uses the <strong>#header</strong> slot for a completely custom header.</p>
381
+ </template>
382
+ </VcPopup>
383
+ </div>
384
+ `,
385
+ }),
386
+ args: {
387
+ // Title prop is not used here as the slot overrides it
388
+ title: "This title will be overridden",
389
+ },
390
+ parameters: {
391
+ docs: {
392
+ description: {
393
+ story:
394
+ "Shows how to use the `header` slot to provide a fully custom header for the VcPopup. This will replace the default title rendering.",
395
+ },
396
+ },
397
+ },
398
+ };
@@ -124,7 +124,7 @@
124
124
  import { Ref, computed, inject } from "vue";
125
125
  import { TransitionRoot, TransitionChild, Dialog, DialogPanel, DialogTitle } from "@headlessui/vue";
126
126
 
127
- interface Props {
127
+ export interface Props {
128
128
  title?: string;
129
129
  closable?: boolean;
130
130
  variant?: "default" | "error" | "warning" | "success" | "info";