@retailcrm/embed-ui-v1-components 0.9.19 → 0.9.22-alpha.1
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 +9 -1
- package/README.md +5 -2
- package/assets/sprites/actions/add-square-outlined.svg +8 -0
- package/assets/sprites/actions/drag.svg +8 -0
- package/bin/embed-ui-v1-components.mjs +231 -46
- package/bin/postinstall.mjs +3 -2
- package/dist/host.cjs +1223 -501
- package/dist/host.css +637 -10
- package/dist/host.d.ts +152 -78
- package/dist/host.js +1224 -502
- package/dist/remote.cjs +1358 -298
- package/dist/remote.d.ts +805 -67
- package/dist/remote.js +1360 -300
- package/docs/AI.md +99 -17
- package/docs/COMPONENTS.md +58 -59
- package/docs/FORMAT.md +10 -10
- package/docs/PROFILES.md +39 -22
- package/docs/README.md +11 -5
- package/docs/profiles/components/UiAddButton.yml +134 -0
- package/docs/profiles/components/UiAlert.yml +105 -0
- package/docs/profiles/components/UiAvatar.yml +88 -0
- package/docs/profiles/{UiAvatarList.yml → components/UiAvatarList.yml} +26 -0
- package/docs/profiles/{UiButton.yml → components/UiButton.yml} +14 -8
- package/docs/profiles/components/UiCalendar.yml +190 -0
- package/docs/profiles/components/UiCheckbox.yml +111 -0
- package/docs/profiles/components/UiCollapse.yml +129 -0
- package/docs/profiles/components/UiCollapseBox.yml +143 -0
- package/docs/profiles/{UiCollapseGroup.yml → components/UiCollapseGroup.yml} +24 -0
- package/docs/profiles/components/UiCopyButton.yml +104 -0
- package/docs/profiles/components/UiDate.yml +84 -0
- package/docs/profiles/components/UiDatePicker.yml +138 -0
- package/docs/profiles/components/UiError.yml +123 -0
- package/docs/profiles/{UiField.yml → components/UiField.yml} +46 -15
- package/docs/profiles/components/UiInfobox.yml +130 -0
- package/docs/profiles/components/UiLink.yml +111 -0
- package/docs/profiles/components/UiLoader.yml +71 -0
- package/docs/profiles/components/UiMenuItem.yml +93 -0
- package/docs/profiles/{UiMenuItemGroup.yml → components/UiMenuItemGroup.yml} +25 -0
- package/docs/profiles/components/UiModalSidebar.yml +156 -0
- package/docs/profiles/components/UiModalWindow.yml +181 -0
- package/docs/profiles/{UiModalWindowSurface.yml → components/UiModalWindowSurface.yml} +30 -0
- package/docs/profiles/components/UiNumberStepper.yml +100 -0
- package/docs/profiles/{UiPageHeader.yml → components/UiPageHeader.yml} +39 -23
- package/docs/profiles/components/UiPopconfirm.yml +164 -0
- package/docs/profiles/{UiPopper.yml → components/UiPopper.yml} +66 -13
- package/docs/profiles/{UiPopperConnector.yml → components/UiPopperConnector.yml} +5 -25
- package/docs/profiles/{UiPopperTarget.yml → components/UiPopperTarget.yml} +5 -25
- package/docs/profiles/components/UiRadio.yml +91 -0
- package/docs/profiles/{UiRadioSwitch.yml → components/UiRadioSwitch.yml} +55 -32
- package/docs/profiles/{UiRadioSwitchOption.yml → components/UiRadioSwitchOption.yml} +7 -13
- package/docs/profiles/components/UiScrollBox.yml +108 -0
- package/docs/profiles/{UiSelect.yml → components/UiSelect.yml} +133 -44
- package/docs/profiles/components/UiSelectOption.yml +74 -0
- package/docs/profiles/components/UiSelectOptionGroup.yml +66 -0
- package/docs/profiles/components/UiSkeleton.yml +82 -0
- package/docs/profiles/components/UiSlider.yml +161 -0
- package/docs/profiles/components/UiSwitch.yml +123 -0
- package/docs/profiles/components/UiTab.yml +234 -0
- package/docs/profiles/{UiTabGroup.yml → components/UiTabGroup.yml} +0 -30
- package/docs/profiles/components/UiTable.yml +622 -0
- package/docs/profiles/{UiTableBodyCell.yml → components/UiTableBodyCell.yml} +26 -0
- package/docs/profiles/components/UiTableColumn.yml +87 -0
- package/docs/profiles/components/UiTableFooterButton.yml +85 -0
- package/docs/profiles/components/UiTableFooterSection.yml +73 -0
- package/docs/profiles/{UiTableHeadCell.yml → components/UiTableHeadCell.yml} +26 -0
- package/docs/profiles/{UiTableSorter.yml → components/UiTableSorter.yml} +27 -0
- package/docs/profiles/components/UiTag.yml +90 -0
- package/docs/profiles/{UiTextbox.yml → components/UiTextbox.yml} +20 -32
- package/docs/profiles/components/UiTimePicker.yml +144 -0
- package/docs/profiles/{UiToggleButton.yml → components/UiToggleButton.yml} +16 -11
- package/docs/profiles/{UiToggleGroup.yml → components/UiToggleGroup.yml} +25 -13
- package/docs/profiles/{UiToggleGroupOption.yml → components/UiToggleGroupOption.yml} +7 -11
- package/docs/profiles/components/UiToolbarButton.yml +87 -0
- package/docs/profiles/components/UiToolbarLink.yml +80 -0
- package/docs/profiles/components/UiTooltip.yml +97 -0
- package/docs/profiles/components/UiTransition.yml +62 -0
- package/docs/profiles/components/UiYandexMap.yml +104 -0
- package/docs/profiles/pages/CardSettingsPage.yml +58 -0
- package/docs/profiles/pages/CollapseBlockPage.yml +46 -0
- package/docs/profiles/pages/EntityListPage.yml +66 -0
- package/docs/profiles/pages/ModalSidebar.yml +158 -0
- package/docs/profiles/pages/ModalWindow.yml +55 -0
- package/docs/profiles/pages/MultiColumnPage.yml +27 -0
- package/docs/profiles/pages/PageComposition.yml +56 -0
- package/package.json +15 -15
- package/docs/profiles/UiAddButton.yml +0 -57
- package/docs/profiles/UiAlert.yml +0 -48
- package/docs/profiles/UiAvatar.yml +0 -48
- package/docs/profiles/UiCalendar.yml +0 -48
- package/docs/profiles/UiCheckbox.yml +0 -53
- package/docs/profiles/UiCollapse.yml +0 -40
- package/docs/profiles/UiCollapseBox.yml +0 -51
- package/docs/profiles/UiCopyButton.yml +0 -52
- package/docs/profiles/UiDate.yml +0 -38
- package/docs/profiles/UiDatePicker.yml +0 -59
- package/docs/profiles/UiError.yml +0 -32
- package/docs/profiles/UiImage.yml +0 -39
- package/docs/profiles/UiInfobox.yml +0 -45
- package/docs/profiles/UiLink.yml +0 -51
- package/docs/profiles/UiLoader.yml +0 -38
- package/docs/profiles/UiMenuItem.yml +0 -57
- package/docs/profiles/UiModalSidebar.yml +0 -46
- package/docs/profiles/UiModalWindow.yml +0 -44
- package/docs/profiles/UiNumberStepper.yml +0 -52
- package/docs/profiles/UiRadio.yml +0 -38
- package/docs/profiles/UiScrollBox.yml +0 -31
- package/docs/profiles/UiSelectOption.yml +0 -44
- package/docs/profiles/UiSelectOptionGroup.yml +0 -38
- package/docs/profiles/UiSkeleton.yml +0 -41
- package/docs/profiles/UiSlider.yml +0 -38
- package/docs/profiles/UiSwitch.yml +0 -37
- package/docs/profiles/UiTab.yml +0 -119
- package/docs/profiles/UiTable.yml +0 -152
- package/docs/profiles/UiTableColumn.yml +0 -50
- package/docs/profiles/UiTableFooterButton.yml +0 -44
- package/docs/profiles/UiTableFooterSection.yml +0 -38
- package/docs/profiles/UiTag.yml +0 -41
- package/docs/profiles/UiTimePicker.yml +0 -46
- package/docs/profiles/UiToolbarButton.yml +0 -37
- package/docs/profiles/UiToolbarLink.yml +0 -32
- package/docs/profiles/UiTooltip.yml +0 -43
- package/docs/profiles/UiTransition.yml +0 -27
- package/docs/profiles/UiYandexMap.yml +0 -29
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
component: UiModalWindow
|
|
2
|
+
summary: >
|
|
3
|
+
UiModalWindow is the main centered modal container. It supports open state, closability,
|
|
4
|
+
appearance variants, fullscreen and responsive behavior, and dialog roles.
|
|
5
|
+
|
|
6
|
+
public_import:
|
|
7
|
+
from: '@retailcrm/embed-ui-v1-components/remote'
|
|
8
|
+
named:
|
|
9
|
+
- UiModalWindow
|
|
10
|
+
|
|
11
|
+
related_components:
|
|
12
|
+
- UiModalWindowSurface
|
|
13
|
+
|
|
14
|
+
examples:
|
|
15
|
+
- title: Example
|
|
16
|
+
code: |
|
|
17
|
+
<template>
|
|
18
|
+
<div>
|
|
19
|
+
<UiButton appearance="secondary" @click="open = true">
|
|
20
|
+
{{ buttonTitle }}
|
|
21
|
+
</UiButton>
|
|
22
|
+
|
|
23
|
+
<UiModalWindow v-model:opened="open" v-bind="$attrs">
|
|
24
|
+
<template #title>
|
|
25
|
+
Title
|
|
26
|
+
</template>
|
|
27
|
+
|
|
28
|
+
<div :style="$attrs.appearance == 'popup' ? { height: '1500px' } : {}">
|
|
29
|
+
<div>Some content</div>
|
|
30
|
+
|
|
31
|
+
<div v-if="hasNesting" style="margin-top: 16px">
|
|
32
|
+
<UiButton appearance="secondary" @click="openNesting = true">
|
|
33
|
+
Open nested window
|
|
34
|
+
</UiButton>
|
|
35
|
+
|
|
36
|
+
<UiModalWindow
|
|
37
|
+
v-if="!nestedOnSameLevel"
|
|
38
|
+
v-model:opened="openNesting"
|
|
39
|
+
responsive
|
|
40
|
+
>
|
|
41
|
+
<template #title>
|
|
42
|
+
Nested window
|
|
43
|
+
</template>
|
|
44
|
+
|
|
45
|
+
<p>Some content</p>
|
|
46
|
+
|
|
47
|
+
<template #footer>
|
|
48
|
+
<UiButton appearance="secondary" @click="openNesting = false">
|
|
49
|
+
Close
|
|
50
|
+
</UiButton>
|
|
51
|
+
</template>
|
|
52
|
+
</UiModalWindow>
|
|
53
|
+
</div>
|
|
54
|
+
</div>
|
|
55
|
+
|
|
56
|
+
<template #footer>
|
|
57
|
+
<UiButton appearance="secondary" @click="open = false">
|
|
58
|
+
Close
|
|
59
|
+
</UiButton>
|
|
60
|
+
</template>
|
|
61
|
+
</UiModalWindow>
|
|
62
|
+
|
|
63
|
+
<UiModalWindow
|
|
64
|
+
v-if="nestedOnSameLevel"
|
|
65
|
+
v-model:opened="openNesting"
|
|
66
|
+
v-bind="$attrs"
|
|
67
|
+
responsive
|
|
68
|
+
>
|
|
69
|
+
<template #title>
|
|
70
|
+
Nested same-level window
|
|
71
|
+
</template>
|
|
72
|
+
|
|
73
|
+
<p>Some content</p>
|
|
74
|
+
|
|
75
|
+
<template #footer>
|
|
76
|
+
<UiButton appearance="secondary" @click="openNesting = false">
|
|
77
|
+
Close
|
|
78
|
+
</UiButton>
|
|
79
|
+
</template>
|
|
80
|
+
</UiModalWindow>
|
|
81
|
+
</div>
|
|
82
|
+
</template>
|
|
83
|
+
|
|
84
|
+
<script lang="ts" setup>
|
|
85
|
+
import { ref } from 'vue'
|
|
86
|
+
|
|
87
|
+
import { UiButton } from '@retailcrm/embed-ui-v1-components/remote'
|
|
88
|
+
import { UiModalWindow } from '@retailcrm/embed-ui-v1-components/remote'
|
|
89
|
+
|
|
90
|
+
defineProps({
|
|
91
|
+
buttonTitle: {
|
|
92
|
+
type: String,
|
|
93
|
+
default: '',
|
|
94
|
+
},
|
|
95
|
+
|
|
96
|
+
hasNesting: {
|
|
97
|
+
type: Boolean,
|
|
98
|
+
default: false,
|
|
99
|
+
},
|
|
100
|
+
|
|
101
|
+
nestedOnSameLevel: {
|
|
102
|
+
type: Boolean,
|
|
103
|
+
default: false,
|
|
104
|
+
},
|
|
105
|
+
})
|
|
106
|
+
|
|
107
|
+
const open = ref(false)
|
|
108
|
+
const openNesting = ref(false)
|
|
109
|
+
</script>
|
|
110
|
+
|
|
111
|
+
use_when:
|
|
112
|
+
- You need a centered dialog.
|
|
113
|
+
- You need modal interaction with standard dialog semantics.
|
|
114
|
+
|
|
115
|
+
avoid_when:
|
|
116
|
+
- You need a side-docked modal, use UiModalSidebar instead.
|
|
117
|
+
|
|
118
|
+
api:
|
|
119
|
+
key_props:
|
|
120
|
+
- name: opened
|
|
121
|
+
- name: closable
|
|
122
|
+
- name: appearance
|
|
123
|
+
- name: fullscreen
|
|
124
|
+
- name: responsive
|
|
125
|
+
- name: scrolling
|
|
126
|
+
- name: role
|
|
127
|
+
methods:
|
|
128
|
+
- name: open
|
|
129
|
+
- name: close
|
|
130
|
+
|
|
131
|
+
rendered_structure:
|
|
132
|
+
descriptive_only: true
|
|
133
|
+
root:
|
|
134
|
+
shape: div.ui-v1-modal-window via UiModalWindowSurface
|
|
135
|
+
tag: div
|
|
136
|
+
notes: The component delegates the actual teleported modal root to UiModalWindowSurface and renders header, content, and footer inside it.
|
|
137
|
+
|
|
138
|
+
geometry:
|
|
139
|
+
layout: teleported modal layer with centered surface
|
|
140
|
+
root_display: flex
|
|
141
|
+
width_behavior: viewport-covering overlay with content-sized or responsive surface
|
|
142
|
+
|
|
143
|
+
behavior:
|
|
144
|
+
notes:
|
|
145
|
+
- opened controls modal visibility.
|
|
146
|
+
- closable should be false only when the user must complete or acknowledge a blocking flow.
|
|
147
|
+
- fullscreen and responsive affect surface sizing rather than modal semantics.
|
|
148
|
+
|
|
149
|
+
composition:
|
|
150
|
+
works_well_with:
|
|
151
|
+
- UiButton
|
|
152
|
+
- UiField
|
|
153
|
+
- UiModalWindowSurface
|
|
154
|
+
patterns:
|
|
155
|
+
- title: Confirmation dialog
|
|
156
|
+
notes: Keep copy concise and put primary and secondary actions in the footer.
|
|
157
|
+
- title: Focused form
|
|
158
|
+
notes: Use for short forms that should not navigate away from the current page.
|
|
159
|
+
|
|
160
|
+
ai_notes:
|
|
161
|
+
do:
|
|
162
|
+
- Use for focused blocking tasks and confirmations.
|
|
163
|
+
- Provide clear title, body, and footer actions when the modal asks the user to decide.
|
|
164
|
+
avoid:
|
|
165
|
+
- Do not use as a general page layout or for long workflows that deserve a full page or sidebar.
|
|
166
|
+
|
|
167
|
+
accessibility:
|
|
168
|
+
notes:
|
|
169
|
+
- Prefer visible text labels for interactive controls.
|
|
170
|
+
- For icon-only or custom visual content, provide an accessible name through the supported label, title, or ARIA attributes exposed by the component.
|
|
171
|
+
- Preserve native keyboard semantics by using the component root instead of recreating the control with arbitrary markup.
|
|
172
|
+
keyboard:
|
|
173
|
+
- Tab moves focus to the control when it is focusable.
|
|
174
|
+
- Enter or Space activates native button-like controls when the host implementation renders a button.
|
|
175
|
+
|
|
176
|
+
styling:
|
|
177
|
+
notes:
|
|
178
|
+
- Use documented props and slots as the primary styling API.
|
|
179
|
+
- Internal .ui-v1-* classes are descriptive implementation details for reasoning and debugging unless a profile marks them as public theme hooks.
|
|
180
|
+
root_classes:
|
|
181
|
+
- .ui-v1-modal-window
|
|
@@ -39,3 +39,33 @@ geometry:
|
|
|
39
39
|
layout: teleported modal overlay
|
|
40
40
|
root_display: flex
|
|
41
41
|
width_behavior: viewport-covering overlay with content-sized or responsive surface
|
|
42
|
+
|
|
43
|
+
behavior:
|
|
44
|
+
notes:
|
|
45
|
+
- Lower-level surface keeps modal mechanics while leaving more composition responsibility to the caller.
|
|
46
|
+
- Use role intentionally for dialog or alertdialog flows.
|
|
47
|
+
|
|
48
|
+
composition:
|
|
49
|
+
works_well_with:
|
|
50
|
+
- UiModalWindow
|
|
51
|
+
patterns:
|
|
52
|
+
- title: Custom modal shell
|
|
53
|
+
notes: Use only when UiModalWindow does not expose enough structure for the required modal.
|
|
54
|
+
|
|
55
|
+
ai_notes:
|
|
56
|
+
do:
|
|
57
|
+
- Prefer UiModalWindow for ordinary centered dialogs.
|
|
58
|
+
avoid:
|
|
59
|
+
- Do not choose the surface API just to change simple body content.
|
|
60
|
+
|
|
61
|
+
accessibility:
|
|
62
|
+
notes:
|
|
63
|
+
- Keep visible labels and slot content meaningful.
|
|
64
|
+
- Prefer documented props and slots over custom DOM replacements so host-side accessibility behavior is preserved.
|
|
65
|
+
|
|
66
|
+
styling:
|
|
67
|
+
notes:
|
|
68
|
+
- Use documented props and slots as the primary styling API.
|
|
69
|
+
- Internal .ui-v1-* classes are descriptive implementation details for reasoning and debugging unless a profile marks them as public theme hooks.
|
|
70
|
+
root_classes:
|
|
71
|
+
- .ui-v1-modal-window
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
component: UiNumberStepper
|
|
2
|
+
summary: >
|
|
3
|
+
UiNumberStepper is a numeric input with increase and decrease controls. It is built for
|
|
4
|
+
constrained numeric entry where arrowing and step-based changes matter.
|
|
5
|
+
|
|
6
|
+
public_import:
|
|
7
|
+
from: '@retailcrm/embed-ui-v1-components/remote'
|
|
8
|
+
named:
|
|
9
|
+
- UiNumberStepper
|
|
10
|
+
|
|
11
|
+
related_components:
|
|
12
|
+
- UiTextbox
|
|
13
|
+
|
|
14
|
+
examples:
|
|
15
|
+
- title: Example
|
|
16
|
+
code: |
|
|
17
|
+
<template>
|
|
18
|
+
<UiNumberStepper v-model:value="value" :min="0" :max="100" />
|
|
19
|
+
</template>
|
|
20
|
+
|
|
21
|
+
<script lang="ts" setup>
|
|
22
|
+
import { ref } from 'vue'
|
|
23
|
+
import { UiNumberStepper } from '@retailcrm/embed-ui-v1-components/remote'
|
|
24
|
+
|
|
25
|
+
const value = ref<number | null>(10)
|
|
26
|
+
</script>
|
|
27
|
+
|
|
28
|
+
use_when:
|
|
29
|
+
- You need numeric input with explicit step controls.
|
|
30
|
+
- You need range constraints and nullable numeric state.
|
|
31
|
+
|
|
32
|
+
avoid_when:
|
|
33
|
+
- You need plain text or decimal input without stepper controls.
|
|
34
|
+
|
|
35
|
+
api:
|
|
36
|
+
key_props:
|
|
37
|
+
- name: value
|
|
38
|
+
- name: min
|
|
39
|
+
- name: max
|
|
40
|
+
- name: step
|
|
41
|
+
- name: decimals
|
|
42
|
+
- name: clamp
|
|
43
|
+
- name: nullable
|
|
44
|
+
- name: direction
|
|
45
|
+
methods:
|
|
46
|
+
- name: focus
|
|
47
|
+
- name: blur
|
|
48
|
+
- name: increase
|
|
49
|
+
- name: decrease
|
|
50
|
+
|
|
51
|
+
rendered_structure:
|
|
52
|
+
descriptive_only: true
|
|
53
|
+
root:
|
|
54
|
+
shape: div.ui-v1-number-stepper
|
|
55
|
+
tag: div
|
|
56
|
+
notes: One inline control root wraps the text input and increment or decrement actions.
|
|
57
|
+
|
|
58
|
+
geometry:
|
|
59
|
+
layout: inline numeric control
|
|
60
|
+
root_display: inline-flex
|
|
61
|
+
width_behavior: content-sized by default
|
|
62
|
+
|
|
63
|
+
behavior:
|
|
64
|
+
notes:
|
|
65
|
+
- Can clamp values into range.
|
|
66
|
+
- Supports horizontal and vertical direction.
|
|
67
|
+
|
|
68
|
+
composition:
|
|
69
|
+
works_well_with:
|
|
70
|
+
- UiField
|
|
71
|
+
- UiTextbox
|
|
72
|
+
- UiSlider
|
|
73
|
+
patterns:
|
|
74
|
+
- title: Exact bounded number
|
|
75
|
+
notes: Use for quantities, limits, delays, and other settings where increment and decrement controls are useful.
|
|
76
|
+
- title: Numeric filter
|
|
77
|
+
notes: In table filters, keep the value in query parameters when routing exists.
|
|
78
|
+
|
|
79
|
+
ai_notes:
|
|
80
|
+
do:
|
|
81
|
+
- Use for precise numeric settings with known min, max, or step.
|
|
82
|
+
- Prefer nullable when clearing the value is a valid state.
|
|
83
|
+
avoid:
|
|
84
|
+
- Do not use when the value is an identifier, phone, code, or other numeric-looking text.
|
|
85
|
+
|
|
86
|
+
accessibility:
|
|
87
|
+
notes:
|
|
88
|
+
- Prefer visible text labels for interactive controls.
|
|
89
|
+
- For icon-only or custom visual content, provide an accessible name through the supported label, title, or ARIA attributes exposed by the component.
|
|
90
|
+
- Preserve native keyboard semantics by using the component root instead of recreating the control with arbitrary markup.
|
|
91
|
+
keyboard:
|
|
92
|
+
- Tab moves focus to the control when it is focusable.
|
|
93
|
+
- Enter or Space activates native button-like controls when the host implementation renders a button.
|
|
94
|
+
|
|
95
|
+
styling:
|
|
96
|
+
notes:
|
|
97
|
+
- Use documented props and slots as the primary styling API.
|
|
98
|
+
- Internal .ui-v1-* classes are descriptive implementation details for reasoning and debugging unless a profile marks them as public theme hooks.
|
|
99
|
+
root_classes:
|
|
100
|
+
- .ui-v1-number-stepper
|
|
@@ -16,6 +16,45 @@ related_components:
|
|
|
16
16
|
- UiPopperConnector
|
|
17
17
|
- UiPopperTarget
|
|
18
18
|
|
|
19
|
+
examples:
|
|
20
|
+
- title: Example
|
|
21
|
+
code: |
|
|
22
|
+
<template>
|
|
23
|
+
<UiPageHeader
|
|
24
|
+
v-model:value="title"
|
|
25
|
+
:error="title ? '' : 'Title is required'"
|
|
26
|
+
:invalid="!title"
|
|
27
|
+
editable
|
|
28
|
+
placeholder="Enter a title"
|
|
29
|
+
>
|
|
30
|
+
<template #addon>
|
|
31
|
+
<UiLink>
|
|
32
|
+
Collapse filter
|
|
33
|
+
</UiLink>
|
|
34
|
+
</template>
|
|
35
|
+
|
|
36
|
+
<template #actions>
|
|
37
|
+
<UiButton appearance="tertiary">
|
|
38
|
+
Actions
|
|
39
|
+
<IconCaretDown aria-hidden="true" />
|
|
40
|
+
</UiButton>
|
|
41
|
+
</template>
|
|
42
|
+
</UiPageHeader>
|
|
43
|
+
</template>
|
|
44
|
+
|
|
45
|
+
<script lang="ts" setup>
|
|
46
|
+
import { ref } from 'vue'
|
|
47
|
+
|
|
48
|
+
import IconCaretDown from '@retailcrm/embed-ui-v1-components/assets/sprites/arrows/caret-down.svg'
|
|
49
|
+
import {
|
|
50
|
+
UiButton,
|
|
51
|
+
UiLink,
|
|
52
|
+
UiPageHeader,
|
|
53
|
+
} from '@retailcrm/embed-ui-v1-components/remote'
|
|
54
|
+
|
|
55
|
+
const title = ref('Returns')
|
|
56
|
+
</script>
|
|
57
|
+
|
|
19
58
|
use_when:
|
|
20
59
|
- You need the main title of an extension page.
|
|
21
60
|
- You need inline title editing.
|
|
@@ -209,29 +248,6 @@ composition:
|
|
|
209
248
|
- title: Compact actions
|
|
210
249
|
notes: Keep only one or two compact actions on the right.
|
|
211
250
|
|
|
212
|
-
examples:
|
|
213
|
-
- title: Editable header with addon and actions
|
|
214
|
-
goal: Build a page header with inline validation and a link near the title.
|
|
215
|
-
code: |
|
|
216
|
-
<UiPageHeader
|
|
217
|
-
v-model:value="title"
|
|
218
|
-
:invalid="!title"
|
|
219
|
-
:error="title ? '' : 'Title is required'"
|
|
220
|
-
editable
|
|
221
|
-
placeholder="Enter a title"
|
|
222
|
-
>
|
|
223
|
-
<template #addon>
|
|
224
|
-
<UiLink>
|
|
225
|
-
Collapse filter
|
|
226
|
-
</UiLink>
|
|
227
|
-
</template>
|
|
228
|
-
|
|
229
|
-
<template #actions>
|
|
230
|
-
<UiButton appearance="tertiary">
|
|
231
|
-
Actions
|
|
232
|
-
</UiButton>
|
|
233
|
-
</template>
|
|
234
|
-
</UiPageHeader>
|
|
235
251
|
|
|
236
252
|
ai_notes:
|
|
237
253
|
do:
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
component: UiPopconfirm
|
|
2
|
+
summary: >
|
|
3
|
+
UiPopconfirm is a non-modal floating confirmation dialog anchored to a trigger.
|
|
4
|
+
Use it for short action confirmations where a modal would be too heavy.
|
|
5
|
+
|
|
6
|
+
public_import:
|
|
7
|
+
from: '@retailcrm/embed-ui-v1-components/remote'
|
|
8
|
+
named:
|
|
9
|
+
- UiPopconfirm
|
|
10
|
+
|
|
11
|
+
related_components:
|
|
12
|
+
- UiButton
|
|
13
|
+
- UiPopper
|
|
14
|
+
- UiModalWindow
|
|
15
|
+
|
|
16
|
+
examples:
|
|
17
|
+
- title: Basic confirmation
|
|
18
|
+
code: |
|
|
19
|
+
<template>
|
|
20
|
+
<UiPopconfirm title="Confirm action?">
|
|
21
|
+
<template #trigger="{ open }">
|
|
22
|
+
<UiButton :active="open">
|
|
23
|
+
Archive
|
|
24
|
+
</UiButton>
|
|
25
|
+
</template>
|
|
26
|
+
|
|
27
|
+
The item will be moved to the archive.
|
|
28
|
+
</UiPopconfirm>
|
|
29
|
+
</template>
|
|
30
|
+
|
|
31
|
+
<script lang="ts" setup>
|
|
32
|
+
import { UiButton, UiPopconfirm } from '@retailcrm/embed-ui-v1-components/remote'
|
|
33
|
+
</script>
|
|
34
|
+
- title: Destructive action
|
|
35
|
+
code: |
|
|
36
|
+
<template>
|
|
37
|
+
<UiPopconfirm title="Delete item?" ok-variant="danger">
|
|
38
|
+
<template #trigger="{ open }">
|
|
39
|
+
<UiButton :active="open" variant="danger">
|
|
40
|
+
Delete
|
|
41
|
+
</UiButton>
|
|
42
|
+
</template>
|
|
43
|
+
|
|
44
|
+
This action cannot be undone.
|
|
45
|
+
</UiPopconfirm>
|
|
46
|
+
</template>
|
|
47
|
+
|
|
48
|
+
<script lang="ts" setup>
|
|
49
|
+
import { UiButton, UiPopconfirm } from '@retailcrm/embed-ui-v1-components/remote'
|
|
50
|
+
</script>
|
|
51
|
+
|
|
52
|
+
use_when:
|
|
53
|
+
- You need a short confirmation for a single nearby action.
|
|
54
|
+
- You need confirm and cancel events without blocking the whole page.
|
|
55
|
+
- You need a destructive confirmation through okVariant="danger".
|
|
56
|
+
|
|
57
|
+
avoid_when:
|
|
58
|
+
- You need a form, long explanation, or multi-step confirmation.
|
|
59
|
+
- You need to block page interaction; use UiModalWindow instead.
|
|
60
|
+
- You only need helper text; use UiTooltip instead.
|
|
61
|
+
|
|
62
|
+
api:
|
|
63
|
+
key_props:
|
|
64
|
+
- name: title
|
|
65
|
+
notes: Text title shown above the description.
|
|
66
|
+
- name: okVariant
|
|
67
|
+
notes: Confirmation button variant; use danger for destructive actions.
|
|
68
|
+
- name: placement
|
|
69
|
+
notes: Preferred floating position relative to the trigger.
|
|
70
|
+
- name: visible
|
|
71
|
+
notes: Controlled open state for v-model:visible.
|
|
72
|
+
props:
|
|
73
|
+
- name: okTitle
|
|
74
|
+
notes: Confirmation button text.
|
|
75
|
+
- name: cancelTitle
|
|
76
|
+
notes: Cancel button text.
|
|
77
|
+
- name: cancelAppearance
|
|
78
|
+
notes: Cancel button appearance.
|
|
79
|
+
- name: cancelVariant
|
|
80
|
+
notes: Cancel button variant.
|
|
81
|
+
- name: buttonSize
|
|
82
|
+
notes: Size of both action buttons.
|
|
83
|
+
- name: popperClass
|
|
84
|
+
notes: Extra class for the floating popper root.
|
|
85
|
+
- name: popperOptions
|
|
86
|
+
notes: Additional UiPopper options.
|
|
87
|
+
slots:
|
|
88
|
+
- name: trigger
|
|
89
|
+
zone: trigger
|
|
90
|
+
creates: Target element that opens the confirmation.
|
|
91
|
+
notes: Receives open for active trigger styling when supported.
|
|
92
|
+
- name: title
|
|
93
|
+
zone: header
|
|
94
|
+
creates: Custom title content.
|
|
95
|
+
- name: default
|
|
96
|
+
zone: body
|
|
97
|
+
creates: Confirmation description.
|
|
98
|
+
- name: cancel-text
|
|
99
|
+
zone: footer
|
|
100
|
+
creates: Cancel button content.
|
|
101
|
+
- name: ok-text
|
|
102
|
+
zone: footer
|
|
103
|
+
creates: Confirmation button content.
|
|
104
|
+
emits:
|
|
105
|
+
- name: ok
|
|
106
|
+
payload: undefined
|
|
107
|
+
notes: Fired when the confirmation button is clicked.
|
|
108
|
+
- name: cancel
|
|
109
|
+
payload: undefined
|
|
110
|
+
notes: Fired when the cancel button is clicked or the popup closes by outside click.
|
|
111
|
+
- name: toggle
|
|
112
|
+
payload: boolean
|
|
113
|
+
notes: Fired when open state changes.
|
|
114
|
+
- name: update:visible
|
|
115
|
+
payload: boolean
|
|
116
|
+
notes: v-model:visible update channel.
|
|
117
|
+
|
|
118
|
+
rendered_structure:
|
|
119
|
+
descriptive_only: true
|
|
120
|
+
root:
|
|
121
|
+
shape: div.ui-v1-popper.ui-v1-popconfirm via UiPopper
|
|
122
|
+
tag: div
|
|
123
|
+
zones:
|
|
124
|
+
- .ui-v1-popconfirm__title
|
|
125
|
+
- .ui-v1-popconfirm__content
|
|
126
|
+
- .ui-v1-popconfirm__footer
|
|
127
|
+
|
|
128
|
+
geometry:
|
|
129
|
+
layout: floating dialog outside normal document flow
|
|
130
|
+
root_display: block
|
|
131
|
+
width_behavior: content-sized with max width
|
|
132
|
+
notes:
|
|
133
|
+
- Defaults to bottom-start placement.
|
|
134
|
+
- The layer is anchored to the component trigger wrapper.
|
|
135
|
+
|
|
136
|
+
ai_notes:
|
|
137
|
+
do:
|
|
138
|
+
- Use UiPopconfirm for short confirmations instead of building UiPopper and UiButton manually.
|
|
139
|
+
- Pass open from the trigger slot into UiButton active when possible.
|
|
140
|
+
- Use okVariant="danger" for destructive actions.
|
|
141
|
+
avoid:
|
|
142
|
+
- Do not put forms or complex flows into UiPopconfirm.
|
|
143
|
+
- Do not use it as a tooltip or notification.
|
|
144
|
+
|
|
145
|
+
accessibility:
|
|
146
|
+
notes:
|
|
147
|
+
- Renders a non-modal dialog with aria-modal="false".
|
|
148
|
+
- Title content is connected through aria-labelledby when present.
|
|
149
|
+
- Use an accessible trigger component such as UiButton.
|
|
150
|
+
|
|
151
|
+
styling:
|
|
152
|
+
notes:
|
|
153
|
+
- Use props and slots first; use popperClass only for local layout integrations.
|
|
154
|
+
- CSS variables can tune the floating surface width.
|
|
155
|
+
root_classes:
|
|
156
|
+
- .ui-v1-popconfirm
|
|
157
|
+
zones:
|
|
158
|
+
- .ui-v1-popconfirm__title
|
|
159
|
+
- .ui-v1-popconfirm__content
|
|
160
|
+
- .ui-v1-popconfirm__footer
|
|
161
|
+
css_variables:
|
|
162
|
+
public_theme_variables:
|
|
163
|
+
- name: --ui-v1-popconfirm-width-max
|
|
164
|
+
effect: Maximum width of the floating confirmation.
|
|
@@ -12,9 +12,74 @@ public_import:
|
|
|
12
12
|
related_components:
|
|
13
13
|
- UiPopperConnector
|
|
14
14
|
- UiPopperTarget
|
|
15
|
+
- UiPopconfirm
|
|
15
16
|
- UiSelect
|
|
16
17
|
- UiTooltip
|
|
17
18
|
|
|
19
|
+
examples:
|
|
20
|
+
- title: Usage
|
|
21
|
+
code: |
|
|
22
|
+
<template>
|
|
23
|
+
<UiPopperConnector>
|
|
24
|
+
<UiButton variant="danger">
|
|
25
|
+
Delete
|
|
26
|
+
</UiButton>
|
|
27
|
+
|
|
28
|
+
<UiPopper role="dialog" class="popconfirm">
|
|
29
|
+
<div class="popconfirm__content">
|
|
30
|
+
This action cannot be cancelled. Continue?
|
|
31
|
+
</div>
|
|
32
|
+
|
|
33
|
+
<div class="popconfirm__footer">
|
|
34
|
+
<UiButton variant="danger">
|
|
35
|
+
Yes
|
|
36
|
+
</UiButton>
|
|
37
|
+
|
|
38
|
+
<UiButton appearance="secondary">
|
|
39
|
+
No
|
|
40
|
+
</UiButton>
|
|
41
|
+
</div>
|
|
42
|
+
</UiPopper>
|
|
43
|
+
</UiPopperConnector>
|
|
44
|
+
</template>
|
|
45
|
+
|
|
46
|
+
<script lang="ts" setup>
|
|
47
|
+
import { UiButton, UiPopper, UiPopperConnector } from '@retailcrm/embed-ui-v1-components/remote'
|
|
48
|
+
</script>
|
|
49
|
+
- title: Custom target components
|
|
50
|
+
code: |
|
|
51
|
+
<template>
|
|
52
|
+
<UiPopperConnector>
|
|
53
|
+
<UiPopperTarget tag="span" role="button" class="icon-button">
|
|
54
|
+
<IconTrash aria-label="Delete" />
|
|
55
|
+
</UiPopperTarget>
|
|
56
|
+
|
|
57
|
+
<UiPopper role="tooltip" class="tooltip">
|
|
58
|
+
Delete
|
|
59
|
+
</UiPopper>
|
|
60
|
+
|
|
61
|
+
<UiPopper role="dialog" class="popconfirm">
|
|
62
|
+
<div class="popconfirm__content">
|
|
63
|
+
This action cannot be cancelled. Continue?
|
|
64
|
+
</div>
|
|
65
|
+
|
|
66
|
+
<div class="popconfirm__footer">
|
|
67
|
+
<UiButton variant="danger">
|
|
68
|
+
Yes
|
|
69
|
+
</UiButton>
|
|
70
|
+
|
|
71
|
+
<UiButton appearance="secondary">
|
|
72
|
+
No
|
|
73
|
+
</UiButton>
|
|
74
|
+
</div>
|
|
75
|
+
</UiPopper>
|
|
76
|
+
</UiPopperConnector>
|
|
77
|
+
</template>
|
|
78
|
+
|
|
79
|
+
<script lang="ts" setup>
|
|
80
|
+
import IconTrash from '@retailcrm/embed-ui-v1-components/assets/sprites/ui/delete.svg'
|
|
81
|
+
import { UiButton, UiPopper, UiPopperConnector, UiPopperTarget } from '@retailcrm/embed-ui-v1-components/remote'
|
|
82
|
+
</script>
|
|
18
83
|
use_when:
|
|
19
84
|
- You need a floating layer anchored to a target element.
|
|
20
85
|
- You need separate show and hide triggers for target and popper.
|
|
@@ -23,6 +88,7 @@ use_when:
|
|
|
23
88
|
avoid_when:
|
|
24
89
|
- You need a regular block in normal document flow.
|
|
25
90
|
- You need a high-level dropdown or tooltip and do not need low-level control.
|
|
91
|
+
- You need a short action confirmation; use UiPopconfirm instead.
|
|
26
92
|
|
|
27
93
|
api:
|
|
28
94
|
key_props:
|
|
@@ -178,19 +244,6 @@ composition:
|
|
|
178
244
|
- title: Shared target context
|
|
179
245
|
notes: The target ref usually comes through UiPopperConnector and UiPopperTarget.
|
|
180
246
|
|
|
181
|
-
examples:
|
|
182
|
-
- title: Mental model
|
|
183
|
-
goal: Understand the basic target plus floating content pattern.
|
|
184
|
-
code: |
|
|
185
|
-
<UiPopperConnector>
|
|
186
|
-
<UiPopperTarget>
|
|
187
|
-
<button type="button">Open</button>
|
|
188
|
-
</UiPopperTarget>
|
|
189
|
-
|
|
190
|
-
<UiPopper :visible="open">
|
|
191
|
-
Popup content
|
|
192
|
-
</UiPopper>
|
|
193
|
-
</UiPopperConnector>
|
|
194
247
|
|
|
195
248
|
ai_notes:
|
|
196
249
|
do:
|
|
@@ -80,31 +80,6 @@ composition:
|
|
|
80
80
|
- title: Explicit anchor
|
|
81
81
|
notes: Add UiPopperTarget only when the anchor must be limited to a specific wrapper or sub-area.
|
|
82
82
|
|
|
83
|
-
examples:
|
|
84
|
-
- title: Shared target context
|
|
85
|
-
goal: Connect target and popper through one shared wrapper.
|
|
86
|
-
code: |
|
|
87
|
-
<UiPopperConnector>
|
|
88
|
-
<UiPopperTarget>
|
|
89
|
-
<button type="button">Open</button>
|
|
90
|
-
</UiPopperTarget>
|
|
91
|
-
|
|
92
|
-
<UiPopper :visible="open">
|
|
93
|
-
Content
|
|
94
|
-
</UiPopper>
|
|
95
|
-
</UiPopperConnector>
|
|
96
|
-
- title: Connector without explicit target
|
|
97
|
-
goal: Use a button as the implicit anchor.
|
|
98
|
-
code: |
|
|
99
|
-
<UiPopperConnector>
|
|
100
|
-
<UiButton appearance="secondary">
|
|
101
|
-
Open
|
|
102
|
-
</UiButton>
|
|
103
|
-
|
|
104
|
-
<UiPopper :visible="open">
|
|
105
|
-
Content
|
|
106
|
-
</UiPopper>
|
|
107
|
-
</UiPopperConnector>
|
|
108
83
|
|
|
109
84
|
ai_notes:
|
|
110
85
|
do:
|
|
@@ -113,3 +88,8 @@ ai_notes:
|
|
|
113
88
|
avoid:
|
|
114
89
|
- Do not use it as a styling wrapper.
|
|
115
90
|
- Do not add UiPopperTarget automatically around every trigger.
|
|
91
|
+
|
|
92
|
+
styling:
|
|
93
|
+
notes:
|
|
94
|
+
- Use documented props and slots as the primary styling API.
|
|
95
|
+
- Internal .ui-v1-* classes are descriptive implementation details for reasoning and debugging unless a profile marks them as public theme hooks.
|