@db-ux/v-core-components 4.10.1 → 4.11.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 (35) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/README.md +1 -1
  3. package/dist/components/table/examples/data.d.ts +9 -0
  4. package/dist/components/table/index.d.ts +1 -0
  5. package/dist/components/table/model.d.ts +74 -0
  6. package/dist/components/table/table.vue.d.ts +30 -0
  7. package/dist/components/table-body/index.d.ts +1 -0
  8. package/dist/components/table-body/model.d.ts +8 -0
  9. package/dist/components/table-body/table-body.vue.d.ts +20 -0
  10. package/dist/components/table-caption/index.d.ts +1 -0
  11. package/dist/components/table-caption/model.d.ts +5 -0
  12. package/dist/components/table-caption/table-caption.vue.d.ts +17 -0
  13. package/dist/components/table-data-cell/index.d.ts +1 -0
  14. package/dist/components/table-data-cell/model.d.ts +5 -0
  15. package/dist/components/table-data-cell/table-data-cell.vue.d.ts +25 -0
  16. package/dist/components/table-footer/index.d.ts +1 -0
  17. package/dist/components/table-footer/model.d.ts +8 -0
  18. package/dist/components/table-footer/table-footer.vue.d.ts +20 -0
  19. package/dist/components/table-head/index.d.ts +1 -0
  20. package/dist/components/table-head/model.d.ts +10 -0
  21. package/dist/components/table-head/table-head.vue.d.ts +20 -0
  22. package/dist/components/table-header-cell/index.d.ts +1 -0
  23. package/dist/components/table-header-cell/model.d.ts +24 -0
  24. package/dist/components/table-header-cell/table-header-cell.vue.d.ts +28 -0
  25. package/dist/components/table-row/index.d.ts +1 -0
  26. package/dist/components/table-row/model.d.ts +30 -0
  27. package/dist/components/table-row/table-row.vue.d.ts +21 -0
  28. package/dist/components/textarea/textarea.vue.d.ts +1 -1
  29. package/dist/db-ux.es.js +1538 -1012
  30. package/dist/db-ux.umd.js +1 -1
  31. package/dist/index.d.ts +16 -0
  32. package/dist/shared/figma.d.ts +70 -18
  33. package/dist/shared/model.d.ts +44 -2
  34. package/dist/utils/index.d.ts +9 -4
  35. package/package.json +8 -8
package/dist/index.d.ts CHANGED
@@ -64,6 +64,22 @@ export * from './components/tab-list';
64
64
  export * from './components/tab-list/model';
65
65
  export * from './components/tab-panel';
66
66
  export * from './components/tab-panel/model';
67
+ export * from './components/table';
68
+ export * from './components/table-body';
69
+ export * from './components/table-body/model';
70
+ export * from './components/table-caption';
71
+ export * from './components/table-caption/model';
72
+ export * from './components/table-data-cell';
73
+ export * from './components/table-data-cell/model';
74
+ export * from './components/table-footer';
75
+ export * from './components/table-footer/model';
76
+ export * from './components/table-head';
77
+ export * from './components/table-head/model';
78
+ export * from './components/table-header-cell';
79
+ export * from './components/table-header-cell/model';
80
+ export * from './components/table-row';
81
+ export * from './components/table-row/model';
82
+ export * from './components/table/model';
67
83
  export * from './components/tabs';
68
84
  export * from './components/tabs/model';
69
85
  export * from './components/tag';
@@ -1,12 +1,24 @@
1
+ /** Base for all Figma prop definitions. */
2
+ export type FigmaBaseProp = {
3
+ /** The prop type discriminator. */
4
+ type: string;
5
+ /**
6
+ * Optional layer name substring to resolve this prop from a nested subcomponent instance
7
+ * instead of the root instance (e.g. 'Custom Select Form Field').
8
+ * When set, the plugin searches _ccLayers for an instance whose name includes this string
9
+ * and reads the property from that instance.
10
+ */
11
+ layer?: string;
12
+ };
1
13
  /** A nested Figma instance swap prop (e.g. icon components). */
