@dskripchenko/laravel-admin 1.1.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.
Files changed (163) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +226 -0
  3. package/dist/.gitkeep +0 -0
  4. package/dist/api/bootstrap.d.ts +38 -0
  5. package/dist/api/bootstrap.test.d.ts +1 -0
  6. package/dist/api/client.d.ts +30 -0
  7. package/dist/api/client.test.d.ts +1 -0
  8. package/dist/api/envelope.d.ts +24 -0
  9. package/dist/api/envelope.test.d.ts +1 -0
  10. package/dist/api/errors.d.ts +40 -0
  11. package/dist/api/errors.test.d.ts +1 -0
  12. package/dist/components/AdminApp.vue.d.ts +2 -0
  13. package/dist/components/ForbiddenPage.vue.d.ts +2 -0
  14. package/dist/components/HomePage.vue.d.ts +2 -0
  15. package/dist/components/NotFoundPage.vue.d.ts +2 -0
  16. package/dist/components/SettingsPage.vue.d.ts +2 -0
  17. package/dist/components/UnknownScreenPage.vue.d.ts +2 -0
  18. package/dist/components/auth/LoginForm.test.d.ts +1 -0
  19. package/dist/components/auth/LoginForm.vue.d.ts +17 -0
  20. package/dist/components/auth/LoginPage.test.d.ts +1 -0
  21. package/dist/components/auth/LoginPage.vue.d.ts +26 -0
  22. package/dist/components/auth/TwoFactorForm.test.d.ts +1 -0
  23. package/dist/components/auth/TwoFactorForm.vue.d.ts +8 -0
  24. package/dist/components/auth/index.d.ts +6 -0
  25. package/dist/components/createComponentRegistry.d.ts +22 -0
  26. package/dist/components/dashboard/BarChartWidget.vue.d.ts +18 -0
  27. package/dist/components/dashboard/DashboardPage.test.d.ts +1 -0
  28. package/dist/components/dashboard/DashboardPage.vue.d.ts +28 -0
  29. package/dist/components/dashboard/DonutChartWidget.vue.d.ts +13 -0
  30. package/dist/components/dashboard/GaugeWidget.vue.d.ts +29 -0
  31. package/dist/components/dashboard/HeatmapWidget.vue.d.ts +18 -0
  32. package/dist/components/dashboard/MarkdownWidget.vue.d.ts +8 -0
  33. package/dist/components/dashboard/RecentTableWidget.vue.d.ts +12 -0
  34. package/dist/components/dashboard/StatWidget.vue.d.ts +22 -0
  35. package/dist/components/dashboard/UnknownWidget.vue.d.ts +5 -0
  36. package/dist/components/dashboard/WidgetRenderer.vue.d.ts +10 -0
  37. package/dist/components/dashboard/builtin.d.ts +4 -0
  38. package/dist/components/dashboard/index.d.ts +16 -0
  39. package/dist/components/dashboard/registry.d.ts +25 -0
  40. package/dist/components/dashboard/registry.test.d.ts +1 -0
  41. package/dist/components/fields/CheckboxField.vue.d.ts +16 -0
  42. package/dist/components/fields/DateField.vue.d.ts +25 -0
  43. package/dist/components/fields/NumberField.vue.d.ts +24 -0
  44. package/dist/components/fields/SelectField.vue.d.ts +28 -0
  45. package/dist/components/fields/TextAreaField.vue.d.ts +20 -0
  46. package/dist/components/fields/TextField.vue.d.ts +22 -0
  47. package/dist/components/fields/UnknownField.vue.d.ts +6 -0
  48. package/dist/components/fields/fields.test.d.ts +1 -0
  49. package/dist/components/fields/wysiwyg/quill/QuillField.vue.d.ts +26 -0
  50. package/dist/components/fields/wysiwyg/quill/index.d.ts +12 -0
  51. package/dist/components/fields/wysiwyg/tinymce/TinymceField.vue.d.ts +31 -0
  52. package/dist/components/fields/wysiwyg/tinymce/index.d.ts +12 -0
  53. package/dist/components/gallery/FieldGalleryPage.test.d.ts +1 -0
  54. package/dist/components/gallery/FieldGalleryPage.vue.d.ts +2 -0
  55. package/dist/components/gallery/index.d.ts +1 -0
  56. package/dist/components/import/ImportWizardPage.test.d.ts +1 -0
  57. package/dist/components/import/ImportWizardPage.vue.d.ts +59 -0
  58. package/dist/components/import/index.d.ts +1 -0
  59. package/dist/components/infolist/BadgeEntry.vue.d.ts +18 -0
  60. package/dist/components/infolist/IconEntry.vue.d.ts +22 -0
  61. package/dist/components/infolist/InfolistRenderer.test.d.ts +1 -0
  62. package/dist/components/infolist/InfolistRenderer.vue.d.ts +11 -0
  63. package/dist/components/infolist/KeyValueEntry.vue.d.ts +11 -0
  64. package/dist/components/infolist/TextEntry.vue.d.ts +17 -0
  65. package/dist/components/infolist/UnknownEntry.vue.d.ts +6 -0
  66. package/dist/components/infolist/builtin.d.ts +4 -0
  67. package/dist/components/infolist/index.d.ts +13 -0
  68. package/dist/components/infolist/recordContext.d.ts +9 -0
  69. package/dist/components/infolist/registry.d.ts +19 -0
  70. package/dist/components/infolist/registry.test.d.ts +1 -0
  71. package/dist/components/layouts/ColumnsLayout.vue.d.ts +13 -0
  72. package/dist/components/layouts/RowsLayout.vue.d.ts +10 -0
  73. package/dist/components/layouts/SectionLayout.vue.d.ts +11 -0
  74. package/dist/components/layouts/TabsLayout.vue.d.ts +22 -0
  75. package/dist/components/notifications/NotificationsDrawer.test.d.ts +1 -0
  76. package/dist/components/notifications/NotificationsDrawer.vue.d.ts +13 -0
  77. package/dist/components/notifications/index.d.ts +1 -0
  78. package/dist/components/profile/ProfilePage.test.d.ts +1 -0
  79. package/dist/components/profile/ProfilePage.vue.d.ts +50 -0
  80. package/dist/components/profile/index.d.ts +1 -0
  81. package/dist/components/render/FieldRenderer.test.d.ts +1 -0
  82. package/dist/components/render/FieldRenderer.vue.d.ts +9 -0
  83. package/dist/components/render/LayoutRenderer.test.d.ts +1 -0
  84. package/dist/components/render/LayoutRenderer.vue.d.ts +10 -0
  85. package/dist/components/render/builtin.d.ts +9 -0
  86. package/dist/components/render/formState.d.ts +36 -0
  87. package/dist/components/render/formState.test.d.ts +1 -0
  88. package/dist/components/render/index.d.ts +23 -0
  89. package/dist/components/render/registry.d.ts +35 -0
  90. package/dist/components/render/registry.test.d.ts +1 -0
  91. package/dist/components/resource/ResourceFormPage.test.d.ts +1 -0
  92. package/dist/components/resource/ResourceFormPage.vue.d.ts +13 -0
  93. package/dist/components/resource/ResourceIndexPage.test.d.ts +1 -0
  94. package/dist/components/resource/ResourceIndexPage.vue.d.ts +44 -0
  95. package/dist/components/resource/ResourceViewPage.test.d.ts +1 -0
  96. package/dist/components/resource/ResourceViewPage.vue.d.ts +13 -0
  97. package/dist/components/resource/index.d.ts +6 -0
  98. package/dist/components/shell/AdminShell.vue.d.ts +35 -0
  99. package/dist/components/shell/AdminSidebar.test.d.ts +1 -0
  100. package/dist/components/shell/AdminSidebar.vue.d.ts +27 -0
  101. package/dist/components/shell/AdminTopBar.test.d.ts +1 -0
  102. package/dist/components/shell/AdminTopBar.vue.d.ts +33 -0
  103. package/dist/components/shell/index.d.ts +18 -0
  104. package/dist/components/shell/widgets/LocaleSwitcher.test.d.ts +1 -0
  105. package/dist/components/shell/widgets/LocaleSwitcher.vue.d.ts +2 -0
  106. package/dist/components/shell/widgets/NotificationBell.vue.d.ts +2 -0
  107. package/dist/components/shell/widgets/ThemeToggle.test.d.ts +1 -0
  108. package/dist/components/shell/widgets/ThemeToggle.vue.d.ts +2 -0
  109. package/dist/components/shell/widgets/UserMenu.test.d.ts +1 -0
  110. package/dist/components/shell/widgets/UserMenu.vue.d.ts +2 -0
  111. package/dist/createAdminApp.d.ts +85 -0
  112. package/dist/createAdminApp.test.d.ts +1 -0
  113. package/dist/formState-DGNcH1XQ.js +40 -0
  114. package/dist/formState-DGNcH1XQ.js.map +1 -0
  115. package/dist/formState-GlJBphEn.cjs +2 -0
  116. package/dist/formState-GlJBphEn.cjs.map +1 -0
  117. package/dist/index.cjs +2 -0
  118. package/dist/index.cjs.map +1 -0
  119. package/dist/index.d.ts +62 -0
  120. package/dist/index.mjs +4345 -0
  121. package/dist/index.mjs.map +1 -0
  122. package/dist/quill.cjs +2 -0
  123. package/dist/quill.cjs.map +1 -0
  124. package/dist/quill.mjs +71 -0
  125. package/dist/quill.mjs.map +1 -0
  126. package/dist/router/builder.d.ts +52 -0
  127. package/dist/router/builder.test.d.ts +1 -0
  128. package/dist/router/guards.d.ts +56 -0
  129. package/dist/router/guards.test.d.ts +1 -0
  130. package/dist/router/index.d.ts +63 -0
  131. package/dist/router/index.test.d.ts +1 -0
  132. package/dist/stores/auth.d.ts +142 -0
  133. package/dist/stores/auth.test.d.ts +1 -0
  134. package/dist/stores/index.d.ts +21 -0
  135. package/dist/stores/locale.d.ts +29 -0
  136. package/dist/stores/locale.test.d.ts +1 -0
  137. package/dist/stores/manifest.d.ts +515 -0
  138. package/dist/stores/manifest.test.d.ts +1 -0
  139. package/dist/stores/menu.d.ts +215 -0
  140. package/dist/stores/menu.test.d.ts +1 -0
  141. package/dist/stores/notifications.d.ts +137 -0
  142. package/dist/stores/notifications.test.d.ts +1 -0
  143. package/dist/stores/registry.d.ts +16 -0
  144. package/dist/stores/registry.test.d.ts +1 -0
  145. package/dist/stores/resourceForm.d.ts +91 -0
  146. package/dist/stores/resourceForm.test.d.ts +1 -0
  147. package/dist/stores/resourceIndex.d.ts +149 -0
  148. package/dist/stores/resourceIndex.test.d.ts +1 -0
  149. package/dist/stores/theme.d.ts +29 -0
  150. package/dist/stores/theme.test.d.ts +1 -0
  151. package/dist/style.css +1 -0
  152. package/dist/tinymce.cjs +2 -0
  153. package/dist/tinymce.cjs.map +1 -0
  154. package/dist/tinymce.mjs +80 -0
  155. package/dist/tinymce.mjs.map +1 -0
  156. package/dist/types/bootstrap.d.ts +50 -0
  157. package/package.json +162 -0
  158. package/resources/fonts/InterDisplay-Bold.woff2 +0 -0
  159. package/resources/fonts/InterDisplay-ExtraBold.woff2 +0 -0
  160. package/resources/fonts/InterDisplay-SemiBold.woff2 +0 -0
  161. package/resources/fonts/InterVariable-Italic.woff2 +0 -0
  162. package/resources/fonts/InterVariable.woff2 +0 -0
  163. package/resources/fonts/fonts.css +69 -0
