@salesql/sql_components_vue3 3.21.0 → 3.22.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.
package/llms-full.txt CHANGED
@@ -1,4 +1,4 @@
1
- # @salesql/sql_components_vue3 — SalesQL Design System (v3.21.0)
1
+ # @salesql/sql_components_vue3 — SalesQL Design System (v3.22.0)
2
2
 
3
3
  > Librería de componentes Vue 3 (SalesQL) Presentational-only Vue 3 components (props in, events out; the consuming app owns state, i18n and data). This file is auto-generated from the component stories for LLM/agent consumption — do not edit by hand.
4
4
 
@@ -355,6 +355,28 @@ also provides the `editor` slot, the same 300px popover swaps the list for that
355
355
  </DsContactCell>
356
356
  ```
357
357
 
358
+ The editor does not have to list only the emails of the cell it was opened from. When the back
359
+ classifies each email into a group (work / direct, by domain), pass `groups` instead of `items`: the
360
+ editor then shows ALL the contact's emails under subtitles, so an email added from one column never
361
+ «disappears» into the other one. New rows go at the end, without a subtitle; after saving, the back
362
+ places each one in its group. `save` still emits one flat list of values.
363
+
364
+ ```vue
365
+ <template #editor="{ close, cancel }">
366
+ <DsEmailEditor
367
+ :groups="[
368
+ { title: t('emails.work'), items: workEmails.map((value) => ({ value })) },
369
+ { title: t('emails.direct'), items: directEmails.map((value) => ({ value })) },
370
+ ]"
371
+ :copy="copy"
372
+ :saving="saving"
373
+ @save="persist"
374
+ @cancel="cancel"
375
+ @close="close"
376
+ />
377
+ </template>
378
+ ```
379
+
358
380
  - **`cancel()`** (back, Cancel) returns to the list; the popover stays open and pinned.
359
381
  - **`close()`** (the editor's close) closes the popover, un-pins it and leaves the mode.
360
382
  - A **successful save** is the app's call: set `editing` to `false` (back to the list with the new
@@ -684,7 +706,8 @@ colour `$contact-data-badge-a-plus-ink`. Mirrored 1:1 from the contract partial.
684
706
  ## DsEmailEditor
685
707
 
686
708
  The **«Edit emails» form** of a contact: a header (title, optional back and close), one input per
687
- email with a remove button, «+ Add email», the verification note and Cancel / Save. It is shown
709
+ email with a remove button (flat, or under subtitles with `groups`), «+ Add email», the verification
710
+ note and Cancel / Save. It is shown
688
711
  inside the contact cell popover and in the full-profile contact card, and works on its own in any
689
712
  ~300-320px panel.
690
713
 
@@ -697,11 +720,12 @@ job. There are no status marks (pills) inside the editor: the state is not shown
697
720
 
698
721
  ### Props
699
722
 
700
- | Prop | Type | Default | Description |
701
- | -------- | --------------------- | ------- | --------------------------------------------------------------------------------------------- |
702
- | `items` | `{ value: string }[]` | — | The current emails (required). Seeds the rows on mount and is the baseline of «what changed». |
703
- | `copy` | `DsEmailEditorCopy` | — | Every visible string (required). The app owns it. |
704
- | `saving` | `boolean` | `false` | The app's save is in flight: Save spins and the whole form is locked (see «Saving»). |
723
+ | Prop | Type | Default | Description |
724
+ | -------- | ----------------------------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------ |
725
+ | `items` | `{ value: string }[]` | `[]` | The current emails, flat (no subtitles). Seeds the rows on mount and is the baseline of «what changed». Ignored when `groups` is passed. |
726
+ | `groups` | `{ title: string; items: { value }[] }[]` | `undefined` | The current emails under subtitles, in the order given (see «Groups»). When passed it **wins over `items`**, even if it is an empty array. |
727
+ | `copy` | `DsEmailEditorCopy` | — | Every visible string (required). The app owns it. |
728
+ | `saving` | `boolean` | `false` | The app's save is in flight: Save spins and the whole form is locked (see «Saving»). |
705
729
 
706
730
  #### `copy` keys
707
731
 
@@ -726,7 +750,7 @@ job. There are no status marks (pills) inside the editor: the state is not shown
726
750
  | `cancel` | — | Cancel or the header's back button was used (leave without saving). |
727
751
  | `close` | — | The header's close button was used. Dismissing the host (popover, panel) is the consumer's job. |
728
752
  | `dirty-change` | `boolean` | What the form shows started (`true`) or stopped (`false`) differing from `items`: the same rule that enables Save (blank rows and surrounding spaces do not count; typing the original back is clean). Emitted on changes only: a fresh editor is clean and says nothing. In a `DsContactCell` wire it to the slot's `setDirty` (`@dirty-change="setDirty"`) so a click on the edit-mode backdrop does not drop unsaved edits. |
729
- | `save` | `(values: string[], changedCount: number)` | Save with no errors. `values`: the final non-empty trimmed emails, in order. `changedCount`: how many are new or have different text than `items` (the app prices «1 verification credit each» with it). |
753
+ | `save` | `(values: string[], changedCount: number)` | Save with no errors. `values`: the final non-empty trimmed emails, flat, in display order (with `groups`: every group in order, then the new rows). `changedCount`: how many are new or have different text than `items` (the app prices «1 verification credit each» with it). |
730
754
 
731
755
  ### Behaviour
732
756
 
@@ -736,7 +760,8 @@ job. There are no status marks (pills) inside the editor: the state is not shown
736
760
  email gets `invalidEmail`; a repeat (trimmed, case-insensitive) gets `duplicateEmail` on the
737
761
  later occurrences. An invalid text is never also reported as a duplicate. Empty rows are
738
762
  discarded, never an error. With errors, Save emits nothing and focuses the first failing row.
739
- - «+ Add email» appends an empty row and focuses it.
763
+ - «+ Add email» appends an empty row at the end and focuses it. With `groups` it goes after the last
764
+ group, in an untitled section (no subtitle).
740
765
  - **Saving**: with `saving` the Save button shows its own loading state (`DsButton` `loading`: spinner,
741
766
  `aria-busy`, not clickable) and the inputs, «Add email», the remove buttons, Cancel, back and close are
742
767
  disabled, so there are no edits and no double submit; `save` is not emitted again. The form region
@@ -754,6 +779,46 @@ job. There are no status marks (pills) inside the editor: the state is not shown
754
779
  note `info` (16, `muted`), back `chevron_left` (20, filled, `default`), close `close` (20, `muted`).
755
780
  The design's 18px and 14px glyphs move to 20 and 16, the sizes `DsIcon` has.
756
781
 
782
+ #### Groups
783
+
784
+ Use `groups` when the app's back classifies each email (work / direct, by its domain) and the
785
+ editor must show them ALL, not only the emails of the column it was opened from. Otherwise an
786
+ email added from «Direct email» lands in «Work email» after saving, vanishes from the editor and
787
+ re-adding it hits the duplicate error.
788
+
789
+ ```vue
790
+ <DsEmailEditor
791
+ :groups="[
792
+ { title: t('emails.work'), items: workEmails.map((value) => ({ value })) },
793
+ { title: t('emails.direct'), items: directEmails.map((value) => ({ value })) },
794
+ ]"
795
+ :copy="copy"
796
+ :saving="saving"
797
+ @save="persist"
798
+ @cancel="cancel"
799
+ @close="close"
800
+ />
801
+ ```
802
+
803
+ - Each group with rows renders a section with its `title` as a subtitle above the rows. The subtitle
804
+ uses the same type and ink as the section header of the `DsContactCell` popover list
805
+ («Work emails (2)»: `micro` 10px, bold, uppercase, 0.6px tracking, `contact-data-ink-muted`),
806
+ without the count and without the ruled band. A group with no emails, or whose rows were all
807
+ removed, renders nothing, not even its subtitle.
808
+ - **New rows go at the end, without a subtitle**, in an untitled section after the groups. The
809
+ editor cannot know where the back will put an email: after saving, the app re-renders with the
810
+ new `groups` and each one shows up in its own.
811
+ - Everything else is shared across groups: validation (format, and duplicates are checked across
812
+ ALL rows of all groups and the new ones, trimmed and case-insensitive), remove, the Save rule,
813
+ `dirty-change`, `saving`, and the focus (the first field of the first group).
814
+ - `save(values, changedCount)` keeps the flat shape: `values` is every row in display order (groups
815
+ in order, then the new rows) and `changedCount` counts the new or edited ones, so an app that
816
+ diffs by value works with `items` or `groups` alike.
817
+ - `groups` wins over `items` when both are passed. Like `items`, it is read when the editor mounts
818
+ (and as the baseline of «what changed»); a later change does not reset what the user is typing.
819
+ - A11y: each titled section is a `role="group"` named by its subtitle (`aria-labelledby`); the
820
+ untitled section has no role.
821
+
757
822
  #### Where it deliberately differs from the design export
758
823
 
759
824
  The export's input draws an accent focus border, bold text on focus and a dark rest border. The
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesql/sql_components_vue3",
3
- "version": "3.21.0",
3
+ "version": "3.22.0",
4
4
  "description": "Librería de componentes Vue 3 (SalesQL)",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",