@corvina/web-components-library 1.0.0-beta.2 → 1.0.0-beta.4

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/CHANGELOG.md CHANGED
@@ -31,9 +31,18 @@ Breaking changes:
31
31
  Added:
32
32
 
33
33
  - `./settings.scss` export (Vuetify Sass settings of the library).
34
+ - `CorvinaTable` cell slots `item.<key>` (as in Vuetify's tables): a column's cells written in the template,
35
+ with `item`, `value`, `index` and `column` (`CORVINA.TABLE.CellSlotProps`). The slot replaces the content of the
36
+ column's `type`, now optional in `TableHeaderEntry`. Columns without a slot render as before.
37
+ - `CorvinaTabs` (`<corvina-tabs>`): the tabs of a page with the Corvina look, `tabs` (`CORVINA.TABS.TAB[]`) and
38
+ `selected` owned by the parent (`update:selected` on a click), the content of the selected tab in the default slot
39
+ and actions on the right of the bar in the `append` slot.
40
+ - `CorvinaBreadcrumb` `filterBy`: the `key` of the filter selected in the filter key dropdown, selected again when
41
+ `allowedFilters` change (e.g. on another tab).
34
42
 
35
43
  Fixed:
36
44
 
45
+ - `CorvinaBreadcrumb`: a filter key selected in the dropdown is dropped when `allowedFilters` no longer contain it.
37
46
  - Type declarations: relative imports have the `.js` extension, so they resolve with TypeScript
38
47
  `moduleResolution` `node16`/`nodenext` too (the package is now `"type": "module"`).
39
48
  - `AutocompleteFilter` (breadcrumb and table filters) threw on focus (Vuetify 2 API): the menu now opens on focus.
package/index.d.ts CHANGED
@@ -101,6 +101,17 @@ export declare namespace CORVINA {
101
101
  X_LARGE = "x-large"
102
102
  }
103
103
  }
104
+ namespace TABS {
105
+ /** A tab of CorvinaTabs. */
106
+ interface TAB {
107
+ /** Unique value of the tab: `selected` and the `update:selected` event use it */
108
+ value: string | number;
109
+ /** Text shown in the tab */
110
+ title: string;
111
+ /** The data-qa attribute of the tab, for testing and automation */
112
+ dataQa?: string;
113
+ }
114
+ }
104
115
  namespace TABLE {
105
116
  /** Horizontal alignment of a column (applied as `text-*` and `justify-*` classes) */
106
117
  enum ALIGN {
@@ -180,6 +191,17 @@ export declare namespace CORVINA {
180
191
  /** Name of the prop that will contain the row item */
181
192
  itemPropName?: string;
182
193
  }
194
+ /** Props of the `item.<key>` cell slot */
195
+ interface CellSlotProps {
196
+ /** The row item */
197
+ item: any;
198
+ /** `item[key]` */
199
+ value: any;
200
+ /** Index of the row in the page */
201
+ index: number;
202
+ /** The column's header entry */
203
+ column: TableHeaderEntry;
204
+ }
183
205
  /** Use it with `HEADER_CELL_TYPE.VUE_COMPONENT` */
184
206
  interface HeaderVueComponent {
185
207
  /** Name of the Vue component or Vue component definition */
@@ -221,8 +243,8 @@ export declare namespace CORVINA {
221
243
  customHeaderCellGeneratorFunction?: () => HTMLElement;
222
244
  /** The `HeaderVueComponent` describing the vuejs component to use */
223
245
  headerVueComponent?: HeaderVueComponent;
224
- /** Type of the row cells */
225
- type: CELL_TYPE;
246
+ /** Type of the row cells. Not needed when the table has the column's `item.<key>` slot. */
247
+ type?: CELL_TYPE;
226
248
  /** Function that generates the cell virtual dom */
227
249
  customCellGeneratorFunction?: (item: any, header: TableHeaderEntry) => HTMLElement;
228
250
  /** Name of the property of the item object containing the `VueComponent` data */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@corvina/web-components-library",
3
- "version": "1.0.0-beta.2",
3
+ "version": "1.0.0-beta.4",
4
4
  "private": false,
5
5
  "description": "Corvina web components (custom elements)",
6
6
  "homepage": "https://docs.components.corvina.cloud/",
@@ -103,6 +103,13 @@
103
103
  "value": "Property `allowedFilters`: `CORVINA.BREADCRUMB.FILTER_BY[]`\n\n⚠️ Complex value: set it as a JavaScript property (`element.allowedFilters = …`), not as an HTML attribute."
104
104
  }
105
105
  },
106
+ {
107
+ "name": "filter-by",
108
+ "description": {
109
+ "kind": "markdown",
110
+ "value": "Property `filterBy`: `string`"
111
+ }
112
+ },
106
113
  {
107
114
  "name": "filters",
108
115
  "description": {
@@ -598,6 +605,29 @@
598
605
  }
599
606
  }
600
607
  ]
608
+ },
609
+ {
610
+ "name": "corvina-tabs",
611
+ "description": {
612
+ "kind": "markdown",
613
+ "value": "Corvina web component `<corvina-tabs>`.\n\n**Events** (`CustomEvent`, payload in `event.detail[0]`):\n- `update:selected` — `[value: string | number]`\n\n**Slots:** `append`, `default`"
614
+ },
615
+ "attributes": [
616
+ {
617
+ "name": "tabs",
618
+ "description": {
619
+ "kind": "markdown",
620
+ "value": "Property `tabs`: `CORVINA.TABS.TAB[]`\n\n⚠️ Complex value: set it as a JavaScript property (`element.tabs = …`), not as an HTML attribute."
621
+ }
622
+ },
623
+ {
624
+ "name": "selected",
625
+ "description": {
626
+ "kind": "markdown",
627
+ "value": "Property `selected`: `string | number | null`\n\nDefault: `null`"
628
+ }
629
+ }
630
+ ]
601
631
  }
602
632
  ]
603
633
  }