@quazardous/qdadm 1.19.4 → 1.19.5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quazardous/qdadm",
3
- "version": "1.19.4",
3
+ "version": "1.19.5",
4
4
  "description": "Vue 3 framework for admin dashboards with PrimeVue",
5
5
  "author": "quazardous",
6
6
  "license": "MIT",
@@ -160,6 +160,7 @@ function onGuardStay(): void {
160
160
  :label="action.label"
161
161
  :icon="action.icon"
162
162
  :severity="action.severity"
163
+ :size="action.size || 'small'"
163
164
  :loading="action.isLoading"
164
165
  :disabled="action.isDisabled"
165
166
  @click="action.onClick"
@@ -25,7 +25,7 @@ import Button from 'primevue/button'
25
25
  import Select from 'primevue/select'
26
26
  import AutoComplete from 'primevue/autocomplete'
27
27
  import SplitButton from 'primevue/splitbutton'
28
- import type { FilterConfig, CardConfig, ResolvedAction, ResolvedHeaderAction as BaseResolvedHeaderAction } from '../../composables/useListPage'
28
+ import type { FilterConfig, CardConfig, ResolvedAction, ResolvedHeaderAction } from '../../composables/useListPage'
29
29
 
30
30
  /**
31
31
  * Header action state for label function (matches useListPage)
@@ -41,13 +41,6 @@ interface HeaderActionState {
41
41
  */
42
42
  type LabelType = string | ((state: HeaderActionState) => string)
43
43
 
44
- /**
45
- * Extended header action with optional size property used in template
46
- */
47
- interface ResolvedHeaderAction extends BaseResolvedHeaderAction {
48
- size?: string
49
- }
50
-
51
44
  /**
52
45
  * Autocomplete event interface
53
46
  */
@@ -79,6 +79,7 @@ export interface ActionConfig {
79
79
  label: string
80
80
  icon?: string
81
81
  severity?: string
82
+ size?: string
82
83
  onClick: () => void | Promise<void>
83
84
  visible?: (ctx: { isEdit: boolean; dirty: boolean }) => boolean
84
85
  disabled?: (ctx: { dirty: boolean; saving: boolean }) => boolean
@@ -146,6 +146,7 @@ export interface HeaderActionConfig {
146
146
  label: string | ((state: HeaderActionState) => string)
147
147
  icon?: string
148
148
  severity?: string
149
+ size?: string
149
150
  onClick: () => void | Promise<void>
150
151
  visible?: (state: HeaderActionState) => boolean
151
152
  loading?: (state: HeaderActionState) => boolean
@@ -427,9 +427,12 @@ describe('generateManagers', () => {
427
427
  // Storage must be parameterized in class mode too — same TS2322
428
428
  // assignability problem as instance mode if we drop the generic.
429
429
  expect(content).toContain('new ApiStorage<UsersEntity>(')
430
- // Constructor signature should accept a typed storage override, not `unknown`
431
- expect(content).toContain("import type { EntityRecord, IStorage } from '@quazardous/qdadm'")
432
- expect(content).toContain('storage: IStorage<UsersEntity>')
430
+ // Constructor signature delegates to the parent's options type so
431
+ // `fields: Record<string, FieldConfig>` doesn't widen on spread (TS2345).
432
+ expect(content).toContain("import type { EntityRecord, EntityManagerOptions } from '@quazardous/qdadm'")
433
+ expect(content).toContain('options: Partial<EntityManagerOptions<UsersEntity>>')
434
+ expect(content).not.toContain('Record<string, unknown>')
435
+ expect(content).not.toContain('[key: string]: unknown')
433
436
  })
434
437
  })
435
438
 
@@ -241,7 +241,7 @@ function generateManagerSource(
241
241
  */
242
242
 
243
243
  import { EntityManager } from '@quazardous/qdadm'
244
- import type { EntityRecord, IStorage } from '@quazardous/qdadm'
244
+ import type { EntityRecord, EntityManagerOptions } from '@quazardous/qdadm'
245
245
  import { ${storageClass} } from '${storageImport}'
246
246
 
247
247
  ${entityInterface}
@@ -252,7 +252,7 @@ ${entityInterface}
252
252
  * @extends EntityManager
253
253
  */
254
254
  export class Generated${className}Manager extends EntityManager<${className}Entity> {
255
- constructor(options: Partial<{ name: string; idField: string; fields: Record<string, unknown>; storage: IStorage<${className}Entity>; [key: string]: unknown }> = {}) {
255
+ constructor(options: Partial<EntityManagerOptions<${className}Entity>> = {}) {
256
256
  super({
257
257
  ...${serializeValue(managerOptions, 2)},
258
258
  storage: new ${storageClass}<${className}Entity>(${serializeValue(fullStorageOptions, 2)}),
@@ -1,45 +0,0 @@
1
- /**
2
- * TestManager - Auto-generated EntityManager
3
- *
4
- * Generated by qdadm/gen/generateManagers
5
- * DO NOT EDIT MANUALLY - Changes will be overwritten
6
- *
7
- * Entity: test
8
- * Endpoint: /test
9
- */
10
-
11
- import { EntityManager } from '@quazardous/qdadm'
12
- import { ApiStorage } from '@quazardous/qdadm'
13
-
14
- /**
15
- * Schema definition for test
16
- * @type {import('qdadm/gen').UnifiedEntitySchema}
17
- */
18
- export const testSchema = {
19
- name: "test",
20
- endpoint: "/test",
21
- fields: {}
22
- }
23
-
24
- /**
25
- * Storage options for test
26
- */
27
- const storageOptions = {
28
- endpoint: "/test"
29
- }
30
-
31
- /**
32
- * TestManager instance
33
- *
34
- * Provides CRUD operations for test entity.
35
- *
36
- * @type {EntityManager}
37
- */
38
- export const testManager = new EntityManager({
39
- ...{
40
- name: "test",
41
- idField: "id",
42
- fields: {}
43
- },
44
- storage: new ApiStorage(storageOptions)
45
- })