@retailcrm/embed-ui-v1-components 0.9.14 → 0.9.16
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/AGENTS.md +126 -0
- package/README.md +24 -0
- package/assets/sprites/map-and-places/navigate.svg +3 -0
- package/assets/stylesheets/palette.less +11 -6
- package/bin/embed-ui-v1-components.mjs +209 -0
- package/bin/postinstall.mjs +37 -0
- package/dist/host.cjs +2443 -657
- package/dist/host.css +920 -6
- package/dist/host.d.ts +2440 -6
- package/dist/host.js +2444 -658
- package/dist/remote.cjs +1009 -46
- package/dist/remote.d.ts +1240 -67
- package/dist/remote.js +1011 -48
- package/docs/AI.md +106 -0
- package/docs/COMPONENTS.md +99 -0
- package/docs/FORMAT.md +267 -0
- package/docs/PROFILES.md +66 -0
- package/docs/README.md +65 -0
- package/docs/STYLING.md +156 -0
- package/docs/profiles/UiAddButton.yml +57 -0
- package/docs/profiles/UiAlert.yml +48 -0
- package/docs/profiles/UiAvatar.yml +48 -0
- package/docs/profiles/UiAvatarList.yml +42 -0
- package/docs/profiles/UiButton.yml +229 -0
- package/docs/profiles/UiCalendar.yml +48 -0
- package/docs/profiles/UiCheckbox.yml +53 -0
- package/docs/profiles/UiCollapse.yml +40 -0
- package/docs/profiles/UiCollapseBox.yml +51 -0
- package/docs/profiles/UiCollapseGroup.yml +39 -0
- package/docs/profiles/UiCopyButton.yml +52 -0
- package/docs/profiles/UiDate.yml +38 -0
- package/docs/profiles/UiDatePicker.yml +59 -0
- package/docs/profiles/UiError.yml +32 -0
- package/docs/profiles/UiField.yml +233 -0
- package/docs/profiles/UiImage.yml +39 -0
- package/docs/profiles/UiInfobox.yml +45 -0
- package/docs/profiles/UiLink.yml +51 -0
- package/docs/profiles/UiLoader.yml +38 -0
- package/docs/profiles/UiMenuItem.yml +57 -0
- package/docs/profiles/UiMenuItemGroup.yml +50 -0
- package/docs/profiles/UiModalSidebar.yml +46 -0
- package/docs/profiles/UiModalWindow.yml +44 -0
- package/docs/profiles/UiModalWindowSurface.yml +41 -0
- package/docs/profiles/UiNumberStepper.yml +52 -0
- package/docs/profiles/UiPageHeader.yml +244 -0
- package/docs/profiles/UiPopper.yml +201 -0
- package/docs/profiles/UiPopperConnector.yml +115 -0
- package/docs/profiles/UiPopperTarget.yml +118 -0
- package/docs/profiles/UiRadio.yml +38 -0
- package/docs/profiles/UiRadioSwitch.yml +231 -0
- package/docs/profiles/UiRadioSwitchOption.yml +121 -0
- package/docs/profiles/UiScrollBox.yml +31 -0
- package/docs/profiles/UiSelect.yml +327 -0
- package/docs/profiles/UiSelectOption.yml +44 -0
- package/docs/profiles/UiSelectOptionGroup.yml +38 -0
- package/docs/profiles/UiSlider.yml +38 -0
- package/docs/profiles/UiSwitch.yml +37 -0
- package/docs/profiles/UiTab.yml +119 -0
- package/docs/profiles/UiTabGroup.yml +238 -0
- package/docs/profiles/UiTable.yml +152 -0
- package/docs/profiles/UiTableBodyCell.yml +47 -0
- package/docs/profiles/UiTableColumn.yml +50 -0
- package/docs/profiles/UiTableFooterButton.yml +44 -0
- package/docs/profiles/UiTableFooterSection.yml +38 -0
- package/docs/profiles/UiTableHeadCell.yml +44 -0
- package/docs/profiles/UiTableSorter.yml +45 -0
- package/docs/profiles/UiTag.yml +41 -0
- package/docs/profiles/UiTextbox.yml +392 -0
- package/docs/profiles/UiTimePicker.yml +46 -0
- package/docs/profiles/UiToggleButton.yml +211 -0
- package/docs/profiles/UiToggleGroup.yml +211 -0
- package/docs/profiles/UiToggleGroupOption.yml +116 -0
- package/docs/profiles/UiToolbarButton.yml +37 -0
- package/docs/profiles/UiToolbarLink.yml +32 -0
- package/docs/profiles/UiTooltip.yml +43 -0
- package/docs/profiles/UiTransition.yml +27 -0
- package/docs/profiles/UiYandexMap.yml +29 -0
- package/package.json +8 -3
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
component: UiRadioSwitchOption
|
|
2
|
+
summary: >
|
|
3
|
+
UiRadioSwitchOption is the declarative option child of UiRadioSwitch. It is the
|
|
4
|
+
richer alternative to the plain options array and is used when one option needs
|
|
5
|
+
custom icon, label, description, or selected-state checkmark content.
|
|
6
|
+
|
|
7
|
+
public_import:
|
|
8
|
+
from: '@retailcrm/embed-ui-v1-components/remote'
|
|
9
|
+
named:
|
|
10
|
+
- UiRadioSwitchOption
|
|
11
|
+
- UiRadioSwitch
|
|
12
|
+
|
|
13
|
+
related_components:
|
|
14
|
+
- UiRadioSwitch
|
|
15
|
+
|
|
16
|
+
use_when:
|
|
17
|
+
- You need one manually declared option inside UiRadioSwitch.
|
|
18
|
+
- One option needs description or custom slot content.
|
|
19
|
+
- You need per-option icon or custom selected-state mark.
|
|
20
|
+
|
|
21
|
+
avoid_when:
|
|
22
|
+
- A simple options array on UiRadioSwitch is enough.
|
|
23
|
+
- You need standalone radio semantics outside UiRadioSwitch.
|
|
24
|
+
|
|
25
|
+
api:
|
|
26
|
+
key_props:
|
|
27
|
+
- name: value
|
|
28
|
+
notes: Required option value.
|
|
29
|
+
- name: label
|
|
30
|
+
notes: Plain-text fallback label.
|
|
31
|
+
- name: description
|
|
32
|
+
notes: Secondary copy for section appearance.
|
|
33
|
+
- name: disabled
|
|
34
|
+
notes: Marks this option as non-interactive.
|
|
35
|
+
props:
|
|
36
|
+
- name: id
|
|
37
|
+
notes: Optional explicit id, otherwise generated automatically.
|
|
38
|
+
- name: value
|
|
39
|
+
notes: Required and passed back through UiRadioSwitch selection updates.
|
|
40
|
+
- name: label
|
|
41
|
+
notes: Optional when label slot is used.
|
|
42
|
+
- name: description
|
|
43
|
+
notes: Primarily useful for appearance=section.
|
|
44
|
+
- name: disabled
|
|
45
|
+
notes: Excluded from selection and keyboard navigation.
|
|
46
|
+
slots:
|
|
47
|
+
- name: default
|
|
48
|
+
zone: full option body
|
|
49
|
+
notes: Replaces the whole internal option layout.
|
|
50
|
+
- name: icon
|
|
51
|
+
zone: leading icon
|
|
52
|
+
notes: Custom leading icon for the option header.
|
|
53
|
+
- name: label
|
|
54
|
+
zone: main label
|
|
55
|
+
notes: Overrides the plain label prop.
|
|
56
|
+
- name: description
|
|
57
|
+
zone: secondary description
|
|
58
|
+
notes: Used mainly in section mode.
|
|
59
|
+
- name: checkmark
|
|
60
|
+
zone: selected-state indicator
|
|
61
|
+
notes: Replaces the default selected-state icon in section mode.
|
|
62
|
+
|
|
63
|
+
rendered_structure:
|
|
64
|
+
descriptive_only: true
|
|
65
|
+
root:
|
|
66
|
+
shape: div.ui-v1-radio-switch-option
|
|
67
|
+
tag: div
|
|
68
|
+
notes: >
|
|
69
|
+
UiRadioSwitchOption does not own the whole selection model. It is rendered inside
|
|
70
|
+
UiRadioSwitch and becomes one radio node within the parent radiogroup.
|
|
71
|
+
|
|
72
|
+
geometry:
|
|
73
|
+
layout: segmented option shell or card-like option
|
|
74
|
+
root_display: flex
|
|
75
|
+
width_behavior: flexible within the parent group layout
|
|
76
|
+
|
|
77
|
+
behavior:
|
|
78
|
+
states:
|
|
79
|
+
- name: disabled
|
|
80
|
+
notes: Cannot be selected and is skipped by keyboard navigation.
|
|
81
|
+
- name: checked
|
|
82
|
+
notes: Managed by the parent UiRadioSwitch.
|
|
83
|
+
- name: appearance=section
|
|
84
|
+
notes: Can show description and selected-state checkmark.
|
|
85
|
+
notes:
|
|
86
|
+
- Click selects the option through the parent group.
|
|
87
|
+
- Space and Enter select the focused option.
|
|
88
|
+
- Arrow keys delegate focus and selection movement through the parent group.
|
|
89
|
+
|
|
90
|
+
accessibility:
|
|
91
|
+
notes:
|
|
92
|
+
- The parent group applies radio semantics to the option shell.
|
|
93
|
+
- The current implementation participates in roving tabindex managed by UiRadioSwitch.
|
|
94
|
+
|
|
95
|
+
composition:
|
|
96
|
+
works_well_with:
|
|
97
|
+
- UiRadioSwitch
|
|
98
|
+
patterns:
|
|
99
|
+
- title: Rich switch option
|
|
100
|
+
notes: Use when one option needs icon, label, description, and custom selected state.
|
|
101
|
+
|
|
102
|
+
examples:
|
|
103
|
+
- title: Section option
|
|
104
|
+
goal: Define one rich option inside a radio switch.
|
|
105
|
+
code: |
|
|
106
|
+
<UiRadioSwitchOption
|
|
107
|
+
label="Manual"
|
|
108
|
+
:value="{ key: 'manual' }"
|
|
109
|
+
description="Manual setup"
|
|
110
|
+
>
|
|
111
|
+
<template #icon>
|
|
112
|
+
<IconStar />
|
|
113
|
+
</template>
|
|
114
|
+
</UiRadioSwitchOption>
|
|
115
|
+
|
|
116
|
+
ai_notes:
|
|
117
|
+
do:
|
|
118
|
+
- Use inside UiRadioSwitch when one option needs richer content than the options array allows.
|
|
119
|
+
- Prefer label and description props for simple content and slots for richer custom markup.
|
|
120
|
+
avoid:
|
|
121
|
+
- Do not use it as a standalone control outside UiRadioSwitch.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
component: UiScrollBox
|
|
2
|
+
summary: >
|
|
3
|
+
UiScrollBox is a scrollable container for constrained content areas. Use it when content
|
|
4
|
+
should remain inside a dedicated scrolling region instead of growing the whole page.
|
|
5
|
+
|
|
6
|
+
public_import:
|
|
7
|
+
from: '@retailcrm/embed-ui-v1-components/remote'
|
|
8
|
+
named:
|
|
9
|
+
- UiScrollBox
|
|
10
|
+
|
|
11
|
+
use_when:
|
|
12
|
+
- You need a bounded scroll area.
|
|
13
|
+
- You need long content inside a fixed-height or fixed-width region.
|
|
14
|
+
|
|
15
|
+
avoid_when:
|
|
16
|
+
- You need normal page scrolling.
|
|
17
|
+
|
|
18
|
+
api:
|
|
19
|
+
key_props: []
|
|
20
|
+
|
|
21
|
+
rendered_structure:
|
|
22
|
+
descriptive_only: true
|
|
23
|
+
root:
|
|
24
|
+
shape: configurable wrapper tag or PerfectScrollbar root
|
|
25
|
+
tag: configurable, div by default
|
|
26
|
+
notes: The root depends on native mode and tag prop, but behaves as a scroll container rather than a visual primitive.
|
|
27
|
+
|
|
28
|
+
geometry:
|
|
29
|
+
layout: scroll container
|
|
30
|
+
root_display: block
|
|
31
|
+
width_behavior: stretches to the size of its layout context
|
|
@@ -0,0 +1,327 @@
|
|
|
1
|
+
component: UiSelect
|
|
2
|
+
summary: >
|
|
3
|
+
UiSelect is a dropdown component for single-select and multi-select flows. It combines
|
|
4
|
+
a textbox-like trigger with a popper-based option layer. For a correct mental model,
|
|
5
|
+
read it together with UiPopper, UiPopperConnector, and UiPopperTarget.
|
|
6
|
+
|
|
7
|
+
public_import:
|
|
8
|
+
from: '@retailcrm/embed-ui-v1-components/remote'
|
|
9
|
+
named:
|
|
10
|
+
- UiSelect
|
|
11
|
+
- UiSelectOption
|
|
12
|
+
- UiSelectOptionGroup
|
|
13
|
+
|
|
14
|
+
related_components:
|
|
15
|
+
- UiField
|
|
16
|
+
- UiTextbox
|
|
17
|
+
- UiPopper
|
|
18
|
+
- UiPopperConnector
|
|
19
|
+
- UiPopperTarget
|
|
20
|
+
|
|
21
|
+
use_when:
|
|
22
|
+
- You need to choose one value from a list.
|
|
23
|
+
- You need multi-select behavior.
|
|
24
|
+
- You need filtering over option labels or descriptions.
|
|
25
|
+
- You need grouped options.
|
|
26
|
+
- You need field semantics plus a dropdown selector.
|
|
27
|
+
|
|
28
|
+
avoid_when:
|
|
29
|
+
- You need free-form text input.
|
|
30
|
+
- You need a button menu without a value model.
|
|
31
|
+
- You need a custom async-search UX outside the documented select flow.
|
|
32
|
+
|
|
33
|
+
api:
|
|
34
|
+
key_props:
|
|
35
|
+
- name: value
|
|
36
|
+
notes: Selected value or array of values in multiple mode.
|
|
37
|
+
- name: placeholder
|
|
38
|
+
notes: Trigger text for empty state.
|
|
39
|
+
- name: multiple
|
|
40
|
+
notes: Switches to an array-based value model.
|
|
41
|
+
- name: filterable
|
|
42
|
+
notes: Enables typed filtering.
|
|
43
|
+
- name: clearable
|
|
44
|
+
notes: Enables a clear action for selection or filter text.
|
|
45
|
+
- name: equalsFn
|
|
46
|
+
notes: Critical for object values.
|
|
47
|
+
- name: placement
|
|
48
|
+
notes: Controls where the popper is positioned.
|
|
49
|
+
- name: popperFitTrigger
|
|
50
|
+
notes: Keeps the dropdown at least as wide as the trigger.
|
|
51
|
+
- name: expanded
|
|
52
|
+
notes: Lets the parent control open state.
|
|
53
|
+
props:
|
|
54
|
+
- name: invalid
|
|
55
|
+
notes: Enables error state on the textbox-like trigger.
|
|
56
|
+
- name: readonly
|
|
57
|
+
notes: Keeps the current value visible but blocks changes.
|
|
58
|
+
- name: disabled
|
|
59
|
+
notes: Disables both trigger and dropdown interaction.
|
|
60
|
+
- name: placeholderOnly
|
|
61
|
+
notes: Forces the trigger to show only placeholder text.
|
|
62
|
+
- name: textboxSize
|
|
63
|
+
notes: Controls the trigger size.
|
|
64
|
+
- name: targetTriggers
|
|
65
|
+
notes: Popper trigger rules on the target side.
|
|
66
|
+
- name: popperTriggers
|
|
67
|
+
notes: Popper trigger rules on the dropdown side.
|
|
68
|
+
- name: popperClass
|
|
69
|
+
notes: Extra class for the dropdown layer.
|
|
70
|
+
- name: popperOptions
|
|
71
|
+
notes: Low-level floating behavior options.
|
|
72
|
+
- name: ticker
|
|
73
|
+
notes: Technical signal for relayout or selection updates.
|
|
74
|
+
child_components:
|
|
75
|
+
- name: UiSelectOption
|
|
76
|
+
key_props:
|
|
77
|
+
- value
|
|
78
|
+
- label
|
|
79
|
+
- description
|
|
80
|
+
- disabled
|
|
81
|
+
- counter
|
|
82
|
+
- accent
|
|
83
|
+
notes: Base selectable option node.
|
|
84
|
+
- name: UiSelectOptionGroup
|
|
85
|
+
key_props:
|
|
86
|
+
- label
|
|
87
|
+
notes: Groups related options together.
|
|
88
|
+
slots:
|
|
89
|
+
- name: default
|
|
90
|
+
zone: option tree inside popper content
|
|
91
|
+
creates: The option registry and the visible option tree inside the dropdown.
|
|
92
|
+
accepts:
|
|
93
|
+
recommended:
|
|
94
|
+
- UiSelectOption
|
|
95
|
+
- UiSelectOptionGroup
|
|
96
|
+
avoid:
|
|
97
|
+
- arbitrary div wrappers
|
|
98
|
+
- form controls
|
|
99
|
+
- unrelated custom layout
|
|
100
|
+
layout_effect: Child nodes become dropdown content and participate in selection, filtering, and keyboard navigation.
|
|
101
|
+
notes: >
|
|
102
|
+
The safe path is to build the option tree from UiSelectOption and UiSelectOptionGroup.
|
|
103
|
+
Arbitrary children can break selection, keyboard navigation, and active-option flow.
|
|
104
|
+
emits:
|
|
105
|
+
- name: update:value
|
|
106
|
+
payload: unknown
|
|
107
|
+
notes: Main selection update channel.
|
|
108
|
+
- name: input
|
|
109
|
+
payload: Event
|
|
110
|
+
notes: Comes from the textbox-like trigger.
|
|
111
|
+
- name: focus
|
|
112
|
+
payload: FocusEvent
|
|
113
|
+
notes: Trigger focus.
|
|
114
|
+
- name: blur
|
|
115
|
+
payload: FocusEvent
|
|
116
|
+
notes: Trigger blur.
|
|
117
|
+
- name: clear
|
|
118
|
+
payload: undefined
|
|
119
|
+
notes: Fired when the clear action is used.
|
|
120
|
+
- name: update:expanded
|
|
121
|
+
payload: boolean
|
|
122
|
+
notes: Open-state update channel.
|
|
123
|
+
- name: keydown
|
|
124
|
+
payload: KeyboardEvent
|
|
125
|
+
notes: Main keyboard navigation channel.
|
|
126
|
+
- name: show
|
|
127
|
+
payload: undefined
|
|
128
|
+
notes: The dropdown starts opening.
|
|
129
|
+
- name: hide
|
|
130
|
+
payload: undefined
|
|
131
|
+
notes: The dropdown starts closing.
|
|
132
|
+
- name: shown
|
|
133
|
+
payload: undefined
|
|
134
|
+
notes: The dropdown is open.
|
|
135
|
+
- name: hidden
|
|
136
|
+
payload: undefined
|
|
137
|
+
notes: The dropdown is closed.
|
|
138
|
+
- name: dispose
|
|
139
|
+
payload: undefined
|
|
140
|
+
notes: The dropdown layer is disposed.
|
|
141
|
+
|
|
142
|
+
rendered_structure:
|
|
143
|
+
descriptive_only: true
|
|
144
|
+
notes: >
|
|
145
|
+
Select is not a single DOM node in practice. Trigger and dropdown live in separate layers.
|
|
146
|
+
root:
|
|
147
|
+
trigger_shape: div.ui-v1-select
|
|
148
|
+
trigger_tag: div
|
|
149
|
+
dropdown_shape: div.ui-v1-select__popper via UiPopper
|
|
150
|
+
dropdown_tag: div
|
|
151
|
+
composition:
|
|
152
|
+
- UiPopperConnector as shared context
|
|
153
|
+
- UiSelectTrigger as textbox-like trigger
|
|
154
|
+
- UiSelectPopper as dropdown layer
|
|
155
|
+
- no-results text when filterable and no match exists
|
|
156
|
+
- default slot with the option tree
|
|
157
|
+
classes:
|
|
158
|
+
- .ui-v1-select for trigger root
|
|
159
|
+
- .ui-v1-select__popper for dropdown root
|
|
160
|
+
- .ui-v1-select-option for option root
|
|
161
|
+
- .ui-v1-select-option-group for option group
|
|
162
|
+
|
|
163
|
+
geometry:
|
|
164
|
+
trigger_layout: textbox-like, fit-content, max-width 100%
|
|
165
|
+
dropdown_layout: popper layer outside normal document flow
|
|
166
|
+
root_display:
|
|
167
|
+
trigger: block
|
|
168
|
+
dropdown: block in a floating layer
|
|
169
|
+
width_behavior: trigger is content-sized with max-width 100%, dropdown follows content and popperFitTrigger rules
|
|
170
|
+
notes:
|
|
171
|
+
- The trigger behaves visually like a textbox.
|
|
172
|
+
- The dropdown is rendered in a popper layer outside normal flow.
|
|
173
|
+
- The dropdown content has max-height and internal scrolling.
|
|
174
|
+
- popperFitTrigger is useful when the dropdown should not be narrower than the trigger.
|
|
175
|
+
- In multiple mode the trigger may collapse into a summary label when selected labels do not fit.
|
|
176
|
+
|
|
177
|
+
styling:
|
|
178
|
+
notes:
|
|
179
|
+
- The trigger reuses the textbox visual model.
|
|
180
|
+
- The dropdown reuses popper variables for padding, radius, and floating surface geometry.
|
|
181
|
+
- Classes are descriptive implementation hooks, not a stable external styling contract.
|
|
182
|
+
root_classes:
|
|
183
|
+
- .ui-v1-select
|
|
184
|
+
- .ui-v1-select__trigger
|
|
185
|
+
- .ui-v1-select__touchstone
|
|
186
|
+
- .ui-v1-select__input
|
|
187
|
+
- .ui-v1-select__popper
|
|
188
|
+
- .ui-v1-select__content
|
|
189
|
+
- .ui-v1-select__no-results-text
|
|
190
|
+
- .ui-v1-select-option
|
|
191
|
+
- .ui-v1-select-option-group
|
|
192
|
+
state_classes:
|
|
193
|
+
- .ui-v1-select_active
|
|
194
|
+
- .ui-v1-select_filterable
|
|
195
|
+
- .ui-v1-select__content_locked
|
|
196
|
+
- .ui-v1-select-option_hidden
|
|
197
|
+
- .ui-v1-select-option-group_hidden
|
|
198
|
+
css_variables:
|
|
199
|
+
public_theme_variables:
|
|
200
|
+
- name: --ui-v1-popper-padding
|
|
201
|
+
effect: Dropdown content padding.
|
|
202
|
+
- name: --ui-v1-popper-roundings
|
|
203
|
+
effect: Dropdown surface corner radius.
|
|
204
|
+
inherited_component_variables:
|
|
205
|
+
- name: --ui-v1-textbox-primary-color
|
|
206
|
+
effect: Active trigger underline and caret color.
|
|
207
|
+
internal_layout_variables:
|
|
208
|
+
- name: --border-color
|
|
209
|
+
effect: Trigger border or underline color inherited from UiTextbox.
|
|
210
|
+
- name: --active-color
|
|
211
|
+
effect: Trigger active color inherited from UiTextbox.
|
|
212
|
+
typography:
|
|
213
|
+
trigger:
|
|
214
|
+
notes:
|
|
215
|
+
- Trigger typography follows UiTextbox and therefore depends on textboxSize.
|
|
216
|
+
- The default trigger size is the textbox default size unless textboxSize changes it.
|
|
217
|
+
dropdown:
|
|
218
|
+
font_family: shared ui font family
|
|
219
|
+
notes:
|
|
220
|
+
- No-results text uses the dropdown text styling rather than heading typography.
|
|
221
|
+
- Option and group rows should be treated as compact list content, not heading-scale content.
|
|
222
|
+
|
|
223
|
+
behavior:
|
|
224
|
+
states:
|
|
225
|
+
- name: multiple
|
|
226
|
+
notes: Switches the value model to an array and enables multi-selection.
|
|
227
|
+
- name: filterable
|
|
228
|
+
notes: Enables typed filtering by label or description.
|
|
229
|
+
- name: clearable
|
|
230
|
+
notes: Enables a clear action for selection or filter text.
|
|
231
|
+
- name: readonly
|
|
232
|
+
notes: Prevents changes while keeping display intact.
|
|
233
|
+
- name: disabled
|
|
234
|
+
notes: Disables both trigger and dropdown interaction.
|
|
235
|
+
- name: invalid
|
|
236
|
+
notes: Enables error styling on the trigger.
|
|
237
|
+
- name: placeholderOnly
|
|
238
|
+
notes: Forces placeholder display instead of selected labels.
|
|
239
|
+
selection_and_matching:
|
|
240
|
+
- If option values are objects, equalsFn is usually required.
|
|
241
|
+
- In single-select mode the dropdown closes after selecting an option.
|
|
242
|
+
- In multiple mode values are toggled inside the array model.
|
|
243
|
+
- Filtering matches option labels and descriptions.
|
|
244
|
+
- If nothing matches, a no-result block is shown.
|
|
245
|
+
keyboard:
|
|
246
|
+
- Arrow keys move the active highlight.
|
|
247
|
+
- Escape closes the dropdown.
|
|
248
|
+
- Tab closes the dropdown and lets focus move on.
|
|
249
|
+
- The active option is auto-scrolled into view when needed.
|
|
250
|
+
|
|
251
|
+
accessibility:
|
|
252
|
+
notes:
|
|
253
|
+
- The trigger uses role=combobox.
|
|
254
|
+
- The trigger manages aria-expanded, aria-controls, aria-haspopup, and aria-activedescendant.
|
|
255
|
+
- The dropdown acts as a listbox-like layer.
|
|
256
|
+
- In multiple mode it is marked as aria-multiselectable=true.
|
|
257
|
+
|
|
258
|
+
composition:
|
|
259
|
+
works_well_with:
|
|
260
|
+
- UiField
|
|
261
|
+
- UiSelectOption
|
|
262
|
+
- UiSelectOptionGroup
|
|
263
|
+
- UiPopper
|
|
264
|
+
- UiPopperConnector
|
|
265
|
+
- UiPopperTarget
|
|
266
|
+
patterns:
|
|
267
|
+
- title: Form field select
|
|
268
|
+
notes: Put UiSelect inside UiField for labeled required choices.
|
|
269
|
+
- title: Object value selection
|
|
270
|
+
notes: Use equalsFn explicitly for object values.
|
|
271
|
+
- title: Popper mental model
|
|
272
|
+
notes: Think of UiSelect as target plus floating dropdown, not as a single inline control.
|
|
273
|
+
|
|
274
|
+
examples:
|
|
275
|
+
- title: Standard select in a field
|
|
276
|
+
goal: Build a labeled select with field semantics.
|
|
277
|
+
code: |
|
|
278
|
+
<UiField id="assignee" label="Assignee">
|
|
279
|
+
<template #default="field">
|
|
280
|
+
<UiSelect
|
|
281
|
+
:id="field.id"
|
|
282
|
+
:invalid="field.invalid"
|
|
283
|
+
:placeholder="'Select assignee'"
|
|
284
|
+
v-model:value="assignee"
|
|
285
|
+
>
|
|
286
|
+
<UiSelectOption value="kyle" label="Kyle Simmons" />
|
|
287
|
+
<UiSelectOption value="eduardo" label="Eduardo Henry" />
|
|
288
|
+
</UiSelect>
|
|
289
|
+
</template>
|
|
290
|
+
</UiField>
|
|
291
|
+
- title: Grouped options
|
|
292
|
+
goal: Build a grouped option tree through the safe child components.
|
|
293
|
+
code: |
|
|
294
|
+
<UiSelect placeholder="Employee">
|
|
295
|
+
<UiSelectOptionGroup label="Sales">
|
|
296
|
+
<UiSelectOption value="kyle" label="Kyle Simmons" />
|
|
297
|
+
</UiSelectOptionGroup>
|
|
298
|
+
|
|
299
|
+
<UiSelectOptionGroup label="Support">
|
|
300
|
+
<UiSelectOption value="philip" label="Philip Williamson" />
|
|
301
|
+
</UiSelectOptionGroup>
|
|
302
|
+
</UiSelect>
|
|
303
|
+
- title: Object values with equalsFn
|
|
304
|
+
goal: Avoid object comparison by reference.
|
|
305
|
+
code: |
|
|
306
|
+
<UiSelect
|
|
307
|
+
v-model:value="selectedUser"
|
|
308
|
+
:equals-fn="(left, right) => left?.id === right?.id"
|
|
309
|
+
placeholder="Employee"
|
|
310
|
+
>
|
|
311
|
+
<UiSelectOption
|
|
312
|
+
v-for="user in users"
|
|
313
|
+
:key="user.id"
|
|
314
|
+
:value="user"
|
|
315
|
+
:label="user.name"
|
|
316
|
+
/>
|
|
317
|
+
</UiSelect>
|
|
318
|
+
|
|
319
|
+
ai_notes:
|
|
320
|
+
do:
|
|
321
|
+
- Set equalsFn for object values in most cases.
|
|
322
|
+
- Use only UiSelectOption and UiSelectOptionGroup in the default slot.
|
|
323
|
+
- Read this profile together with UiPopper, UiPopperConnector, and UiPopperTarget.
|
|
324
|
+
avoid:
|
|
325
|
+
- Do not place arbitrary div wrappers inside the option tree.
|
|
326
|
+
- Do not choose UiSelect when free text input is the real need.
|
|
327
|
+
- Do not assume the dropdown lives in normal document flow next to the trigger.
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
component: UiSelectOption
|
|
2
|
+
summary: >
|
|
3
|
+
UiSelectOption is the base selectable child of UiSelect. It represents one option node
|
|
4
|
+
in the select option tree.
|
|
5
|
+
|
|
6
|
+
public_import:
|
|
7
|
+
from: '@retailcrm/embed-ui-v1-components/remote'
|
|
8
|
+
named:
|
|
9
|
+
- UiSelectOption
|
|
10
|
+
|
|
11
|
+
related_components:
|
|
12
|
+
- UiSelect
|
|
13
|
+
- UiSelectOptionGroup
|
|
14
|
+
|
|
15
|
+
use_when:
|
|
16
|
+
- You need one option inside UiSelect.
|
|
17
|
+
|
|
18
|
+
avoid_when:
|
|
19
|
+
- You need free layout content inside a select dropdown.
|
|
20
|
+
|
|
21
|
+
api:
|
|
22
|
+
key_props:
|
|
23
|
+
- name: value
|
|
24
|
+
- name: label
|
|
25
|
+
- name: description
|
|
26
|
+
- name: disabled
|
|
27
|
+
- name: counter
|
|
28
|
+
- name: accent
|
|
29
|
+
|
|
30
|
+
rendered_structure:
|
|
31
|
+
descriptive_only: true
|
|
32
|
+
root:
|
|
33
|
+
shape: div.ui-v1-select-option
|
|
34
|
+
tag: div
|
|
35
|
+
notes: Renders one option wrapper that usually contains a UiMenuItem row.
|
|
36
|
+
|
|
37
|
+
geometry:
|
|
38
|
+
layout: listbox option row
|
|
39
|
+
root_display: block
|
|
40
|
+
width_behavior: stretches to available dropdown width
|
|
41
|
+
|
|
42
|
+
ai_notes:
|
|
43
|
+
do:
|
|
44
|
+
- Use as the default child node of UiSelect.
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
component: UiSelectOptionGroup
|
|
2
|
+
summary: >
|
|
3
|
+
UiSelectOptionGroup groups related UiSelectOption nodes under a shared label.
|
|
4
|
+
|
|
5
|
+
public_import:
|
|
6
|
+
from: '@retailcrm/embed-ui-v1-components/remote'
|
|
7
|
+
named:
|
|
8
|
+
- UiSelectOptionGroup
|
|
9
|
+
|
|
10
|
+
related_components:
|
|
11
|
+
- UiSelect
|
|
12
|
+
- UiSelectOption
|
|
13
|
+
|
|
14
|
+
use_when:
|
|
15
|
+
- You need grouped select options.
|
|
16
|
+
|
|
17
|
+
avoid_when:
|
|
18
|
+
- You only have a flat list of options.
|
|
19
|
+
|
|
20
|
+
api:
|
|
21
|
+
key_props:
|
|
22
|
+
- name: label
|
|
23
|
+
|
|
24
|
+
rendered_structure:
|
|
25
|
+
descriptive_only: true
|
|
26
|
+
root:
|
|
27
|
+
shape: div.ui-v1-select-option-group
|
|
28
|
+
tag: div
|
|
29
|
+
notes: Renders one structural group wrapper around a heading area and nested option content.
|
|
30
|
+
|
|
31
|
+
geometry:
|
|
32
|
+
layout: block-like option group wrapper
|
|
33
|
+
root_display: block
|
|
34
|
+
width_behavior: stretches to available dropdown width
|
|
35
|
+
|
|
36
|
+
ai_notes:
|
|
37
|
+
do:
|
|
38
|
+
- Use to structure large option lists inside UiSelect.
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
component: UiSlider
|
|
2
|
+
summary: >
|
|
3
|
+
UiSlider is a range-selection control for single values or ranges on a numeric track.
|
|
4
|
+
It supports single-handle and range-handle modes.
|
|
5
|
+
|
|
6
|
+
public_import:
|
|
7
|
+
from: '@retailcrm/embed-ui-v1-components/remote'
|
|
8
|
+
named:
|
|
9
|
+
- UiSlider
|
|
10
|
+
|
|
11
|
+
use_when:
|
|
12
|
+
- You need compact ranged numeric selection.
|
|
13
|
+
- You need one or two draggable handles on a track.
|
|
14
|
+
|
|
15
|
+
avoid_when:
|
|
16
|
+
- You need precise text entry.
|
|
17
|
+
|
|
18
|
+
api:
|
|
19
|
+
key_props:
|
|
20
|
+
- name: type
|
|
21
|
+
- name: value
|
|
22
|
+
- name: min
|
|
23
|
+
- name: max
|
|
24
|
+
- name: labelled
|
|
25
|
+
emits:
|
|
26
|
+
- name: update:value
|
|
27
|
+
|
|
28
|
+
rendered_structure:
|
|
29
|
+
descriptive_only: true
|
|
30
|
+
root:
|
|
31
|
+
shape: div.ui-v1-slider
|
|
32
|
+
tag: div
|
|
33
|
+
notes: The root contains labels, track, filler, and draggable handle nodes.
|
|
34
|
+
|
|
35
|
+
geometry:
|
|
36
|
+
layout: horizontal slider track
|
|
37
|
+
root_display: flex
|
|
38
|
+
width_behavior: stretches to container width by default
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
component: UiSwitch
|
|
2
|
+
summary: >
|
|
3
|
+
UiSwitch is a compact boolean toggle control. It is the most concise choice for on or off state
|
|
4
|
+
when checkbox semantics would feel visually heavy.
|
|
5
|
+
|
|
6
|
+
public_import:
|
|
7
|
+
from: '@retailcrm/embed-ui-v1-components/remote'
|
|
8
|
+
named:
|
|
9
|
+
- UiSwitch
|
|
10
|
+
|
|
11
|
+
use_when:
|
|
12
|
+
- You need a compact on or off toggle.
|
|
13
|
+
|
|
14
|
+
avoid_when:
|
|
15
|
+
- You need checkbox-group semantics.
|
|
16
|
+
|
|
17
|
+
api:
|
|
18
|
+
key_props:
|
|
19
|
+
- name: value
|
|
20
|
+
- name: square
|
|
21
|
+
- name: disabled
|
|
22
|
+
methods:
|
|
23
|
+
- name: click
|
|
24
|
+
- name: focus
|
|
25
|
+
- name: blur
|
|
26
|
+
|
|
27
|
+
rendered_structure:
|
|
28
|
+
descriptive_only: true
|
|
29
|
+
root:
|
|
30
|
+
shape: span.ui-v1-switch
|
|
31
|
+
tag: span
|
|
32
|
+
notes: The root is one compact inline switch control.
|
|
33
|
+
|
|
34
|
+
geometry:
|
|
35
|
+
layout: inline switch control
|
|
36
|
+
root_display: inline-block
|
|
37
|
+
width_behavior: content-sized by default
|