2
- export type FigmaInstanceProp = {
14
+ export type FigmaInstanceProp = FigmaBaseProp & {
3
15
  /** Use 'instance' for generic instance swaps, 'iconSwap' for icon instances that resolve to a string name. */
4
16
  type: 'instance' | 'iconSwap';
5
17
  /** The Figma property key of the instance swap (e.g. '🔄 Icon Small'). */
6
18
  key: string;
7
19
  };
8
20
  /** An enum prop mapping Figma variant values to code values. */
9
- export type FigmaEnumProp = {
21
+ export type FigmaEnumProp = FigmaBaseProp & {
10
22
  type: 'enum';
11
23
  /** The Figma property key (e.g. 'Size', '💻 Variant'). */
12
24
  key: string;
@@ -20,7 +32,7 @@ export type FigmaEnumProp = {
20
32
  guardKey?: string;
21
33
  };
22
34
  /** A simple scalar prop. */
23
- export type FigmaSimpleProp = {
35
+ export type FigmaSimpleProp = FigmaBaseProp & {
24
36
  /**
25
37
  * - 'string': maps to instance.getString()
26
38
  * - 'boolean': maps to instance.getBoolean()
@@ -30,14 +42,12 @@ export type FigmaSimpleProp = {
30
42
  type: 'string' | 'boolean' | 'children' | 'textContent';
31
43
  /** The Figma property key (e.g. '✏️ Text', '✏️ Label'). */
32
44
  key: string;
33
- };
34
- /** Reads a text property from a named nested instance via instance.findInstance(layerName)?.getString(key). */
35
- export type FigmaNestedTextProp = {
36
- type: 'nestedText';
37
- /** The exact Figma layer name of the nested instance to find. */
38
- layerName: string;
39
- /** The Figma property key on the nested instance (e.g. '✏️ Text'). */
40
- key: string;
45
+ /**
46
+ * Optional Figma boolean property keys that guard this prop.
47
+ * When set, the prop value is only emitted if at least one of the guard keys is true.
48
+ * Useful for conditionally showing labels, timestamps, etc.
49
+ */
50
+ guardKeys?: string[];
41
51
  };
42
52
  /**
43
53
  * Reads a text property from the first code-connected child instance.
@@ -46,7 +56,7 @@ export type FigmaNestedTextProp = {
46
56
  * .filter((node) => !!node.properties[key])[0]
47
57
  * .getString(key)
48
58
  */
49
- export type FigmaConnectedTextProp = {
59
+ export type FigmaConnectedTextProp = FigmaBaseProp & {
50
60
  type: 'connectedText';
51
61
  /** The Figma property key to read from each connected instance (e.g. '✏️ Text'). */
52
62
  key: string;
@@ -60,7 +70,7 @@ export type FigmaConnectedTextProp = {
60
70
  * @example
61
71
  * validationMessage: { type: 'validationMessage', key: '✏️ Text', conditionProp: 'validation', map: { 'invalid': 'invalidMessage', 'valid': 'validMessage', default: 'message' } }
62
72
  */
63
- export type FigmaValidationMessageProp = {
73
+ export type FigmaValidationMessageProp = FigmaBaseProp & {
64
74
  type: 'validationMessage';
65
75
  /** The Figma property key to read from the connected instance (e.g. '✏️ Text'). */
66
76
  key: string;
@@ -72,10 +82,16 @@ export type FigmaValidationMessageProp = {
72
82
  /**
73
83
  * Renders all direct code-connected child instances as children.
74
84
  * Generates: instance.findConnectedInstances((node) => node.hasCodeConnect())
75
- * .map((child) => child.executeTemplate().example)
85
+ * .flatMap((child) => child.executeTemplate().example)
86
+ *
87
+ * When `filter` is provided, only instances whose **name** includes the filter string
88
+ * are included. Note: this differs from `nestedConnectedInstances` where filter matches
89
+ * against nestedImports.
76
90
  */
77
- export type FigmaConnectedInstancesProp = {
91
+ export type FigmaConnectedInstancesProp = FigmaBaseProp & {
78
92
  type: 'connectedInstances';
93
+ /** Instance name substring to filter by (e.g. 'Navigation'). Only instances whose node name includes this string are included. When omitted, all connected instances are included. */
94
+ filter?: string;
79
95
  };
80
96
  /**
81
97
  * Renders code-connected child instances recursively, filtered by a nestedImports string.
@@ -90,16 +106,45 @@ export type FigmaConnectedInstancesProp = {
90
106
  * .some((section) => section.nestedImports?.some((i) => i.includes('DBAccordionItem'))))
91
107
  * .map((child) => child.executeTemplate().example)
92
108
  */
93
- export type FigmaNestedConnectedInstancesProp = {
109
+ export type FigmaNestedConnectedInstancesProp = FigmaBaseProp & {
94
110
  type: 'nestedConnectedInstances';
95
111
  /** Import string to filter by (e.g. 'DBAccordionItem'). Only instances whose template nestedImports contain this string are included. When omitted, all connected instances are included. */
96
112
  filter?: string;
97
113
  };
114
+ /**
115
+ * Maps multiple boolean Figma properties to a single enum code value.
116
+ * The first property whose value is `true` wins; if none match, the prop is omitted.
117
+ *
118
+ * @example
119
+ * linkVariant: { type: 'booleanToEnum', map: [{ key: '(Def) Link Variant: Block', value: 'block' }, { key: '↳ OR Link Variant: Inline', value: 'inline' }] }
120
+ */
121
+ export type FigmaBooleanToEnumProp = FigmaBaseProp & {
122
+ type: 'booleanToEnum';
123
+ /** Ordered list of Figma boolean keys and the code value to emit when that key is true. */
124
+ map: Array<{
125
+ key: string;
126
+ value: string;
127
+ }>;
128
+ };
129
+ /**
130
+ * Finds all nested instances matching a filter and maps their properties to an array.
131
+ * Each matched instance produces one object in the array, with keys defined by `props`.
132
+ *
133
+ * @example
134
+ * options: { type: 'nestedInstancesToArray', filter: 'Custom Select List Item', props: { value: { type: 'string', key: '✏️ Value' }, label: { type: 'textContent', key: '✏️ Label' } } }
135
+ */
136
+ export type FigmaNestedInstancesToArrayProp = FigmaBaseProp & {
137
+ type: 'nestedInstancesToArray';
138
+ /** Instance name substring to filter by (e.g. 'Custom Select List Item'). */
139
+ filter: string;
140
+ /** Map of output property names → Figma prop definitions to extract from each matched instance. */
141
+ props: Record<string, FigmaProp>;
142
+ };
98
143
  /**
99
144
  * Wraps an iconSwap prop so it is only rendered when a boolean Figma property is enabled.
100
145
  * Generates: let icon = ''; if (getPropertyValue(guardKey) === true || getPropertyValue(guardKey) === 'True') { icon = `\n\t\ticon="${iconLeading}"` }
101
146
  */
102
- export type FigmaConditionalProp = {
147
+ export type FigmaConditionalProp = FigmaBaseProp & {
103
148
  type: 'conditionalProp';
104
149
  /** The Figma property key of the icon instance swap. */
105
150
  key: string;
@@ -108,10 +153,17 @@ export type FigmaConditionalProp = {
108
153
  /** The attribute name to render (e.g. 'icon'). */
109
154
  attrName: string;
110
155
  };
111
- export type FigmaProp = FigmaEnumProp | FigmaInstanceProp | FigmaNestedTextProp | FigmaConnectedTextProp | FigmaValidationMessageProp | FigmaConditionalProp | FigmaConnectedInstancesProp | FigmaNestedConnectedInstancesProp | FigmaSimpleProp;
156
+ export type FigmaProp = FigmaEnumProp | FigmaBooleanToEnumProp | FigmaInstanceProp | FigmaConnectedTextProp | FigmaValidationMessageProp | FigmaConditionalProp | FigmaConnectedInstancesProp | FigmaNestedConnectedInstancesProp | FigmaNestedInstancesToArrayProp | FigmaSimpleProp;
112
157
  export type FigmaCodeConnect = {
113
158
  /** Figma node URLs this component connects to. Use 'FIGMA_FILE' as placeholder for the file key. */
114
159
  urls: string[];
115
160
  /** Map of prop name → Figma prop definition. */
116
161
  props: Record<string, FigmaProp>;
162
+ /**
163
+ * Optional additional layer name substrings to include in the _ccLayers filter.
164
+ * Each entry adds an `|| n.name.includes('...')` condition to the findLayers predicate.
165
+ * Use when Code Connect properties live inside named subcomponent instances
166
+ * (e.g. 'Custom Select Form Field', 'Custom Select Dropdown').
167
+ */
168
+ ccLayerNames?: string[];
117
169
  };
@@ -460,11 +460,11 @@ export type CloseEventProps<T> = {
460
460
  export type CloseEventState<T> = {
461
461
  handleClose: (event?: T | void, forceClose?: boolean) => void;
462
462
  };
463
- export declare const AlignmentList: readonly ["start", "center"];
463
+ export declare const AlignmentList: readonly ["start", "center", "end"];
464
464
  export type AlignmentType = (typeof AlignmentList)[number];
465
465
  export type AlignmentProps = {
466
466
  /**
467
- * Define the content alignment in full width
467
+ * Define the content alignment
468
468
  */
469
469
  alignment?: AlignmentType | string;
470
470
  };
@@ -554,3 +554,45 @@ export interface PatternhubProps {
554
554
  */
555
555
  isPatternhub?: boolean;
556
556
  }
557
+ export type DBTableCellProps = {
558
+ /**
559
+ * The **`colSpan`** read-only property of the HTMLTableCellElement interface represents the number of columns this cell must span; this lets the cell occupy space across multiple columns of the table.
560
+ *
561
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLTableCellElement/colSpan)
562
+ */
563
+ colSpan?: number | string;
564
+ /**
565
+ * Lowercase HTML attribute alternative to `colSpan`. Use this in template languages that require lowercase attributes (e.g. Angular, Vue).
566
+ * If both `colSpan` and `colspan` are provided, `colSpan` takes precedence.
567
+ *
568
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLTableCellElement/colSpan)
569
+ */
570
+ colspan?: number | string;
571
+ /**
572
+ * The **`headers`** property of the HTMLTableCellElement interface contains a list of IDs of th elements that are _headers_ for this specific cell.
573
+ *
574
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLTableCellElement/headers)
575
+ */
576
+ headers?: string;
577
+ /**
578
+ * The **`rowSpan`** read-only property of the HTMLTableCellElement interface represents the number of rows this cell must span; this lets the cell occupy space across multiple rows of the table.
579
+ *
580
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLTableCellElement/rowSpan)
581
+ */
582
+ rowSpan?: number | string;
583
+ /**
584
+ * Lowercase HTML attribute alternative to `rowSpan`. Use this in template languages that require lowercase attributes (e.g. Angular, Vue).
585
+ * If both `rowSpan` and `rowspan` are provided, `rowSpan` takes precedence.
586
+ *
587
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLTableCellElement/rowSpan)
588
+ */
589
+ rowspan?: number | string;
590
+ /**
591
+ * Set the horizontal alignment of the cell content.
592
+ */
593
+ horizontalAlignment?: AlignmentType;
594
+ /**
595
+ * Set the vertical alignment of the cell content.
596
+ */
597
+ verticalAlignment?: AlignmentType;
598
+ };
@@ -22,11 +22,16 @@ export declare const hasVoiceOver: () => boolean;
22
22
  export declare const isIOSSafari: () => boolean;
23
23
  export declare const delay: (fn: () => void, ms: number) => Promise<unknown>;
24
24
  /**
25
- * Some frameworks like stencil would not add "true" as value for a prop
26
- * if it is used in a framework like angular e.g.: [disabled]="myDisabledProp"
27
- * @param originBool Some boolean to convert to string
25
+ * Converts boolean-like inputs to "true" or "false" strings.
26
+ * Handles HTML-style boolean attributes where an empty string or the
27
+ * attribute's own name as value (e.g. noText="noText") should be treated as true.
28
+ * Some frameworks like Stencil do not add "true" as value for a prop
29
+ * if it is used in a framework like Angular e.g.: [disabled]="myDisabledProp"
30
+ * @param originBool Boolean or string value to convert
31
+ * @param propertyName The prop/attribute name — when originBool is a string equal
32
+ * to this name (case-insensitive), it is treated as true
28
33
  */
29
- export declare const getBooleanAsString: (originBool?: boolean | string) => any;
34
+ export declare const getBooleanAsString: (originBool?: boolean | string, propertyName?: string) => any;
30
35
  export declare const getBoolean: (originBool?: boolean | string, propertyName?: string) => boolean | undefined;
31
36
  export declare const getNumber: (originNumber?: number | string, alternativeNumber?: number | string) => number | undefined;
32
37
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@db-ux/v-core-components",
3
- "version": "4.10.1",
3
+ "version": "4.11.0",
4
4
  "type": "module",
5
5
  "description": "Vue components for @db-ux/core-components",
6
6
  "repository": {
@@ -28,21 +28,21 @@
28
28
  "dist/"
29
29
  ],
30
30
  "dependencies": {
31
- "@db-ux/core-components": "4.10.1",
32
- "@db-ux/core-foundations": "4.10.1"
31
+ "@db-ux/core-components": "4.11.0",
32
+ "@db-ux/core-foundations": "4.11.0"
33
33
  },
34
34
  "devDependencies": {
35
35
  "@playwright/experimental-ct-vue": "1.60.0",
36
36
  "@vitejs/plugin-vue": "6.0.7",
37
- "@vue/compiler-dom": "3.5.34",
37
+ "@vue/compiler-dom": "3.5.35",
38
38
  "cpr": "3.0.1",
39
39
  "npm-run-all2": "9.0.1",
40
40
  "replace-in-file": "8.4.0",
41
- "tsx": "4.22.3",
41
+ "tsx": "4.22.4",
42
42
  "typescript": "5.9.3",
43
- "vite": "8.0.14",
44
- "vue": "3.5.34",
45
- "vue-tsc": "3.3.2"
43
+ "vite": "8.0.16",
44
+ "vue": "3.5.35",
45
+ "vue-tsc": "3.3.3"
46
46
  },
47
47
  "publishConfig": {
48
48
  "registry": "https://registry.npmjs.org/",