@@ -0,0 +1,22 @@
1
+ import type { LayoutNode } from '../render/LayoutRenderer.vue';
2
+ export interface TabNode {
3
+ /** Уникальный ключ вкладки. Если не задан — берётся индекс. */
4
+ key?: string;
5
+ /** Текст вкладки. */
6
+ label: string;
7
+ icon?: string | null;
8
+ items: LayoutNode[];
9
+ }
10
+ interface Props {
11
+ items: TabNode[];
12
+ /** Активная вкладка (key либо индекс при отсутствии key). */
13
+ active?: string | number;
14
+ }
15
+ declare const _default: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
16
+ "update:active": (value: string | number) => any;
17
+ }, string, import("vue").PublicProps, Readonly<Props> & Readonly<{
18
+ "onUpdate:active"?: ((value: string | number) => any) | undefined;
19
+ }>, {
20
+ active: string | number;
21
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
22
+ export default _default;
@@ -0,0 +1,13 @@
1
+ import { type NotificationItem } from '../../stores/notifications';
2
+ interface Props {
3
+ /** v-model:open. */
4
+ open: boolean;
5
+ }
6
+ declare const _default: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
7
+ "update:open": (value: boolean) => any;
8
+ "select-item": (item: NotificationItem) => any;
9
+ }, string, import("vue").PublicProps, Readonly<Props> & Readonly<{
10
+ "onUpdate:open"?: ((value: boolean) => any) | undefined;
11
+ "onSelect-item"?: ((item: NotificationItem) => any) | undefined;
12
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
13
+ export default _default;
@@ -0,0 +1 @@
1
+ export { default as NotificationsDrawer } from './NotificationsDrawer.vue';
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,50 @@
1
+ interface Props {
2
+ /** Заголовок страницы (по умолчанию «Profile»). */
3
+ title?: string;
4
+ /** Подзаголовок (по умолчанию из handoff'а). */
5
+ subtitle?: string;
6
+ /** Какая section активна. */
7
+ section?: 'general' | 'security' | 'tokens' | 'sessions' | string;
8
+ }
9
+ declare var __VLS_65: {}, __VLS_72: string, __VLS_73: {
10
+ section: string;
11
+ };
12
+ type __VLS_Slots = {} & {
13
+ [K in NonNullable<typeof __VLS_72>]?: (props: typeof __VLS_73) => any;
14
+ } & {
15
+ 'enable-2fa'?: (props: typeof __VLS_65) => any;
16
+ };
17
+ declare const __VLS_component: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
18
+ save: (payload: {
19
+ name: string;
20
+ email: string;
21
+ locale: string;
22
+ theme: string;
23
+ }) => any;
24
+ "update:section": (value: string) => any;
25
+ "avatar-replace": () => any;
26
+ "two-factor-disable": () => any;
27
+ "two-factor-regenerate": () => any;
28
+ }, string, import("vue").PublicProps, Readonly<Props> & Readonly<{
29
+ onSave?: ((payload: {
30
+ name: string;
31
+ email: string;
32
+ locale: string;
33
+ theme: string;
34
+ }) => any) | undefined;
35
+ "onUpdate:section"?: ((value: string) => any) | undefined;
36
+ "onAvatar-replace"?: (() => any) | undefined;
37
+ "onTwo-factor-disable"?: (() => any) | undefined;
38
+ "onTwo-factor-regenerate"?: (() => any) | undefined;
39
+ }>, {
40
+ section: "general" | "security" | "tokens" | "sessions" | string;
41
+ title: string;
42
+ subtitle: string;
43
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
44
+ declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
45
+ export default _default;
46
+ type __VLS_WithSlots<T, S> = T & {
47
+ new (): {
48
+ $slots: S;
49
+ };
50
+ };
@@ -0,0 +1 @@
1
+ export { default as ProfilePage } from './ProfilePage.vue';
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,9 @@
1
+ export interface FieldNode extends Record<string, unknown> {
2
+ type: string;
3
+ name: string;
4
+ }
5
+ interface Props {
6
+ node: FieldNode;
7
+ }
8
+ declare const _default: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
9
+ export default _default;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,10 @@
1
+ export interface LayoutNode extends Record<string, unknown> {
2
+ type: string;
3
+ kind?: 'field' | 'layout';
4
+ items?: LayoutNode[];
5
+ }
6
+ interface Props {
7
+ node: LayoutNode;
8
+ }
9
+ declare const _default: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
10
+ export default _default;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Default-bundle с минимальным набором builtin-компонентов.
3
+ *
4
+ * Использование:
5
+ *
6
+ * import { registerBuiltinComponents } from '@dskripchenko/laravel-admin'
7
+ * registerBuiltinComponents()
8
+ */
9
+ export declare function registerBuiltinComponents(): void;
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Composable для form-state: предоставляет state + ошибки через provide/inject.
3
+ *
4
+ * Контейнер (Resource form / Settings page) вызывает `provideFormState()`,
5
+ * Field-компоненты в дереве — `useFormState()` для чтения значения и
6
+ * мутации поля.
7
+ *
8
+ * State — reactive proxy; setField мутирует ключ. Errors — отдельный
9
+ * reactive Map (field-name → string[] messages).
10
+ */
11
+ export interface FormStateContext {
12
+ state: Record<string, unknown>;
13
+ errors: Record<string, string[]>;
14
+ setField: (name: string, value: unknown) => void;
15
+ getField: (name: string) => unknown;
16
+ setError: (name: string, messages: string[] | null) => void;
17
+ setErrors: (next: Record<string, string[]>) => void;
18
+ clearErrors: () => void;
19
+ }
20
+ /**
21
+ * Создаёт form-context и provid'ит его потомкам.
22
+ *
23
+ * Переданный `initial`-object оборачивается в `reactive()` — мутации stora
24
+ * видны и снаружи (caller владеет state'ом и может его читать после submit'а).
25
+ *
26
+ * @param initial Начальные значения state'а.
27
+ * @param initialErrors Начальные ошибки (для повторного render'а после
28
+ * ValidationError).
29
+ */
30
+ export declare function provideFormState(initial?: Record<string, unknown>, initialErrors?: Record<string, string[]>): FormStateContext;
31
+ /**
32
+ * Получить form-context. Throws, если не вызван внутри `provideFormState()`.
33
+ */
34
+ export declare function useFormState(): FormStateContext;
35
+ /** Опционально получить (null если нет). */
36
+ export declare function tryUseFormState(): FormStateContext | null;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Public exports JSON-driven рендеринга.
3
+ */
4
+ export { default as FieldRenderer } from './FieldRenderer.vue';
5
+ export type { FieldNode } from './FieldRenderer.vue';
6
+ export { default as LayoutRenderer } from './LayoutRenderer.vue';
7
+ export type { LayoutNode } from './LayoutRenderer.vue';
8
+ export { registerField, registerLayout, getField, getLayout, hasField, hasLayout, listFields, listLayouts, clearRegistry, registerComponents, } from './registry';
9
+ export type { ComponentBundle } from './registry';
10
+ export { registerBuiltinComponents } from './builtin';
11
+ export { provideFormState, useFormState, tryUseFormState, } from './formState';
12
+ export type { FormStateContext } from './formState';
13
+ export { default as TextField } from '../fields/TextField.vue';
14
+ export { default as TextAreaField } from '../fields/TextAreaField.vue';
15
+ export { default as NumberField } from '../fields/NumberField.vue';
16
+ export { default as SelectField } from '../fields/SelectField.vue';
17
+ export { default as CheckboxField } from '../fields/CheckboxField.vue';
18
+ export { default as DateField } from '../fields/DateField.vue';
19
+ export { default as UnknownField } from '../fields/UnknownField.vue';
20
+ export { default as RowsLayout } from '../layouts/RowsLayout.vue';
21
+ export { default as ColumnsLayout } from '../layouts/ColumnsLayout.vue';
22
+ export { default as SectionLayout } from '../layouts/SectionLayout.vue';
23
+ export { default as TabsLayout } from '../layouts/TabsLayout.vue';
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Реестр Vue-компонентов для JSON-driven рендеринга.
3
+ *
4
+ * Содержит две Map'ы — для `field`-типов (input'ы, контролы) и для
5
+ * `layout`-типов (контейнеры). LayoutRenderer и FieldRenderer резолвят тип
6
+ * через эти реестры; host-проект может зарегистрировать кастомные компоненты
7
+ * через `registerField()` / `registerLayout()`.
8
+ *
9
+ * Singleton — один регистр на admin-instance. Тестовый сценарий —
10
+ * `clearRegistry()` + `registerField()` в `beforeEach`.
11
+ */
12
+ import type { Component } from 'vue';
13
+ export declare const registerField: (type: string, value: Component) => void;
14
+ export declare const getField: (type: string) => Component | null;
15
+ export declare const hasField: (type: string) => boolean;
16
+ export declare const listFields: () => string[];
17
+ export declare const registerLayout: (type: string, value: Component) => void;
18
+ export declare const getLayout: (type: string) => Component | null;
19
+ export declare const hasLayout: (type: string) => boolean;
20
+ export declare const listLayouts: () => string[];
21
+ /** Очистить оба реестра. Используется в тестах. */
22
+ export declare function clearRegistry(): void;
23
+ /**
24
+ * Зарегистрировать сразу несколько компонентов.
25
+ *
26
+ * registerComponents({
27
+ * fields: { text: TextField, select: SelectField },
28
+ * layouts: { rows: RowsLayout, tabs: TabsLayout },
29
+ * })
30
+ */
31
+ export interface ComponentBundle {
32
+ fields?: Record<string, Component>;
33
+ layouts?: Record<string, Component>;
34
+ }
35
+ export declare function registerComponents(bundle: ComponentBundle): void;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,13 @@
1
+ interface Props {
2
+ /** Slug ресурса (articles/users/etc). */
3
+ slug: string;
4
+ /** ID записи. null/undefined → create-mode; число/строка → edit. */
5
+ id?: string | number | null;
6
+ /** Имя router-route на index page (для back-redirect после save/delete). */
7
+ indexRouteName?: string;
8
+ }
9
+ declare const _default: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
10
+ id: string | number | null;
11
+ indexRouteName: string;
12
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
13
+ export default _default;
@@ -0,0 +1,44 @@
1
+ interface Props {
2
+ /** Slug ресурса (users/articles/etc). */
3
+ slug: string;
4
+ /** Заголовок страницы. Если не задан — берётся из manifest'а. */
5
+ title?: string | null;
6
+ /** Подпись под заголовком (например "Аналитика контента"). */
7
+ subtitle?: string | null;
8
+ /** Текст primary-кнопки «Создать». */
9
+ createLabel?: string;
10
+ /** Имя router-route для action «Создать». */
11
+ createRouteName?: string | null;
12
+ }
13
+ declare var __VLS_1: {}, __VLS_51: {
14
+ filters: Record<string, unknown>;
15
+ setFilter: (key: string, value: unknown) => Promise<void>;
16
+ }, __VLS_106: `cell-${string}`, __VLS_107: {
17
+ row: Record<string, unknown> | undefined;
18
+ };
19
+ type __VLS_Slots = {} & {
20
+ [K in NonNullable<typeof __VLS_106>]?: (props: typeof __VLS_107) => any;
21
+ } & {
22
+ actions?: (props: typeof __VLS_1) => any;
23
+ } & {
24
+ filters?: (props: typeof __VLS_51) => any;
25
+ };
26
+ declare const __VLS_component: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
27
+ "bulk-action": (action: string, ids: (string | number)[]) => any;
28
+ "row-click": (row: Record<string, unknown>) => any;
29
+ }, string, import("vue").PublicProps, Readonly<Props> & Readonly<{
30
+ "onBulk-action"?: ((action: string, ids: (string | number)[]) => any) | undefined;
31
+ "onRow-click"?: ((row: Record<string, unknown>) => any) | undefined;
32
+ }>, {
33
+ title: string | null;
34
+ subtitle: string | null;
35
+ createLabel: string;
36
+ createRouteName: string | null;
37
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
38
+ declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
39
+ export default _default;
40
+ type __VLS_WithSlots<T, S> = T & {
41
+ new (): {
42
+ $slots: S;
43
+ };
44
+ };
@@ -0,0 +1,13 @@
1
+ interface Props {
2
+ slug: string;
3
+ id: string | number;
4
+ /** Имя router-route для перехода в edit. */
5
+ editRouteName?: string;
6
+ /** Имя router-route для возврата на index. */
7
+ indexRouteName?: string;
8
+ }
9
+ declare const _default: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
10
+ indexRouteName: string;
11
+ editRouteName: string;
12
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
13
+ export default _default;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Public exports resource-страниц admin'а.
3
+ */
4
+ export { default as ResourceIndexPage } from './ResourceIndexPage.vue';
5
+ export { default as ResourceFormPage } from './ResourceFormPage.vue';
6
+ export { default as ResourceViewPage } from './ResourceViewPage.vue';
@@ -0,0 +1,35 @@
1
+ interface ImpersonationData {
2
+ /** Имя того, в кого вошли. */
3
+ asName: string;
4
+ }
5
+ interface Props {
6
+ /** Сворачивание сайдбара. */
7
+ collapsed?: boolean;
8
+ /** Если задано — показывает amber-banner и сдвигает контент. */
9
+ impersonation?: ImpersonationData | null;
10
+ }
11
+ declare var __VLS_9: {}, __VLS_14: {}, __VLS_23: {};
12
+ type __VLS_Slots = {} & {
13
+ sidebar?: (props: typeof __VLS_9) => any;
14
+ } & {
15
+ topbar?: (props: typeof __VLS_14) => any;
16
+ } & {
17
+ default?: (props: typeof __VLS_23) => any;
18
+ };
19
+ declare const __VLS_component: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
20
+ "update:collapsed": (value: boolean) => any;
21
+ "exit-impersonation": () => any;
22
+ }, string, import("vue").PublicProps, Readonly<Props> & Readonly<{
23
+ "onUpdate:collapsed"?: ((value: boolean) => any) | undefined;
24
+ "onExit-impersonation"?: (() => any) | undefined;
25
+ }>, {
26
+ collapsed: boolean;
27
+ impersonation: ImpersonationData | null;
28
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
29
+ declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
30
+ export default _default;
31
+ type __VLS_WithSlots<T, S> = T & {
32
+ new (): {
33
+ $slots: S;
34
+ };
35
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,27 @@
1
+ interface Props {
2
+ collapsed?: boolean;
3
+ /** Заголовок бренда. */
4
+ brandName?: string;
5
+ /** Logo-mark (буква/инициалы) — отображается вместо логотипа. */
6
+ brandMark?: string;
7
+ /** Тенант / workspace — опционально показывается под брендом. */
8
+ tenant?: {
9
+ label: string;
10
+ name: string;
11
+ } | null;
12
+ /** Версия + ссылка на docs в footer'е. */
13
+ version?: string | null;
14
+ docsUrl?: string | null;
15
+ }
16
+ declare const _default: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
17
+ collapsed: boolean;
18
+ brandName: string;
19
+ brandMark: string;
20
+ tenant: {
21
+ label: string;
22
+ name: string;
23
+ } | null;
24
+ version: string | null;
25
+ docsUrl: string | null;
26
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
27
+ export default _default;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,33 @@
1
+ interface Crumb {
2
+ label: string;
3
+ to?: string | Record<string, unknown> | null;
4
+ }
5
+ interface Props {
6
+ /** Хлебные крошки. Последний элемент — текущая страница (без to). */
7
+ breadcrumbs?: Crumb[];
8
+ /** Показывать кнопку collapse сайдбара (только в shell-layout'е). */
9
+ showCollapseToggle?: boolean;
10
+ }
11
+ declare var __VLS_1: {}, __VLS_7: {}, __VLS_9: {};
12
+ type __VLS_Slots = {} & {
13
+ breadcrumbs?: (props: typeof __VLS_1) => any;
14
+ } & {
15
+ search?: (props: typeof __VLS_7) => any;
16
+ } & {
17
+ actions?: (props: typeof __VLS_9) => any;
18
+ };
19
+ declare const __VLS_component: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
20
+ "toggle-sidebar": () => any;
21
+ }, string, import("vue").PublicProps, Readonly<Props> & Readonly<{
22
+ "onToggle-sidebar"?: (() => any) | undefined;
23
+ }>, {
24
+ breadcrumbs: Crumb[];
25
+ showCollapseToggle: boolean;
26
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
27
+ declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
28
+ export default _default;
29
+ type __VLS_WithSlots<T, S> = T & {
30
+ new (): {
31
+ $slots: S;
32
+ };
33
+ };
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Public exports SFC-каркаса admin-панели.
3
+ *
4
+ * Использование (host-проект):
5
+ *
6
+ * import { AdminShell } from '@dskripchenko/laravel-admin'
7
+ *
8
+ * <AdminShell>
9
+ * <RouterView />
10
+ * </AdminShell>
11
+ */
12
+ export { default as AdminShell } from './AdminShell.vue';
13
+ export { default as AdminTopBar } from './AdminTopBar.vue';
14
+ export { default as AdminSidebar } from './AdminSidebar.vue';
15
+ export { default as ThemeToggle } from './widgets/ThemeToggle.vue';
16
+ export { default as LocaleSwitcher } from './widgets/LocaleSwitcher.vue';
17
+ export { default as NotificationBell } from './widgets/NotificationBell.vue';
18
+ export { default as UserMenu } from './widgets/UserMenu.vue';
@@ -0,0 +1,2 @@
1
+ declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
+ export default _default;
@@ -0,0 +1,2 @@
1
+ declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
+ export default _default;
@@ -0,0 +1,2 @@
1
+ declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
+ export default _default;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
+ export default _default;
@@ -0,0 +1,85 @@
1
+ /**
2
+ * createAdminApp — фабрика-helper для host-проектов.
3
+ *
4
+ * Собирает Vue-app со всем нужным: Pinia, Router, AdminClient, hydrated
5
+ * stores, built-in fields/layouts/widgets/infolist, default страницы.
6
+ * Возвращает объект где `app` готов к `.mount('#admin-app')`.
7
+ *
8
+ * Минимальный пример (host's resources/js/admin.js):
9
+ *
10
+ * import { createAdminApp } from '@dskripchenko/laravel-admin'
11
+ * import '@dskripchenko/laravel-admin/style.css'
12
+ *
13
+ * const { app } = createAdminApp(window.__ADMIN_BOOTSTRAP__)
14
+ * app.mount('#admin-app')
15
+ *
16
+ * Расширенное использование с переопределением страниц:
17
+ *
18
+ * const { app } = createAdminApp(window.__ADMIN_BOOTSTRAP__, {
19
+ * pages: { home: MyDashboard },
20
+ * onAppCreated: (app) => app.use(SomePlugin),
21
+ * })
22
+ */
23
+ import { type App, type Component } from 'vue';
24
+ import { type AdminClient } from './api/client';
25
+ import { type AdminRouter, type AdminRouterOptions } from './router';
26
+ import type { AdminBootstrap } from './types/bootstrap';
27
+ export interface CreateAdminAppPages {
28
+ /** Login page. По умолчанию core'овский LoginPage. */
29
+ login?: Component;
30
+ /** Главная (после login). По умолчанию HomePage. */
31
+ home?: Component;
32
+ /** 403. По умолчанию ForbiddenPage. */
33
+ forbidden?: Component;
34
+ /** 404. По умолчанию NotFoundPage. */
35
+ notFound?: Component;
36
+ /** Профиль. По умолчанию ProfilePage. */
37
+ profile?: Component;
38
+ /** Resource index/form/view. По умолчанию core'овские. */
39
+ resourceIndex?: Component;
40
+ resourceCreate?: Component;
41
+ resourceEdit?: Component;
42
+ resourceView?: Component;
43
+ /** Dashboard страница (для роутов admin.dashboard.*). */
44
+ dashboard?: Component;
45
+ /** Settings page (для admin.settings.*). */
46
+ settings?: Component;
47
+ /** Custom Screen page (для admin.screen.*). */
48
+ screen?: Component;
49
+ }
50
+ export interface CreateAdminAppOptions {
51
+ /**
52
+ * Базовый URL admin-панели. По умолчанию берётся из bootstrap.baseUrl
53
+ * (если он pathname вида '/admin'), иначе '/admin'.
54
+ */
55
+ base?: string;
56
+ /** Override отдельных страниц. */
57
+ pages?: CreateAdminAppPages;
58
+ /** Дополнительные опции router'а (extraRoutes, history, guards). */
59
+ router?: Partial<Omit<AdminRouterOptions, 'components'>>;
60
+ /** Hook для до-настройки app перед mount (app.use(plugin), app.provide(...)). */
61
+ onAppCreated?: (app: App) => void;
62
+ /**
63
+ * Не вызывать manifestStore.load() автоматически. По умолчанию false —
64
+ * createAdminApp сам подгружает manifest и выстраивает динамические роуты.
65
+ */
66
+ skipManifestLoad?: boolean;
67
+ }
68
+ export interface AdminAppHandle {
69
+ app: App;
70
+ router: AdminRouter;
71
+ client: AdminClient;
72
+ }
73
+ /**
74
+ * Создать Vue admin-app, готовый к `.mount('#admin-app')`.
75
+ *
76
+ * Шаги внутри:
77
+ * 1. Pinia + AdminClient (axios через bootstrap.csrf/apiUrl).
78
+ * 2. Hydrate auth/locale/theme/notifications stores из bootstrap.
79
+ * 3. Регистрация built-in fields/layouts/widgets/infolist entries.
80
+ * 4. Router со static-routes (login/home/profile/forbidden/notFound) +
81
+ * async manifest load → replaceManifestRoutes для resource/screen/
82
+ * settings/dashboard.
83
+ * 5. Возврат `{ app, router, client }`. Host вызывает `app.mount(...)`.
84
+ */
85
+ export declare function createAdminApp(bootstrap: AdminBootstrap, options?: CreateAdminAppOptions): AdminAppHandle;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,40 @@
1
+ import { inject as l, reactive as i, provide as u } from "vue";
2
+ const n = /* @__PURE__ */ Symbol("admin.form-state");
3
+ function a(o = {}, f = {}) {
4
+ const s = i(o), e = i({ ...f }), c = {
5
+ state: s,
6
+ errors: e,
7
+ setField(t, r) {
8
+ s[t] = r, e[t] && delete e[t];
9
+ },
10
+ getField(t) {
11
+ return s[t];
12
+ },
13
+ setError(t, r) {
14
+ r === null || r.length === 0 ? delete e[t] : e[t] = r;
15
+ },
16
+ setErrors(t) {
17
+ for (const r of Object.keys(e)) delete e[r];
18
+ Object.assign(e, t);
19
+ },
20
+ clearErrors() {
21
+ for (const t of Object.keys(e)) delete e[t];
22
+ }
23
+ };
24
+ return u(n, c), c;
25
+ }
26
+ function F() {
27
+ const o = l(n);
28
+ if (!o)
29
+ throw new Error("useFormState() called outside of provideFormState() scope");
30
+ return o;
31
+ }
32
+ function p() {
33
+ return l(n, null);
34
+ }
35
+ export {
36
+ a as p,
37
+ p as t,
38
+ F as u
39
+ };
40
+ //# sourceMappingURL=formState-DGNcH1XQ.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formState-DGNcH1XQ.js","sources":["../resources/ts/components/render/formState.ts"],"sourcesContent":["/**\n * Composable для form-state: предоставляет state + ошибки через provide/inject.\n *\n * Контейнер (Resource form / Settings page) вызывает `provideFormState()`,\n * Field-компоненты в дереве — `useFormState()` для чтения значения и\n * мутации поля.\n *\n * State — reactive proxy; setField мутирует ключ. Errors — отдельный\n * reactive Map (field-name → string[] messages).\n */\n\nimport { inject, provide, reactive, type InjectionKey } from 'vue'\n\nexport interface FormStateContext {\n state: Record<string, unknown>\n errors: Record<string, string[]>\n setField: (name: string, value: unknown) => void\n getField: (name: string) => unknown\n setError: (name: string, messages: string[] | null) => void\n setErrors: (next: Record<string, string[]>) => void\n clearErrors: () => void\n}\n\nconst FormStateKey: InjectionKey<FormStateContext> = Symbol('admin.form-state')\n\n/**\n * Создаёт form-context и provid'ит его потомкам.\n *\n * Переданный `initial`-object оборачивается в `reactive()` — мутации stora\n * видны и снаружи (caller владеет state'ом и может его читать после submit'а).\n *\n * @param initial Начальные значения state'а.\n * @param initialErrors Начальные ошибки (для повторного render'а после\n * ValidationError).\n */\nexport function provideFormState(\n initial: Record<string, unknown> = {},\n initialErrors: Record<string, string[]> = {},\n): FormStateContext {\n const state = reactive(initial)\n const errors = reactive<Record<string, string[]>>({ ...initialErrors })\n\n const ctx: FormStateContext = {\n state,\n errors,\n setField(name, value) {\n ;(state as Record<string, unknown>)[name] = value\n // Очистить ошибки этого поля при изменении — стандартный UX.\n if (errors[name]) {\n delete errors[name]\n }\n },\n getField(name) {\n return (state as Record<string, unknown>)[name]\n },\n setError(name, messages) {\n if (messages === null || messages.length === 0) {\n delete errors[name]\n } else {\n errors[name] = messages\n }\n },\n setErrors(next) {\n for (const key of Object.keys(errors)) delete errors[key]\n Object.assign(errors, next)\n },\n clearErrors() {\n for (const key of Object.keys(errors)) delete errors[key]\n },\n }\n\n provide(FormStateKey, ctx)\n return ctx\n}\n\n/**\n * Получить form-context. Throws, если не вызван внутри `provideFormState()`.\n */\nexport function useFormState(): FormStateContext {\n const ctx = inject(FormStateKey)\n if (!ctx) {\n throw new Error('useFormState() called outside of provideFormState() scope')\n }\n return ctx\n}\n\n/** Опционально получить (null если нет). */\nexport function tryUseFormState(): FormStateContext | null {\n return inject(FormStateKey, null)\n}\n"],"names":["FormStateKey","provideFormState","initial","initialErrors","state","reactive","errors","ctx","name","value","messages","next","key","provide","useFormState","inject","tryUseFormState"],"mappings":";AAuBA,MAAMA,2BAAsD,kBAAkB;AAYvE,SAASC,EACdC,IAAmC,IACnCC,IAA0C,CAAA,GACxB;AAClB,QAAMC,IAAQC,EAASH,CAAO,GACxBI,IAASD,EAAmC,EAAE,GAAGF,GAAe,GAEhEI,IAAwB;AAAA,IAC5B,OAAAH;AAAA,IACA,QAAAE;AAAA,IACA,SAASE,GAAMC,GAAO;AAClB,MAAAL,EAAkCI,CAAI,IAAIC,GAExCH,EAAOE,CAAI,KACb,OAAOF,EAAOE,CAAI;AAAA,IAEtB;AAAA,IACA,SAASA,GAAM;AACb,aAAQJ,EAAkCI,CAAI;AAAA,IAChD;AAAA,IACA,SAASA,GAAME,GAAU;AACvB,MAAIA,MAAa,QAAQA,EAAS,WAAW,IAC3C,OAAOJ,EAAOE,CAAI,IAElBF,EAAOE,CAAI,IAAIE;AAAA,IAEnB;AAAA,IACA,UAAUC,GAAM;AACd,iBAAWC,KAAO,OAAO,KAAKN,CAAM,EAAG,QAAOA,EAAOM,CAAG;AACxD,aAAO,OAAON,GAAQK,CAAI;AAAA,IAC5B;AAAA,IACA,cAAc;AACZ,iBAAWC,KAAO,OAAO,KAAKN,CAAM,EAAG,QAAOA,EAAOM,CAAG;AAAA,IAC1D;AAAA,EAAA;AAGF,SAAAC,EAAQb,GAAcO,CAAG,GAClBA;AACT;AAKO,SAASO,IAAiC;AAC/C,QAAMP,IAAMQ,EAAOf,CAAY;AAC/B,MAAI,CAACO;AACH,UAAM,IAAI,MAAM,2DAA2D;AAE7E,SAAOA;AACT;AAGO,SAASS,IAA2C;AACzD,SAAOD,EAAOf,GAAc,IAAI;AAClC;"}
@@ -0,0 +1,2 @@
1
+ "use strict";const o=require("vue"),n=Symbol("admin.form-state");function u(c={},l={}){const s=o.reactive(c),t=o.reactive({...l}),i={state:s,errors:t,setField(e,r){s[e]=r,t[e]&&delete t[e]},getField(e){return s[e]},setError(e,r){r===null||r.length===0?delete t[e]:t[e]=r},setErrors(e){for(const r of Object.keys(t))delete t[r];Object.assign(t,e)},clearErrors(){for(const e of Object.keys(t))delete t[e]}};return o.provide(n,i),i}function d(){const c=o.inject(n);if(!c)throw new Error("useFormState() called outside of provideFormState() scope");return c}function a(){return o.inject(n,null)}exports.provideFormState=u;exports.tryUseFormState=a;exports.useFormState=d;
2
+ //# sourceMappingURL=formState-GlJBphEn.cjs.map