@corvina/web-components-library 1.0.0-beta.10 → 1.0.0-beta.12
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 +58 -12
- package/index.d.ts +36 -0
- package/package.json +1 -1
- package/utils/tree.d.ts +11 -0
- package/vscode.html-custom-data.json +519 -2
- package/web-components-library.cjs.js +5 -5
- package/web-components-library.es.js +1575 -454
- package/web-components-library.umd.js +10 -10
- package/web-components.d.ts +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -42,6 +42,11 @@ Breaking changes:
|
|
|
42
42
|
only option of an empty select is selected (INPUT-4, `autoSelect` `false` to keep it empty).
|
|
43
43
|
- A disabled `CvButton` is `--color-g4` (text, icon, border; the background of `filled`), without Vuetify's opacity
|
|
44
44
|
(STATE-3): it was g2 at 26% opacity. Disabled menu entries of `CvTable` are g4 too (were Vuetify's 60% opacity).
|
|
45
|
+
- `CvBreadcrumb` on a mobile screen (Vuetify's `mobile`, below 1145px) shows the chips row only when it has chips, as
|
|
46
|
+
frontend-new: an empty 40px row was always there.
|
|
47
|
+
- `CvTable` text (cells, footer) is `--color-dk`, as frontend-new's tables: it was Vuetify's 87% black.
|
|
48
|
+
- `CvButton` text is in sentence case ("Add action"), as frontend-new's buttons (TYPE-3): it was uppercase (the
|
|
49
|
+
`$button-text-transform` of the Vuetify settings, which stays for the app's own `v-btn`).
|
|
45
50
|
|
|
46
51
|
Added:
|
|
47
52
|
|
|
@@ -57,16 +62,19 @@ Added:
|
|
|
57
62
|
ISO days) owned by the parent (`update:model` from the accept button), `presets` (`CORVINA.DATE_RANGE.PRESET[]`) and
|
|
58
63
|
the start and end calendars; highlighted while a range is set, underlined as frontend-new's field (highlight color
|
|
59
64
|
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`
|
|
61
|
-
`right` (full height, `width` 340 by default, at most 75% of the window) or `bottom` (the
|
|
62
|
-
`type` (`CORVINA.PANEL.TYPE`) `edit` creates or edits: a fixed header with the icon,
|
|
63
|
-
help button, cancel and confirm (OperationalComponent), the body scrolling under it;
|
|
64
|
-
cancel emits `cancel` and `update:open`; `confirmDisabled
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
`
|
|
65
|
+
- `CvPanel` (`<cv-panel>`): the panels of frontend-new, `open` owned by the parent. `position`
|
|
66
|
+
(`CORVINA.PANEL.POSITION`) `right` (full height, `width` 340 by default, at most 75% of the window) or `bottom` (the
|
|
67
|
+
lower half of the window). `type` (`CORVINA.PANEL.TYPE`) `edit` creates or edits: a fixed header with the icon,
|
|
68
|
+
`operation` over `title`, the help button, cancel and confirm (OperationalComponent), the body scrolling under it;
|
|
69
|
+
`confirm` leaves it open, cancel emits `cancel` and `update:open`; `confirmDisabled` (with `confirmDisabledReason`,
|
|
70
|
+
its tooltip, STATE-2), `readonly` (no confirm: a read-only user views the object, STATE-4, or the panel only shows
|
|
71
|
+
data), `attach` (rendered in another element, e.g. an app's overlay layer above its host page's bars), `loading`
|
|
72
|
+
(cancel and the body locked), `collapsed` (only the header, in the bottom corner); the `help` slot opens on the left
|
|
73
|
+
of the panel (`helpWidth`, 480 by default), the `actions` slot adds buttons to the header; `helpOpen`
|
|
74
|
+
(`update:helpOpen`) lets the page open the help too. `type` `help` explains: the help icon, `title` and Close
|
|
75
|
+
(`update:open`), the help in the default slot with the docs look (in the web components the slotted content keeps the
|
|
76
|
+
page's styles). Replaces `CvHelpPanel` (`<cv-help-panel>`) of the betas: `<CvPanel position="bottom" type="help">`,
|
|
77
|
+
same `title`, `closeLabel` and `data-qa`.
|
|
70
78
|
- `CvInfiniteLoader` (`<cv-infinite-loader>`): the infinite scroll of the autocomplete filters, for the app's
|
|
71
79
|
own lists. It emits `infinite` (`$state`: `CORVINA.INFINITE_LOADER.StateHandler`) when it is visible in its scrolling
|
|
72
80
|
container, not again while a page loads; `loaded()`, `complete()` (stops it) and `error()` (retry button, `retryLabel`);
|
|
@@ -84,8 +92,8 @@ Added:
|
|
|
84
92
|
emit `update:open` with `false`. In the web components it stays in the shadow root.
|
|
85
93
|
- Form fields, the look of frontend-new's side panel fields: `CvTextField` (`<cv-text-field>`; `type`
|
|
86
94
|
`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`),
|
|
88
|
-
(`<cv-checkbox>`), `CvSwitch` (`<cv-switch>`) and `CvRadioGroup` (`<cv-radio-group>`; `items`
|
|
95
|
+
`clearable`, `min`, `max`, `hint`, `required`), `CvTextarea` (`<cv-textarea>`; `rows`, `autoGrow`, `noResize`),
|
|
96
|
+
`CvCheckbox` (`<cv-checkbox>`), `CvSwitch` (`<cv-switch>`) and `CvRadioGroup` (`<cv-radio-group>`; `items`
|
|
89
97
|
`CORVINA.FIELD.ITEM[]`, `inline`). Each has `modelValue` (`v-model`), `label`, `placeholder` (text fields), `help`
|
|
90
98
|
(the (?) with its tooltip), `disabled` (g4) with `disabledReason` (the tooltip that says why), `readonly`, `rules`
|
|
91
99
|
(`CORVINA.FIELD.RULE[]`), `errorMessages` and `hideDetails`. A `v-form` of the page sees them (Vue); in the web
|
|
@@ -94,6 +102,30 @@ Added:
|
|
|
94
102
|
- `CvAutocomplete` (`<cv-autocomplete>`): a `CvSelect` that filters its `items` on what is typed (INPUT-2), or with a
|
|
95
103
|
`searchFunction` (`CORVINA.FIELD.SEARCH`, `(search, page) => items`, as the breadcrumb's autocomplete filters) searches
|
|
96
104
|
on the server, the next pages at the end of the menu. `noDataText`, `loadingText`.
|
|
105
|
+
- `CvTree` (`<cv-tree>`): a tree with the look of frontend-new's (34px rows, 24px levels with a guide line), or a list
|
|
106
|
+
when no item has children. `items` with `itemKey`, `itemTitle` and `itemChildren`; `opened` and `selected` owned by
|
|
107
|
+
the parent (`update:opened`, `update:selected`); arrow keys, Enter. `draggable`: drag and drop with the Pointer
|
|
108
|
+
Events (mouse, pen, touch; no library), Alt + arrows among the siblings, before, after or inside an item that holds
|
|
109
|
+
children, `canDrop` (`CORVINA.TREE.MOVE`) to refuse a drop, `handle` to drag from a handle only; it emits `move`, the
|
|
110
|
+
parent moves the item (`moveTreeItem(items, move, itemChildren)` in place; `treeKeys` lists the keys to open all).
|
|
111
|
+
Vue: `label` and `append` (row actions, on hover) slots; the web components show the titles.
|
|
112
|
+
- `CvCombobox` (`<cv-combobox>`): a list of values, frontend-new's `VChipComponent`: the field only adds, each value
|
|
113
|
+
is a chip under it (its title, a remove button; `removeLabel`). From `items` or a `searchFunction`, as
|
|
114
|
+
`CvAutocomplete` (the added ones are not listed again), or `freeText`: Enter or the add button (`addLabel`) adds what
|
|
115
|
+
is typed once `entryRules` accept it. `hint` while the list is empty; `rules` check the array; the other props of
|
|
116
|
+
the form fields.
|
|
117
|
+
- `CvButtonToggle` (`<cv-button-toggle>`): frontend-new's pair of buttons beside a field (`>` or `≥` of a bound, `%` or
|
|
118
|
+
`Abs` of a deadband): `items` (`CORVINA.FIELD.ITEM` with a `label` for a symbol), the chosen one in g2, the arrow
|
|
119
|
+
keys choose the next; `label` names the group; `disabled` with `disabledReason`, `readonly`.
|
|
120
|
+
- `CvWeekdays` (`<cv-weekdays>`): frontend-new's active time period, a checkbox a day under its short name; the value
|
|
121
|
+
is the chosen days as `Date.getDay()` numbers them (Sunday 0), in order. `dayNames` (Sunday first, English by
|
|
122
|
+
default), `firstDay` (Monday by default).
|
|
123
|
+
- `CvKeyValueField` (`<cv-key-value-field>`): frontend-new's webhook headers, a key and its value typed side by side,
|
|
124
|
+
the pairs as chips `key : value` under them (`Record<string, string>`); a key already there takes the new value.
|
|
125
|
+
`keyLabel`, `valueLabel`, `addLabel`, `removeLabel`.
|
|
126
|
+
- `CvButton` `menu` (`CORVINA.BUTTON.MENU_ENTRY[]`): choices the button opens in a menu (e.g. the type of what to
|
|
127
|
+
add), `select` with the `value` of the clicked one; entries `disabled` with `disabledReason`, `divider` between
|
|
128
|
+
groups. `danger`: a destructive action, the alert colour on hover (THEME-4).
|
|
97
129
|
- `CvButton` `disabledReason`: while the button is disabled, its tooltip says why (STATE-2), in place of `tooltip`.
|
|
98
130
|
- `CvTable` row buttons (`CORVINA.TABLE.PropButtonEntry`): `disabled`, with `disabledReason` for the tooltip, and
|
|
99
131
|
`dataQa`. Menu entries (`MenuPropEntry`) have `disabledReason` too. Each row has its own buttons: the `ROW_ACTIONS`
|
|
@@ -108,10 +140,24 @@ Added:
|
|
|
108
140
|
Fixed:
|
|
109
141
|
|
|
110
142
|
- The icon buttons of `CvTable` and `CvBreadcrumb` no longer submit a form they are in (`type="button"`).
|
|
143
|
+
- `CvButton`: each button has its own element reference (one was shared by all the buttons of the page).
|
|
111
144
|
- `CvBreadcrumb`: a filter key selected in the dropdown is dropped when `allowedFilters` no longer contain it.
|
|
112
145
|
- `CvBreadcrumb` looks like frontend-new's breadcrumb: full-height light dividers (`CvBreadcrumbDivider` too,
|
|
113
146
|
was a 25px dark line), the filter area 860px wide and starting with a divider, the filter key dropdown 13em on the
|
|
114
147
|
g1 background without the underline, the filter value field 16px from it.
|
|
148
|
+
- `CvBreadcrumb` on a narrow screen: the bar wraps when its parts do not fit, as frontend-new's (title and date range,
|
|
149
|
+
then the sort, then the filters), instead of running off the screen; the library has no Vuetify `flex-wrap` class.
|
|
150
|
+
The filters take the free room up to 860px and go to a row of their own only below 200px.
|
|
151
|
+
- `CvDateRange` on a screen narrower than its two calendars (640px): one under the other, within the screen, the
|
|
152
|
+
menu scrolling under its bar of presets and buttons; the presets scroll sideways when the bar is short of room. The
|
|
153
|
+
menu ran off the screen. The calendars widen to the bar when it has more presets than fit above them (it left a
|
|
154
|
+
white area on the right).
|
|
155
|
+
- `CvPanel` bottom help on a phone (below 600px): 16px gutters, were 60px.
|
|
156
|
+
- `CvPanel` help beside an edit panel: it slides out from under the panel, as the panel opens (it appeared at once).
|
|
157
|
+
On a phone (below 600px) it opens over the panel, the whole width, with 16px gutters: it was hidden, and its button
|
|
158
|
+
did nothing.
|
|
159
|
+
- The breadcrumb's chips are pushed to the right by a rule of their own: it applied to every Vuetify slide group in a
|
|
160
|
+
`.corvina` element, and the tabs in a `CvPanel` ended on the right.
|
|
115
161
|
- `CvTable` rows are highlighted on hover (Vuetify's standard `hover`), the expanded content is not, as in
|
|
116
162
|
frontend-new; the items-per-page select of the footer is underlined, with "Rows per page:" (Vuetify's
|
|
117
163
|
`dataTable.itemsPerPageText`, translated) and the selected value of its menu in the highlight color, as in
|
package/index.d.ts
CHANGED
|
@@ -105,6 +105,17 @@ export declare namespace CORVINA {
|
|
|
105
105
|
FILLED = "FILLED",
|
|
106
106
|
OUTLINED = "OUTLINED"
|
|
107
107
|
}
|
|
108
|
+
/** A choice of the menu of a CvButton (`menu`): a click emits `select` with its `value`. */
|
|
109
|
+
interface MENU_ENTRY {
|
|
110
|
+
title: string;
|
|
111
|
+
value: string | number;
|
|
112
|
+
disabled?: boolean;
|
|
113
|
+
/** While disabled, why: the tooltip of the entry (STATE-2) */
|
|
114
|
+
disabledReason?: string;
|
|
115
|
+
/** A line before the entry, between groups of choices */
|
|
116
|
+
divider?: boolean;
|
|
117
|
+
dataQa?: string;
|
|
118
|
+
}
|
|
108
119
|
}
|
|
109
120
|
namespace ICON {
|
|
110
121
|
enum SIZE {
|
|
@@ -126,6 +137,31 @@ export declare namespace CORVINA {
|
|
|
126
137
|
dataQa?: string;
|
|
127
138
|
}
|
|
128
139
|
}
|
|
140
|
+
namespace TREE {
|
|
141
|
+
/** An item of CvTree: its key, title and children are in the fields named by `itemKey`, `itemTitle` and `itemChildren` */
|
|
142
|
+
type ITEM = Record<string, any>;
|
|
143
|
+
/** The `key` of an item */
|
|
144
|
+
type KEY = string | number;
|
|
145
|
+
/** Where a dragged item goes, next to the item it is dropped on */
|
|
146
|
+
enum DROP {
|
|
147
|
+
/** Before the target, in the same list */
|
|
148
|
+
BEFORE = "before",
|
|
149
|
+
/** After the target, in the same list */
|
|
150
|
+
AFTER = "after",
|
|
151
|
+
/** The last child of the target (an item with a children array) */
|
|
152
|
+
INSIDE = "inside"
|
|
153
|
+
}
|
|
154
|
+
/** A drop of CvTree (`move` event, `canDrop` prop) */
|
|
155
|
+
interface MOVE {
|
|
156
|
+
/** The dragged item */
|
|
157
|
+
item: ITEM;
|
|
158
|
+
/** The item it is dropped on */
|
|
159
|
+
target: ITEM;
|
|
160
|
+
position: DROP;
|
|
161
|
+
/** The parent the item will have: the target for INSIDE, the target's parent otherwise (null at the top level) */
|
|
162
|
+
parent: ITEM | null;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
129
165
|
namespace DATE_RANGE {
|
|
130
166
|
/** A range of days of CvDateRange, both days included. */
|
|
131
167
|
interface RANGE {
|
package/package.json
CHANGED
package/utils/tree.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { CORVINA } from '../index';
|
|
2
|
+
type Item = CORVINA.TREE.ITEM;
|
|
3
|
+
/**
|
|
4
|
+
* Applies a `move` of CvTree to `items`, in place: the item leaves its list and goes before or after the target, or
|
|
5
|
+
* at the end of the target's children. The item objects are kept (a reference to one, e.g. the selected one, stays
|
|
6
|
+
* valid).
|
|
7
|
+
*/
|
|
8
|
+
export declare function moveTreeItem(items: Item[], { item, target, position }: CORVINA.TREE.MOVE, itemChildren?: string): void;
|
|
9
|
+
/** The keys of the items with children, at any depth: `opened` for a tree all open. */
|
|
10
|
+
export declare function treeKeys(items: Item[], itemKey?: string, itemChildren?: string): CORVINA.TREE.KEY[];
|
|
11
|
+
export {};
|