@corvina/web-components-library 1.0.0-beta.11 → 1.0.0-beta.13

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
@@ -44,6 +44,9 @@ Breaking changes:
44
44
  (STATE-3): it was g2 at 26% opacity. Disabled menu entries of `CvTable` are g4 too (were Vuetify's 60% opacity).
45
45
  - `CvBreadcrumb` on a mobile screen (Vuetify's `mobile`, below 1145px) shows the chips row only when it has chips, as
46
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`).
47
50
 
48
51
  Added:
49
52
 
@@ -59,16 +62,19 @@ Added:
59
62
  ISO days) owned by the parent (`update:model` from the accept button), `presets` (`CORVINA.DATE_RANGE.PRESET[]`) and
60
63
  the start and end calendars; highlighted while a range is set, underlined as frontend-new's field (highlight color
61
64
  on hover; the text from the start of the underline, both 16px in while a range is set).
62
- - `CvPanel` (`<cv-panel>`): the panels of frontend-new, `open` owned by the parent. `position` (`CORVINA.PANEL.POSITION`)
63
- `right` (full height, `width` 340 by default, at most 75% of the window) or `bottom` (the lower half of the window).
64
- `type` (`CORVINA.PANEL.TYPE`) `edit` creates or edits: a fixed header with the icon, `operation` over `title`, the
65
- help button, cancel and confirm (OperationalComponent), the body scrolling under it; `confirm` leaves it open,
66
- cancel emits `cancel` and `update:open`; `confirmDisabled`, `loading` (cancel and the body locked), `collapsed` (only
67
- the header, in the bottom corner); the `help` slot opens on the left of the panel, the `actions` slot adds buttons to
68
- the header. `type` `help` explains: the help icon, `title` and Close (`update:open`), the help in the default slot
69
- with the docs look (in the web components the slotted content keeps the page's styles). Replaces `CvHelpPanel`
70
- (`<cv-help-panel>`) of the betas: `<CvPanel position="bottom" type="help">`, same `title`, `closeLabel` and
71
- `data-qa`.
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`.
72
78
  - `CvInfiniteLoader` (`<cv-infinite-loader>`): the infinite scroll of the autocomplete filters, for the app's
73
79
  own lists. It emits `infinite` (`$state`: `CORVINA.INFINITE_LOADER.StateHandler`) when it is visible in its scrolling
74
80
  container, not again while a page loads; `loaded()`, `complete()` (stops it) and `error()` (retry button, `retryLabel`);
@@ -86,8 +92,8 @@ Added:
86
92
  emit `update:open` with `false`. In the web components it stays in the shadow root.
87
93
  - Form fields, the look of frontend-new's side panel fields: `CvTextField` (`<cv-text-field>`; `type`
88
94
  `CORVINA.FIELD.TYPE` `text`, `password` with the button that shows it, or `number`, which holds a number; `loading`,
89
- `clearable`, `min`, `max`), `CvTextarea` (`<cv-textarea>`; `rows`, `autoGrow`, `noResize`), `CvCheckbox`
90
- (`<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`
91
97
  `CORVINA.FIELD.ITEM[]`, `inline`). Each has `modelValue` (`v-model`), `label`, `placeholder` (text fields), `help`
92
98
  (the (?) with its tooltip), `disabled` (g4) with `disabledReason` (the tooltip that says why), `readonly`, `rules`
93
99
  (`CORVINA.FIELD.RULE[]`), `errorMessages` and `hideDetails`. A `v-form` of the page sees them (Vue); in the web
@@ -96,6 +102,30 @@ Added:
96
102
  - `CvAutocomplete` (`<cv-autocomplete>`): a `CvSelect` that filters its `items` on what is typed (INPUT-2), or with a
97
103
  `searchFunction` (`CORVINA.FIELD.SEARCH`, `(search, page) => items`, as the breadcrumb's autocomplete filters) searches
98
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).
99
129
  - `CvButton` `disabledReason`: while the button is disabled, its tooltip says why (STATE-2), in place of `tooltip`.
100
130
  - `CvTable` row buttons (`CORVINA.TABLE.PropButtonEntry`): `disabled`, with `disabledReason` for the tooltip, and
101
131
  `dataQa`. Menu entries (`MenuPropEntry`) have `disabledReason` too. Each row has its own buttons: the `ROW_ACTIONS`
@@ -110,6 +140,8 @@ Added:
110
140
  Fixed:
111
141
 
112
142
  - The icon buttons of `CvTable` and `CvBreadcrumb` no longer submit a form they are in (`type="button"`).
143
+ - `CvWeekdays`: 8px between the label and the days' names, were 2px (the names looked stuck to the label).
144
+ - `CvButton`: each button has its own element reference (one was shared by all the buttons of the page).
113
145
  - `CvBreadcrumb`: a filter key selected in the dropdown is dropped when `allowedFilters` no longer contain it.
114
146
  - `CvBreadcrumb` looks like frontend-new's breadcrumb: full-height light dividers (`CvBreadcrumbDivider` too,
115
147
  was a 25px dark line), the filter area 860px wide and starting with a divider, the filter key dropdown 13em on the
@@ -119,8 +151,14 @@ Fixed:
119
151
  The filters take the free room up to 860px and go to a row of their own only below 200px.
120
152
  - `CvDateRange` on a screen narrower than its two calendars (640px): one under the other, within the screen, the
121
153
  menu scrolling under its bar of presets and buttons; the presets scroll sideways when the bar is short of room. The
122
- menu ran off the screen.
154
+ menu ran off the screen. The calendars widen to the bar when it has more presets than fit above them (it left a
155
+ white area on the right).
123
156
  - `CvPanel` bottom help on a phone (below 600px): 16px gutters, were 60px.
157
+ - `CvPanel` help beside an edit panel: it slides out from under the panel, as the panel opens (it appeared at once).
158
+ On a phone (below 600px) it opens over the panel, the whole width, with 16px gutters: it was hidden, and its button
159
+ did nothing.
160
+ - The breadcrumb's chips are pushed to the right by a rule of their own: it applied to every Vuetify slide group in a
161
+ `.corvina` element, and the tabs in a `CvPanel` ended on the right.
124
162
  - `CvTable` rows are highlighted on hover (Vuetify's standard `hover`), the expanded content is not, as in
125
163
  frontend-new; the items-per-page select of the footer is underlined, with "Rows per page:" (Vuetify's
126
164
  `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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@corvina/web-components-library",
3
- "version": "1.0.0-beta.11",
3
+ "version": "1.0.0-beta.13",
4
4
  "private": false,
5
5
  "description": "Corvina web components (custom elements)",
6
6
  "homepage": "https://docs.components.corvina.cloud/",
@@ -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 {};