@corvina/web-components-library 0.2.4 → 1.0.0-beta.10
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 +173 -0
- package/README.md +16 -7
- package/index.d.ts +147 -7
- package/package.json +15 -25
- package/vscode.html-custom-data.json +1314 -112
- package/web-components-library.cjs.js +21 -58
- package/web-components-library.css +2 -5
- package/web-components-library.es.d.ts +5 -2
- package/web-components-library.es.js +28538 -21112
- package/web-components-library.umd.js +21 -61
- package/web-components.d.ts +1 -2
- package/components/AnimatedButton.vue.d.ts +0 -197
- package/components/AutocompleteFilter.vue.d.ts +0 -144
- package/components/CorvinaBreadcrumb.ce.vue.d.ts +0 -105
- package/components/CorvinaBreadcrumbDivider.ce.vue.d.ts +0 -2
- package/components/CorvinaButton.ce.vue.d.ts +0 -84
- package/components/CorvinaIcon.ce.vue.d.ts +0 -35
- package/components/CorvinaIconInternal.vue.d.ts +0 -39
- package/components/CorvinaSelect.ce.vue.d.ts +0 -56
- package/components/CorvinaTable.ce.vue.d.ts +0 -176
- package/components/CustomRenderer.vue.d.ts +0 -15
- package/components/InfiniteLoaderAutocomplete.vue.d.ts +0 -21
- package/components/Searchbar.vue.d.ts +0 -113
- package/components/Slots.d.ts +0 -10
- package/components/TableHeader.vue.d.ts +0 -51
- package/corvina.png +0 -0
- package/favicon.ico +0 -0
- package/plugins/vuetify.d.ts +0 -3
- package/theme/blueprint.d.ts +0 -3
- package/theme/ecciconset.d.ts +0 -5
- package/theme/icons-list.d.ts +0 -1
- package/utils/webfontloader.d.ts +0 -1
- package/vue-components.d.ts +0 -25
- package/webcomponent-utils/utils.d.ts +0 -1
- package/webcomponent-utils/web-component-creator.d.ts +0 -24
- package/webcomponent-utils/web-components.d.ts +0 -4
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
Both packages are built from the same sources and released with the same version.
|
|
4
|
+
|
|
5
|
+
## 1.0.0
|
|
6
|
+
|
|
7
|
+
Vue 3.5 and Vuetify 4.
|
|
8
|
+
|
|
9
|
+
Browsers: the JS and CSS are built for Vite 8's default target (`baseline-widely-available`: Chrome and
|
|
10
|
+
Edge 111, Firefox 114, Safari and iOS 16.4), with no transpiling to ES2016 anymore (`?.`, `??` and `async`
|
|
11
|
+
are kept).
|
|
12
|
+
|
|
13
|
+
### `@corvina/vue-components-library` (from 0.2.4)
|
|
14
|
+
|
|
15
|
+
Breaking changes:
|
|
16
|
+
|
|
17
|
+
- The components are registered as `CvTable`, `CvButton`, ... (were `CorvinaTable`, `CorvinaButton`, ...), and the named
|
|
18
|
+
exports and the files are renamed the same way. `app.use(components, { prefix: 'corvina' })` keeps registering the
|
|
19
|
+
0.x names (`<CorvinaTable>`, `<corvina-table>` in templates) while the app renames its templates; `GlobalComponents`
|
|
20
|
+
types both.
|
|
21
|
+
- `vue` (^3.5) and `vuetify` (^4.3) are peer dependencies, provided by the app: the package no longer
|
|
22
|
+
bundles Vuetify 3 (JS 554 → 188 KB, gzip 160 → 71 KB; the ExorFontIcon font is in it as a data URL).
|
|
23
|
+
- Modern syntax (see Browsers above): an app that targets older browsers transpiles the package with its
|
|
24
|
+
bundler (Vite does it by itself in the build).
|
|
25
|
+
- ESM only: the CommonJS and UMD builds are gone (`exports` has no `require` condition).
|
|
26
|
+
- The library CSS no longer contains the Vuetify CSS (132 → 20 KB): the app imports `vuetify/styles`.
|
|
27
|
+
To get the Corvina look, build the Vuetify styles with the exported settings:
|
|
28
|
+
`@forward '@corvina/vue-components-library/settings.scss'` in the `vite-plugin-vuetify` `styles.configFile`.
|
|
29
|
+
- The app must import `vuetify/styles` (its Vuetify plugin) before `App.vue` and the library: Vuetify 4
|
|
30
|
+
CSS is in CSS layers and the first CSS loaded sets their order.
|
|
31
|
+
- The components use the Vuetify defaults of the app (e.g. the `variant` of fields), not the library ones.
|
|
32
|
+
- `--color-*` variables: the package CSS now has the components' palette (`--color-primary` #496177,
|
|
33
|
+
`--color-highlight` #01a3dd, ...). 0.2.4 ended with an older palette (#004688, #00b0c7, ...).
|
|
34
|
+
- `CvTable` (paginated) is as tall as its rows, at most as its container, as in frontend-new: with few rows the
|
|
35
|
+
footer follows the last one, with more than fit it stays at the bottom while the rows scroll. It no longer fills
|
|
36
|
+
its container with a white area (`style="height: 100%"` on the root and on the `v-data-table-server` are gone).
|
|
37
|
+
A container that sizes the table with `height` keeps working; a flex container needs `min-height: 0` on its
|
|
38
|
+
items. With `infiniteScroll` the table still fills its container.
|
|
39
|
+
- `CvSelect` is a form field like `CvTextField`: `v-model` on `modelValue` (`update:modelValue`; were `model` and
|
|
40
|
+
`update:model`), `label`, room for the error messages below it unless `hideDetails` (it always hid them), the
|
|
41
|
+
frontend-new look instead of the app's Vuetify defaults. `items` that are `CORVINA.FIELD.ITEM` can be `disabled`; the
|
|
42
|
+
only option of an empty select is selected (INPUT-4, `autoSelect` `false` to keep it empty).
|
|
43
|
+
- A disabled `CvButton` is `--color-g4` (text, icon, border; the background of `filled`), without Vuetify's opacity
|
|
44
|
+
(STATE-3): it was g2 at 26% opacity. Disabled menu entries of `CvTable` are g4 too (were Vuetify's 60% opacity).
|
|
45
|
+
|
|
46
|
+
Added:
|
|
47
|
+
|
|
48
|
+
- `./settings.scss` export (Vuetify Sass settings of the library).
|
|
49
|
+
- `CvTable` cell slots `item.<key>` (as in Vuetify's tables): a column's cells written in the template,
|
|
50
|
+
with `item`, `value`, `index` and `column` (`CORVINA.TABLE.CellSlotProps`). The slot replaces the content of the
|
|
51
|
+
column's `type`, now optional in `TableHeaderEntry`. Columns without a slot render as before.
|
|
52
|
+
- `CvTabs` (`<cv-tabs>`): the tabs of a page with the Corvina look, `tabs` (`CORVINA.TABS.TAB[]`) and
|
|
53
|
+
`selected` owned by the parent (`update:selected` on a click), a content for each tab in the `tab.<value>` slots
|
|
54
|
+
(only the selected one is shown; web components: `slot="tab.<value>"` children), or one in the default slot, and
|
|
55
|
+
actions on the right of the bar in the `append` slot.
|
|
56
|
+
- `CvDateRange` (`<cv-date-range>`): a range of days for the breadcrumb, `model` (`CORVINA.DATE_RANGE.RANGE`,
|
|
57
|
+
ISO days) owned by the parent (`update:model` from the accept button), `presets` (`CORVINA.DATE_RANGE.PRESET[]`) and
|
|
58
|
+
the start and end calendars; highlighted while a range is set, underlined as frontend-new's field (highlight color
|
|
59
|
+
on hover; the text from the start of the underline, both 16px in while a range is set).
|
|
60
|
+
- `CvPanel` (`<cv-panel>`): the panels of frontend-new, `open` owned by the parent. `position` (`CORVINA.PANEL.POSITION`)
|
|
61
|
+
`right` (full height, `width` 340 by default, at most 75% of the window) or `bottom` (the lower half of the window).
|
|
62
|
+
`type` (`CORVINA.PANEL.TYPE`) `edit` creates or edits: a fixed header with the icon, `operation` over `title`, the
|
|
63
|
+
help button, cancel and confirm (OperationalComponent), the body scrolling under it; `confirm` leaves it open,
|
|
64
|
+
cancel emits `cancel` and `update:open`; `confirmDisabled`, `loading` (cancel and the body locked), `collapsed` (only
|
|
65
|
+
the header, in the bottom corner); the `help` slot opens on the left of the panel, the `actions` slot adds buttons to
|
|
66
|
+
the header. `type` `help` explains: the help icon, `title` and Close (`update:open`), the help in the default slot
|
|
67
|
+
with the docs look (in the web components the slotted content keeps the page's styles). Replaces `CvHelpPanel`
|
|
68
|
+
(`<cv-help-panel>`) of the betas: `<CvPanel position="bottom" type="help">`, same `title`, `closeLabel` and
|
|
69
|
+
`data-qa`.
|
|
70
|
+
- `CvInfiniteLoader` (`<cv-infinite-loader>`): the infinite scroll of the autocomplete filters, for the app's
|
|
71
|
+
own lists. It emits `infinite` (`$state`: `CORVINA.INFINITE_LOADER.StateHandler`) when it is visible in its scrolling
|
|
72
|
+
container, not again while a page loads; `loaded()`, `complete()` (stops it) and `error()` (retry button, `retryLabel`);
|
|
73
|
+
`identifier` starts it again from the first page. Slots `spinner`, `complete` and `error` (Vue: with `retry`).
|
|
74
|
+
- `CvDialog` (`<cv-dialog>`): the dialogs of frontend-new's ConfirmedModal and ErrorModal, `open` owned by the
|
|
75
|
+
parent. `type` `confirm` (`CORVINA.DIALOG.TYPE`) asks before an action: Cancel then the confirm button, highlight or
|
|
76
|
+
alert with `destructive` (the title too), `loading` while the operation runs (both buttons disabled), `confirmationValue`
|
|
77
|
+
for a text to type before confirming; `confirm` leaves it open, Cancel emits `cancel` and `update:open`. `type` `inform`
|
|
78
|
+
reports a failure: the title in alert, the error illustration, one button that emits `update:open`, and the `details`
|
|
79
|
+
and `actions` slots. `title`, `message` (or the default slot), `confirmLabel`, `cancelLabel`, `maxWidth` (290 and 550
|
|
80
|
+
by default). In the web components the dialog stays in the shadow root.
|
|
81
|
+
- `CvSnackbar` (`<cv-snackbar>`): frontend-new's snackbar, `open` owned by the parent. `type` (`CORVINA.SNACKBAR.TYPE`)
|
|
82
|
+
`success`, `warning` or `error` sets the colour, `position` (`CORVINA.SNACKBAR.POSITION`) `bottom` or `top`; `title`,
|
|
83
|
+
`message`, a default slot below them. The close button (`closeLabel`) and the end of `timeout` (5000 ms, `-1` to stay)
|
|
84
|
+
emit `update:open` with `false`. In the web components it stays in the shadow root.
|
|
85
|
+
- Form fields, the look of frontend-new's side panel fields: `CvTextField` (`<cv-text-field>`; `type`
|
|
86
|
+
`CORVINA.FIELD.TYPE` `text`, `password` with the button that shows it, or `number`, which holds a number; `loading`,
|
|
87
|
+
`clearable`, `min`, `max`), `CvTextarea` (`<cv-textarea>`; `rows`, `autoGrow`, `noResize`), `CvCheckbox`
|
|
88
|
+
(`<cv-checkbox>`), `CvSwitch` (`<cv-switch>`) and `CvRadioGroup` (`<cv-radio-group>`; `items`
|
|
89
|
+
`CORVINA.FIELD.ITEM[]`, `inline`). Each has `modelValue` (`v-model`), `label`, `placeholder` (text fields), `help`
|
|
90
|
+
(the (?) with its tooltip), `disabled` (g4) with `disabledReason` (the tooltip that says why), `readonly`, `rules`
|
|
91
|
+
(`CORVINA.FIELD.RULE[]`), `errorMessages` and `hideDetails`. A `v-form` of the page sees them (Vue); in the web
|
|
92
|
+
components each field emits `update:valid` and has the methods `validate()`, `reset()` and `resetValidation()`.
|
|
93
|
+
`CvSelect` has them too (see the breaking changes), with `multiple` and `clearable`.
|
|
94
|
+
- `CvAutocomplete` (`<cv-autocomplete>`): a `CvSelect` that filters its `items` on what is typed (INPUT-2), or with a
|
|
95
|
+
`searchFunction` (`CORVINA.FIELD.SEARCH`, `(search, page) => items`, as the breadcrumb's autocomplete filters) searches
|
|
96
|
+
on the server, the next pages at the end of the menu. `noDataText`, `loadingText`.
|
|
97
|
+
- `CvButton` `disabledReason`: while the button is disabled, its tooltip says why (STATE-2), in place of `tooltip`.
|
|
98
|
+
- `CvTable` row buttons (`CORVINA.TABLE.PropButtonEntry`): `disabled`, with `disabledReason` for the tooltip, and
|
|
99
|
+
`dataQa`. Menu entries (`MenuPropEntry`) have `disabledReason` too. Each row has its own buttons: the `ROW_ACTIONS`
|
|
100
|
+
stories leave out what the user may never do (STATE-1), disable with the reason what the row does not allow
|
|
101
|
+
(STATE-2), and put View in the slot of Edit for a read-only user (STATE-4).
|
|
102
|
+
- `CvBreadcrumb` sort, as in frontend-new: `allowedSorts` (`CORVINA.BREADCRUMB.SORT_BY[]`) shows a sort dropdown
|
|
103
|
+
and the direction button after the slot, `sort` (`CORVINA.BREADCRUMB.SORT`, `key` and `desc`) owned by the parent
|
|
104
|
+
(`update:sort`), `sortPlaceholder`. Without `allowedSorts` there is no sort.
|
|
105
|
+
- `CvBreadcrumb` `filterBy`: the `key` of the filter selected in the filter key dropdown, selected again when
|
|
106
|
+
`allowedFilters` change (e.g. on another tab).
|
|
107
|
+
|
|
108
|
+
Fixed:
|
|
109
|
+
|
|
110
|
+
- The icon buttons of `CvTable` and `CvBreadcrumb` no longer submit a form they are in (`type="button"`).
|
|
111
|
+
- `CvBreadcrumb`: a filter key selected in the dropdown is dropped when `allowedFilters` no longer contain it.
|
|
112
|
+
- `CvBreadcrumb` looks like frontend-new's breadcrumb: full-height light dividers (`CvBreadcrumbDivider` too,
|
|
113
|
+
was a 25px dark line), the filter area 860px wide and starting with a divider, the filter key dropdown 13em on the
|
|
114
|
+
g1 background without the underline, the filter value field 16px from it.
|
|
115
|
+
- `CvTable` rows are highlighted on hover (Vuetify's standard `hover`), the expanded content is not, as in
|
|
116
|
+
frontend-new; the items-per-page select of the footer is underlined, with "Rows per page:" (Vuetify's
|
|
117
|
+
`dataTable.itemsPerPageText`, translated) and the selected value of its menu in the highlight color, as in
|
|
118
|
+
frontend-new.
|
|
119
|
+
- Scrollbars as in frontend-new: thin, a highlight thumb on g1, in every component (the `custom-scrollbars` class
|
|
120
|
+
on their root, also in the package CSS for the app's own containers).
|
|
121
|
+
- Type declarations: relative imports have the `.js` extension, so they resolve with TypeScript
|
|
122
|
+
`moduleResolution` `node16`/`nodenext` too (the package is now `"type": "module"`).
|
|
123
|
+
- `AutocompleteFilter` (breadcrumb and table filters) threw on focus (Vuetify 2 API): the menu now opens on focus.
|
|
124
|
+
- Infinite scroll of the autocomplete filters (breadcrumb and table): no page is requested while one is loading. Two
|
|
125
|
+
pages requested together became one fetch (it is debounced) and a page of results was skipped. The next page is
|
|
126
|
+
requested when the end of the menu is visible, while scrolling: all the pages were requested one after the other
|
|
127
|
+
when the menu opened (the end of the list was checked against the window). The spinner has the primary color in the
|
|
128
|
+
web components too (was black).
|
|
129
|
+
- `AutocompleteFilter` imports `VCombobox` from `vuetify/components/VCombobox`, not from the `vuetify/components`
|
|
130
|
+
barrel: an app whose Vite dev server does not pre-bundle Vuetify loaded every Vuetify component (a Log page with
|
|
131
|
+
the breadcrumb: 777 → 484 module requests).
|
|
132
|
+
- Breadcrumb filter chip arrows are 25px as in the web components (the Vuetify 52px rule won before).
|
|
133
|
+
- The package only contains the files it needs (61 → 27): no type declarations of internal modules or of the web
|
|
134
|
+
components entry, no favicon and logo.
|
|
135
|
+
- No dependencies besides the peer ones: the infinite scroll of the autocomplete filters no longer uses
|
|
136
|
+
`v3-infinite-loading` (declared, and bundled too), `lodash-es` (for `debounce`) and `webfontloader` are no longer
|
|
137
|
+
bundled (JS -23 KB, gzip -7 KB).
|
|
138
|
+
- `loadFonts()` adds a `<link>` to the Google Fonts css2 API (Roboto, Material Symbols) instead of using
|
|
139
|
+
webfontloader: the `wf-loading`/`wf-active` classes are no longer set on `<html>`.
|
|
140
|
+
- Types: the props with a default are optional (`CvTable` `headers`, `items`, `itemsPerPage`, `currentPage`,
|
|
141
|
+
`itemsLength`; `CvTabs` `tabs`; `CvBreadcrumb` `icon`, `path`; `CvIcon` `icon`). The `searchFunction` of the
|
|
142
|
+
breadcrumb filters and `CORVINA.FIELD.SEARCH` return `unknown[]`, the `props` of the custom cell, header and filter
|
|
143
|
+
components are `Record<string, unknown>` (were `any`): the app's own types fit them as before.
|
|
144
|
+
|
|
145
|
+
### `@corvina/web-components-library` (from 0.2.4)
|
|
146
|
+
|
|
147
|
+
- `<cv-select>`: `modelValue` and `update:modelValue` (were `model` and `update:model`), and the other changes of
|
|
148
|
+
`CvSelect` in the Vue package.
|
|
149
|
+
- The elements are `<cv-table>`, `<cv-button>`, ... (were `<corvina-table>`, ...): the fourth parameter of
|
|
150
|
+
`initCorvinaComponents(locale, shouldLoadTheme, shouldLoadFonts, prefix)` is the start of the tags, `'corvina'` for
|
|
151
|
+
the 0.x ones. The VS Code custom data lists the `cv-` tags.
|
|
152
|
+
- Vuetify 4 and Vue 3.5 bundled (were Vuetify 3.7 and Vue 3.5). JS 1.06 → 1.38 MB (gzip 265 → 344 KB),
|
|
153
|
+
mostly Vuetify 4 itself (its date picker for `CvDateRange` included).
|
|
154
|
+
- Runs on the browsers listed above (Browsers): 0.2.4 was transpiled to ES2016.
|
|
155
|
+
- No dependencies declared: Vue, Vuetify and the other libraries are bundled (0.2.4 declared `vue` and
|
|
156
|
+
`vuetify` 3, installed without being used).
|
|
157
|
+
- The bundle runs without a bundler (`<script type="module">`): `process` is no longer referenced.
|
|
158
|
+
- `v3-infinite-loading`, `lodash-es` and `webfontloader` are no longer bundled (ES build -31 KB, gzip -8 KB): the infinite
|
|
159
|
+
scroll and `loadFonts()` changed as in the Vue package.
|
|
160
|
+
- `web-components-library.css` (the page CSS) only has the `--color-*` variables (108 KB → 0.6 KB): no Vuetify
|
|
161
|
+
reset, base or component CSS on the host page anymore (they changed e.g. the `html` font and line height,
|
|
162
|
+
`box-sizing`, buttons and inputs of the page). The palette changed as in the Vue package (#004688 → #496177, ...).
|
|
163
|
+
- The components set their base typography on their host instead of inheriting it from that page CSS:
|
|
164
|
+
`box-sizing: border-box`, `font-family: var(--v-font-body, "Roboto", sans-serif)`, `line-height: 1.5`.
|
|
165
|
+
On a page with its own `body` font the components now use Roboto; to change it, style the element
|
|
166
|
+
(e.g. `cv-table { font-family: ... }`).
|
|
167
|
+
- A prop set to `false`, `0` or `''` keeps that value: the element replaced it with the prop's default (e.g.
|
|
168
|
+
`.autoSelect=${false}` on `<cv-select>` gave `true`).
|
|
169
|
+
- `<cv-table>`: its Vuetify CSS is regenerated from the installed Vuetify; `.v-table` had an invalid
|
|
170
|
+
`font-size: .75rrem` (now `.75rem`, 12px, as the cells).
|
|
171
|
+
- Table footer items-per-page menu attached inside the shadow root without patching Vuetify.
|
|
172
|
+
- The package only contains the files it needs (37 → 13): no type declarations of internal modules, no
|
|
173
|
+
favicon and logo.
|
package/README.md
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
# Corvina Components Library
|
|
2
|
+
|
|
2
3
|
This library is a collection of web components aimed to be used in the Corvina App.
|
|
3
4
|
|
|
4
5
|
# Documentation
|
|
@@ -6,7 +7,7 @@ This library is a collection of web components aimed to be used in the Corvina A
|
|
|
6
7
|
The components documentation and live examples are available in the [Storybook for web components](https://docs.components.corvina.cloud/).
|
|
7
8
|
The Vue components version is available [here](https://docs.components.corvina.cloud/vue/).
|
|
8
9
|
|
|
9
|
-
# Installation
|
|
10
|
+
# Installation
|
|
10
11
|
|
|
11
12
|
To install the package run the following command:
|
|
12
13
|
|
|
@@ -19,13 +20,16 @@ npm install @corvina/web-components-library
|
|
|
19
20
|
Add the following code to your main.js file:
|
|
20
21
|
|
|
21
22
|
```js
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
import CorvinaComponents from '@corvina/web-components-library';
|
|
24
|
+
import '@corvina/web-components-library/web-components-library.css';
|
|
25
|
+
// locale: string = 'en', shouldLoadTheme: boolean = false, shouldLoadFonts: boolean = false, prefix: string = 'cv'
|
|
26
|
+
CorvinaComponents.initCorvinaComponents('en');
|
|
26
27
|
```
|
|
28
|
+
|
|
29
|
+
The elements are `<cv-table>`, `<cv-button>`, ...: `prefix` changes the start of the tags, e.g. `'corvina'` for the
|
|
30
|
+
0.x tags (`<corvina-table>`). The components are defined once per page, with the prefix of the first call.
|
|
27
31
|
If you use Vuetify in the hosting app set shouldLoadTheme to false otherwise to true.
|
|
28
|
-
If you already load the fonts in the hosting app (Roboto, MaterialSymbols, ExorFontIcon) set shouldLoadFonts to false otherwise to true.
|
|
32
|
+
If you already load the fonts in the hosting app (Roboto, MaterialSymbols, ExorFontIcon) set shouldLoadFonts to false otherwise to true.
|
|
29
33
|
|
|
30
34
|
The components draw the Corvina icons with ligatures, so they do not need `icons-corvina-classes-font-face.css`:
|
|
31
35
|
that file is only for Corvina icons used as CSS classes (`<i class="ecc-T-Add"></i>`) in the hosting app markup.
|
|
@@ -37,6 +41,11 @@ and of the font in the app (the bundler copies the font, `fonts/ExorFontIcon.wof
|
|
|
37
41
|
import "@corvina/web-components-library/icons-corvina-classes-font-face.css"
|
|
38
42
|
```
|
|
39
43
|
|
|
44
|
+
Vue and Vuetify 4 are bundled: the package has no dependencies. `web-components-library.css` only defines the
|
|
45
|
+
`--color-*` variables: the page keeps its own styles. The components use Roboto (`--v-font-body`) and line
|
|
46
|
+
height 1.5 whatever the page font; style the element to change them (e.g. `cv-table { font-family: ... }`). The bundle also runs without a bundler
|
|
47
|
+
(`<script type="module">` importing `web-components-library.es.js`).
|
|
48
|
+
|
|
40
49
|
# VS Code IntelliSense
|
|
41
50
|
|
|
42
51
|
The package ships a [VS Code custom data](https://github.com/microsoft/vscode-custom-data) file that adds tag and
|
|
@@ -50,4 +59,4 @@ Add it to the `.vscode/settings.json` of your project:
|
|
|
50
59
|
```
|
|
51
60
|
|
|
52
61
|
Reload the VS Code window after changing the setting.
|
|
53
|
-
Attributes marked as
|
|
62
|
+
Attributes marked as _complex value_ (arrays and objects, e.g. the table `headers` and `items`) must be set as JavaScript properties, not as HTML attributes.
|
package/index.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Component } from 'vue';
|
|
2
|
-
|
|
3
2
|
export declare namespace CORVINA {
|
|
4
3
|
type AnchorBlock = 'top' | 'bottom';
|
|
5
4
|
type AnchorInline = 'start' | 'end' | 'left' | 'right';
|
|
@@ -57,7 +56,7 @@ export declare namespace CORVINA {
|
|
|
57
56
|
* Return an empty array to tell there is no more data.
|
|
58
57
|
* Required if type is FILTER_BY_ENUM.AUTOCOMPLETE.
|
|
59
58
|
*/
|
|
60
|
-
searchFunction?: (search: string, page: number) =>
|
|
59
|
+
searchFunction?: (search: string, page: number) => unknown[] | Promise<unknown[]>;
|
|
61
60
|
/** Property on the items returned by the `searchFunction` that contains the title, shown in the options and in the chip (`FILTER.title`). Required if type is FILTER_BY_ENUM.AUTOCOMPLETE. */
|
|
62
61
|
itemsTitleKey?: string;
|
|
63
62
|
/** Property on the items returned by the `searchFunction` that contains the identifier, used as `FILTER.value` of the selected item. Required if type is FILTER_BY_ENUM.AUTOCOMPLETE. */
|
|
@@ -74,11 +73,25 @@ export declare namespace CORVINA {
|
|
|
74
73
|
/** Text shown in the chip instead of the value: the `itemsTitleKey` property of the selected item for FILTER_BY_ENUM.AUTOCOMPLETE */
|
|
75
74
|
title?: string;
|
|
76
75
|
}
|
|
76
|
+
/** An array of this structure defines what the user can sort by. */
|
|
77
|
+
interface SORT_BY {
|
|
78
|
+
/** Unique key of the sort, `SORT.key` when selected */
|
|
79
|
+
key: string;
|
|
80
|
+
/** Title shown in the sort dropdown */
|
|
81
|
+
title: string;
|
|
82
|
+
}
|
|
83
|
+
/** The sort selected by the user. */
|
|
84
|
+
interface SORT {
|
|
85
|
+
/** Key of the selected `SORT_BY` */
|
|
86
|
+
key: string;
|
|
87
|
+
/** Descending order */
|
|
88
|
+
desc: boolean;
|
|
89
|
+
}
|
|
77
90
|
interface CUSTOM_VUE_COMPONENT {
|
|
78
91
|
/** Name of the Vue component or Vue component definition */
|
|
79
92
|
component: string | Component;
|
|
80
93
|
/** Vue component's props */
|
|
81
|
-
props?: Record<string,
|
|
94
|
+
props?: Record<string, unknown>;
|
|
82
95
|
/** Name of the prop that will contain the row item */
|
|
83
96
|
itemPropName?: string;
|
|
84
97
|
/** Name of the prop that indicates where the component should be positioned */
|
|
@@ -102,6 +115,115 @@ export declare namespace CORVINA {
|
|
|
102
115
|
X_LARGE = "x-large"
|
|
103
116
|
}
|
|
104
117
|
}
|
|
118
|
+
namespace TABS {
|
|
119
|
+
/** A tab of CvTabs. */
|
|
120
|
+
interface TAB {
|
|
121
|
+
/** Unique value of the tab: `selected` and the `update:selected` event use it */
|
|
122
|
+
value: string | number;
|
|
123
|
+
/** Text shown in the tab */
|
|
124
|
+
title: string;
|
|
125
|
+
/** The data-qa attribute of the tab, for testing and automation */
|
|
126
|
+
dataQa?: string;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
namespace DATE_RANGE {
|
|
130
|
+
/** A range of days of CvDateRange, both days included. */
|
|
131
|
+
interface RANGE {
|
|
132
|
+
/** First day, ISO `yyyy-MM-dd` */
|
|
133
|
+
start: string;
|
|
134
|
+
/** Last day, ISO `yyyy-MM-dd` */
|
|
135
|
+
end: string;
|
|
136
|
+
}
|
|
137
|
+
/** A preset of CvDateRange: a button above the calendars that selects its range. */
|
|
138
|
+
interface PRESET {
|
|
139
|
+
/** Text of the button */
|
|
140
|
+
title: string;
|
|
141
|
+
/** The range it selects, `null` to clear the selection */
|
|
142
|
+
range: RANGE | null;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
namespace DIALOG {
|
|
146
|
+
/** What a CvDialog is for (design system FEEDBACK-1, FEEDBACK-3). */
|
|
147
|
+
enum TYPE {
|
|
148
|
+
/** Asks: Cancel and a confirm button, before an important or destructive action */
|
|
149
|
+
CONFIRM = "confirm",
|
|
150
|
+
/** Informs: the failure of an operation, with one button to acknowledge it */
|
|
151
|
+
INFORM = "inform"
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
namespace FIELD {
|
|
155
|
+
/** A validation rule of a field (Vuetify's): `true`, or the message of the error. */
|
|
156
|
+
type RULE = ((value: any) => true | string) | ((value: any) => Promise<true | string>);
|
|
157
|
+
/** What a CvTextField holds. */
|
|
158
|
+
enum TYPE {
|
|
159
|
+
TEXT = "text",
|
|
160
|
+
/** Hidden, with a button that shows it */
|
|
161
|
+
PASSWORD = "password",
|
|
162
|
+
/** A number: `modelValue` is a number, `null` when empty */
|
|
163
|
+
NUMBER = "number"
|
|
164
|
+
}
|
|
165
|
+
/** A choice of a CvRadioGroup, CvSelect or CvAutocomplete (which also take other objects, see `itemTitle`). */
|
|
166
|
+
interface ITEM {
|
|
167
|
+
title: string;
|
|
168
|
+
value: string | number | boolean;
|
|
169
|
+
disabled?: boolean;
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* The search of a CvAutocomplete on the server: the items matching `search`, page `page` (from 0). An empty page
|
|
173
|
+
* ends the list. As the `searchFunction` of a CORVINA.BREADCRUMB.FILTER_BY.
|
|
174
|
+
*/
|
|
175
|
+
type SEARCH = (search: string, page: number) => unknown[] | Promise<unknown[]>;
|
|
176
|
+
}
|
|
177
|
+
namespace SNACKBAR {
|
|
178
|
+
/** What a CvSnackbar reports, which sets its colour. */
|
|
179
|
+
enum TYPE {
|
|
180
|
+
/** An operation succeeded (design system FEEDBACK-2) */
|
|
181
|
+
SUCCESS = "success",
|
|
182
|
+
/** Something the user should know, that blocks nothing */
|
|
183
|
+
WARNING = "warning",
|
|
184
|
+
/** A minor failure; an operation that failed is reported with an informing CvDialog (FEEDBACK-3) */
|
|
185
|
+
ERROR = "error"
|
|
186
|
+
}
|
|
187
|
+
/** Where a CvSnackbar appears. */
|
|
188
|
+
enum POSITION {
|
|
189
|
+
/** Centred at the bottom of the window */
|
|
190
|
+
BOTTOM = "bottom",
|
|
191
|
+
/** Centred at the top, below the bars of the page */
|
|
192
|
+
TOP = "top"
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
namespace PANEL {
|
|
196
|
+
/** Where a CvPanel slides in from. */
|
|
197
|
+
enum POSITION {
|
|
198
|
+
/** The right edge, full height (design system PANEL-1) */
|
|
199
|
+
RIGHT = "right",
|
|
200
|
+
/** The lower half of the window, full width (the help of a page, HELP-3) */
|
|
201
|
+
BOTTOM = "bottom"
|
|
202
|
+
}
|
|
203
|
+
/** What a CvPanel is for, which sets its header. */
|
|
204
|
+
enum TYPE {
|
|
205
|
+
/** Creates or edits: the header holds cancel and confirm (PANEL-1, PANEL-3) */
|
|
206
|
+
EDIT = "edit",
|
|
207
|
+
/** Explains: the help icon, a title and Close (HELP-3, HELP-5) */
|
|
208
|
+
HELP = "help"
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
namespace INFINITE_LOADER {
|
|
212
|
+
/**
|
|
213
|
+
* Argument of the `infinite` event of CvInfiniteLoader: when the page is fetched call `loaded()` (more pages may
|
|
214
|
+
* follow), `complete()` (no more pages) or `error()` (the loader shows a retry button).
|
|
215
|
+
*/
|
|
216
|
+
interface StateHandler {
|
|
217
|
+
/** The page is loading: the loader shows the spinner (it already does before emitting `infinite`) */
|
|
218
|
+
loading: () => void;
|
|
219
|
+
/** The page was added: the loader requests the next one if it is still visible */
|
|
220
|
+
loaded: () => void;
|
|
221
|
+
/** There are no more pages: the loader stops until `identifier` changes */
|
|
222
|
+
complete: () => void;
|
|
223
|
+
/** The page could not be loaded: the loader shows the retry button */
|
|
224
|
+
error: () => void;
|
|
225
|
+
}
|
|
226
|
+
}
|
|
105
227
|
namespace TABLE {
|
|
106
228
|
/** Horizontal alignment of a column (applied as `text-*` and `justify-*` classes) */
|
|
107
229
|
enum ALIGN {
|
|
@@ -156,10 +278,15 @@ export declare namespace CORVINA {
|
|
|
156
278
|
type PropIconEntries = PropIconEntry[];
|
|
157
279
|
interface PropButtonEntry {
|
|
158
280
|
label?: string;
|
|
281
|
+
dataQa?: string;
|
|
159
282
|
tooltip?: string;
|
|
160
283
|
icon?: string;
|
|
161
284
|
/** If true the button becomes a spinner */
|
|
162
285
|
loading?: boolean;
|
|
286
|
+
/** The user may do it, but not on this row now (STATE-1): shown in g4. Leave the entry out if they may never do it. */
|
|
287
|
+
disabled?: boolean;
|
|
288
|
+
/** While disabled, the tooltip says why (STATE-2) */
|
|
289
|
+
disabledReason?: string;
|
|
163
290
|
function: (item: any) => void;
|
|
164
291
|
}
|
|
165
292
|
type PropButtonEntries = PropButtonEntry[];
|
|
@@ -167,6 +294,8 @@ export declare namespace CORVINA {
|
|
|
167
294
|
title: string;
|
|
168
295
|
icon?: string;
|
|
169
296
|
disabled?: boolean;
|
|
297
|
+
/** While disabled, the tooltip says why (STATE-2) */
|
|
298
|
+
disabledReason?: string;
|
|
170
299
|
tooltip?: string;
|
|
171
300
|
alignTooltip?: TOOLTIP_LOCATION;
|
|
172
301
|
function: (item: any) => void;
|
|
@@ -177,16 +306,27 @@ export declare namespace CORVINA {
|
|
|
177
306
|
/** Name of the Vue component or Vue component definition */
|
|
178
307
|
component: string | Component;
|
|
179
308
|
/** Vue component's props */
|
|
180
|
-
props?: Record<string,
|
|
309
|
+
props?: Record<string, unknown>;
|
|
181
310
|
/** Name of the prop that will contain the row item */
|
|
182
311
|
itemPropName?: string;
|
|
183
312
|
}
|
|
313
|
+
/** Props of the `item.<key>` cell slot */
|
|
314
|
+
interface CellSlotProps {
|
|
315
|
+
/** The row item */
|
|
316
|
+
item: any;
|
|
317
|
+
/** `item[key]` */
|
|
318
|
+
value: any;
|
|
319
|
+
/** Index of the row in the page */
|
|
320
|
+
index: number;
|
|
321
|
+
/** The column's header entry */
|
|
322
|
+
column: TableHeaderEntry;
|
|
323
|
+
}
|
|
184
324
|
/** Use it with `HEADER_CELL_TYPE.VUE_COMPONENT` */
|
|
185
325
|
interface HeaderVueComponent {
|
|
186
326
|
/** Name of the Vue component or Vue component definition */
|
|
187
327
|
component: string | Component;
|
|
188
328
|
/** Vue component's props */
|
|
189
|
-
props?: Record<string,
|
|
329
|
+
props?: Record<string, unknown>;
|
|
190
330
|
}
|
|
191
331
|
/**
|
|
192
332
|
* Interface representing a table header entry.
|
|
@@ -222,8 +362,8 @@ export declare namespace CORVINA {
|
|
|
222
362
|
customHeaderCellGeneratorFunction?: () => HTMLElement;
|
|
223
363
|
/** The `HeaderVueComponent` describing the vuejs component to use */
|
|
224
364
|
headerVueComponent?: HeaderVueComponent;
|
|
225
|
-
/** Type of the row cells */
|
|
226
|
-
type
|
|
365
|
+
/** Type of the row cells. Not needed when the table has the column's `item.<key>` slot. */
|
|
366
|
+
type?: CELL_TYPE;
|
|
227
367
|
/** Function that generates the cell virtual dom */
|
|
228
368
|
customCellGeneratorFunction?: (item: any, header: TableHeaderEntry) => HTMLElement;
|
|
229
369
|
/** Name of the property of the item object containing the `VueComponent` data */
|
package/package.json
CHANGED
|
@@ -1,26 +1,16 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
"**/*"
|
|
18
|
-
],
|
|
19
|
-
"dependencies": {
|
|
20
|
-
"v3-infinite-loading": "^1.3.2",
|
|
21
|
-
"vue": "^3.4.21",
|
|
22
|
-
"vuetify": "^3.7.5"
|
|
23
|
-
},
|
|
24
|
-
"packageManager": "pnpm@9.1.1+sha1.09ada6cd05003e0ced25fb716f9fda4063ec2e3b"
|
|
25
|
-
}
|
|
26
|
-
|
|
2
|
+
"name": "@corvina/web-components-library",
|
|
3
|
+
"version": "1.0.0-beta.10",
|
|
4
|
+
"private": false,
|
|
5
|
+
"description": "Corvina web components (custom elements)",
|
|
6
|
+
"homepage": "https://docs.components.corvina.cloud/",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/Corvina-R-D/corvina-components-library.git"
|
|
10
|
+
},
|
|
11
|
+
"keywords": ["corvina", "web-components", "custom-elements", "vuetify"],
|
|
12
|
+
"main": "web-components-library.umd.js",
|
|
13
|
+
"module": "web-components-library.es.js",
|
|
14
|
+
"types": "web-components-library.es.d.ts",
|
|
15
|
+
"files": ["*", "**/*"]
|
|
16
|
+
}
|