@ticatec/uniface-element 0.2.4 → 0.3.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/dist/accordion/README.md +169 -0
- package/dist/accordion/README_CN.md +176 -0
- package/dist/action-bar/README.md +275 -0
- package/dist/action-bar/README_CN.md +285 -0
- package/dist/app-layout/README.md +374 -0
- package/dist/app-layout/README_CN.md +381 -0
- package/dist/app-top-bar/README.md +357 -0
- package/dist/app-top-bar/README_CN.md +365 -0
- package/dist/attachment-files/AttachmentFilesField.svelte +67 -1
- package/dist/attachment-files/AttachmentFilesField.svelte.d.ts +8 -1
- package/dist/base-calendar/CalendarBase.svelte +0 -3
- package/dist/box/README.md +385 -0
- package/dist/box/README_CN.md +393 -0
- package/dist/breadcrumbs/README.md +442 -0
- package/dist/breadcrumbs/README_CN.md +442 -0
- package/dist/button/Button.svelte +27 -7
- package/dist/button/Button.svelte.d.ts +3 -1
- package/dist/button/IconButton.svelte +26 -6
- package/dist/button/IconButton.svelte.d.ts +3 -1
- package/dist/button/IconButton_README.md +513 -0
- package/dist/button/IconButton_README_CN.md +513 -0
- package/dist/button/README.md +428 -0
- package/dist/button/README_CN.md +428 -0
- package/dist/button/TextButton.svelte +26 -6
- package/dist/button/TextButton.svelte.d.ts +3 -1
- package/dist/button/TextButton_README.md +571 -0
- package/dist/button/TextButton_README_CN.md +571 -0
- package/dist/card/README.md +666 -0
- package/dist/card/README_CN.md +666 -0
- package/dist/cascade-options-select/CascadeOptionSelect.svelte +43 -7
- package/dist/cascade-options-select/CascadeOptionSelect.svelte.d.ts +3 -4
- package/dist/cascade-options-select/README.md +663 -2
- package/dist/cascade-options-select/README_CN.md +664 -0
- package/dist/checkbox/CheckBox.svelte +20 -6
- package/dist/checkbox/CheckBox.svelte.d.ts +4 -2
- package/dist/checkbox/README.md +562 -0
- package/dist/checkbox/README_CN.md +727 -0
- package/dist/common-editor/NumberInput.svelte +39 -26
- package/dist/common-editor/NumberInput.svelte.d.ts +5 -1
- package/dist/concise-data-table/ConciseListTable.svelte +133 -36
- package/dist/concise-data-table/ConciseListTable.svelte.d.ts +8 -1
- package/dist/concise-data-table/DataCell.svelte +5 -6
- package/dist/concise-data-table/DataRow.svelte +22 -2
- package/dist/concise-data-table/DataRow.svelte.d.ts +1 -0
- package/dist/concise-data-table/README.md +606 -0
- package/dist/concise-data-table/README_CN.md +611 -0
- package/dist/context-menu/ContextMenu.svelte +138 -21
- package/dist/context-menu/ContextMenu.svelte.d.ts +5 -0
- package/dist/context-menu/ContextMenuItem.d.ts +20 -4
- package/dist/context-menu/README.md +551 -0
- package/dist/context-menu/README_CN.md +551 -0
- package/dist/criteria-field/CriteriaField.svelte +3 -5
- package/dist/criteria-field/README.md +532 -0
- package/dist/criteria-field/README_CN.md +532 -0
- package/dist/data-table/README.md +712 -0
- package/dist/data-table/README_CN.md +712 -0
- package/dist/date-picker/DatePicker.svelte +44 -7
- package/dist/date-picker/DatePicker.svelte.d.ts +3 -4
- package/dist/date-picker/DateTimePicker.svelte +32 -8
- package/dist/date-picker/DateTimePicker.svelte.d.ts +3 -4
- package/dist/date-picker/README.md +326 -0
- package/dist/date-picker/README_CN.md +316 -0
- package/dist/date-picker/ScrollBar.svelte +18 -8
- package/dist/date-picker/ScrollBar.svelte.d.ts +1 -1
- package/dist/date-picker/TimePanel.svelte +5 -5
- package/dist/date-picker/TimePanel.svelte.d.ts +1 -1
- package/dist/date-range/README.md +374 -0
- package/dist/date-range/README_CN.md +374 -0
- package/dist/dialog/README.md +596 -0
- package/dist/dialog/README_CN.md +596 -0
- package/dist/drawer/README.md +679 -1
- package/dist/drawer/README_CN.md +679 -0
- package/dist/group-box/group-check-box/GroupCheckBox.svelte +62 -5
- package/dist/group-box/group-check-box/GroupCheckBox.svelte.d.ts +7 -2
- package/dist/group-box/group-check-box/README.md +749 -0
- package/dist/group-box/group-check-box/README_CN.md +750 -0
- package/dist/group-box/group-radio-box/GroupRadioBox.svelte +69 -4
- package/dist/group-box/group-radio-box/GroupRadioBox.svelte.d.ts +8 -2
- package/dist/group-box/group-radio-box/README.md +920 -0
- package/dist/group-box/group-radio-box/README_CN.md +920 -0
- package/dist/image-files/README.md +1346 -0
- package/dist/image-files/README_CN.md +1346 -0
- package/dist/input-options-select/InputOptionsSelect.svelte +161 -65
- package/dist/input-options-select/InputOptionsSelect.svelte.d.ts +4 -1
- package/dist/lib/forwardAllEvents.d.ts +3 -0
- package/dist/lib/forwardAllEvents.js +24 -0
- package/dist/list-box/README.md +579 -0
- package/dist/list-box/README_CN.md +682 -0
- package/dist/lookup-editor/LookupEditor.svelte +15 -3
- package/dist/lookup-editor/LookupEditor.svelte.d.ts +3 -4
- package/dist/lookup-editor/README.md +684 -0
- package/dist/lookup-editor/README_CN.md +684 -0
- package/dist/memo-editor/MemoEditor.svelte +77 -27
- package/dist/memo-editor/MemoEditor.svelte.d.ts +6 -3
- package/dist/memo-editor/README.md +819 -0
- package/dist/memo-editor/README_CN.md +819 -0
- package/dist/message-box/README.md +398 -0
- package/dist/message-box/README_CN.md +398 -0
- package/dist/number-editor/NumberEditor.svelte +2 -2
- package/dist/number-editor/NumberEditor.svelte.d.ts +1 -1
- package/dist/number-editor/README.md +353 -22
- package/dist/number-editor/README_CN.md +357 -0
- package/dist/number-range/README.md +443 -0
- package/dist/number-range/README_CN.md +443 -0
- package/dist/options-multi-select/OptionsMultiSelect.svelte +87 -12
- package/dist/options-multi-select/OptionsMultiSelect.svelte.d.ts +3 -1
- package/dist/options-multi-select/README.md +480 -0
- package/dist/options-multi-select/README_CN.md +480 -0
- package/dist/options-select/OptionsSelect.svelte +36 -5
- package/dist/options-select/OptionsSelect.svelte.d.ts +3 -4
- package/dist/options-select/README.md +632 -0
- package/dist/options-select/README_CN.md +632 -0
- package/dist/page/README.md +605 -0
- package/dist/page/README_CN.md +605 -0
- package/dist/pagination/README.md +946 -0
- package/dist/pagination/README_CN.md +946 -0
- package/dist/pagination-panel/README.md +1075 -0
- package/dist/pagination-panel/README_CN.md +1075 -0
- package/dist/popup-hint/README.md +841 -0
- package/dist/popup-hint/README_CN.md +840 -0
- package/dist/progress-bar/README.md +242 -0
- package/dist/progress-bar/README_CN.md +242 -0
- package/dist/progress-step-bar/README.md +316 -0
- package/dist/progress-step-bar/README_CN.md +316 -0
- package/dist/prompts-text-editor/PromptsTextEditor.svelte +6 -3
- package/dist/prompts-text-editor/PromptsTextEditor.svelte.d.ts +3 -1
- package/dist/prompts-text-editor/README.md +329 -0
- package/dist/prompts-text-editor/README_CN.md +329 -0
- package/dist/property-editor/README.md +969 -0
- package/dist/property-editor/README_CN.md +969 -0
- package/dist/radio-button/README.md +372 -0
- package/dist/radio-button/README_CN.md +372 -0
- package/dist/radio-button/RadioButton.svelte +32 -3
- package/dist/radio-button/RadioButton.svelte.d.ts +12 -1
- package/dist/search-box/README.md +425 -0
- package/dist/search-box/README_CN.md +424 -0
- package/dist/search-box/SearchBox.svelte +22 -6
- package/dist/search-box/SearchBox.svelte.d.ts +4 -1
- package/dist/tabs/README.md +919 -0
- package/dist/tabs/README_CN.md +920 -0
- package/dist/tag/README.md +922 -0
- package/dist/tag/README_CN.md +922 -0
- package/dist/text-editor/PasswordEditor.svelte +17 -2
- package/dist/text-editor/PasswordEditor.svelte.d.ts +3 -3
- package/dist/text-editor/PasswordEditor_README.md +551 -0
- package/dist/text-editor/PasswordEditor_README_CN.md +551 -0
- package/dist/text-editor/README.md +466 -0
- package/dist/text-editor/README_CN.md +466 -0
- package/dist/text-editor/TextEditor.svelte +51 -19
- package/dist/text-editor/TextEditor.svelte.d.ts +0 -1
- package/dist/time-editor/README.md +498 -24
- package/dist/time-editor/README_CN.md +498 -0
- package/dist/time-editor/TimeEditor.svelte +7 -3
- package/dist/time-editor/TimeEditor.svelte.d.ts +3 -1
- package/dist/toast/README.md +667 -0
- package/dist/toast/README_CN.md +667 -0
- package/dist/transfer/README.md +795 -0
- package/dist/transfer/Transfer.svelte +6 -4
- package/dist/transfer/Transfer.svelte.d.ts +3 -1
- package/dist/tree-view/README.md +761 -0
- package/dist/tree-view/README_CN.md +761 -0
- package/dist/tree-view/TreeView.svelte +5 -3
- package/dist/tree-view/TreeView.svelte.d.ts +3 -1
- package/dist/unit-number-editor/README.md +546 -20
- package/dist/unit-number-editor/README_CN.md +525 -0
- package/dist/unit-number-editor/UnitNumberEditor.svelte +62 -8
- package/dist/unit-number-editor/UnitNumberEditor.svelte.d.ts +5 -1
- package/docs/form-field/cn/README_CN.md +364 -0
- package/docs/form-field/en/README.md +364 -0
- package/docs/form-panel/flex-form/cn/README_CN.md +586 -0
- package/docs/form-panel/flex-form/en/README.md +586 -0
- package/docs/form-panel/flex-row-form/cn/README_CN.md +787 -0
- package/docs/form-panel/flex-row-form/en/README.md +787 -0
- package/docs/form-panel/grid-form/en/README.md +744 -0
- package/package.json +1 -1
- package/dist/drawer/README-CN.md +0 -1
|
@@ -0,0 +1,480 @@
|
|
|
1
|
+
# OptionsMultiSelect
|
|
2
|
+
|
|
3
|
+
A multi-selection dropdown component that allows users to select multiple options from a predefined list, displaying selected items as removable tags.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- **Multiple Selection**: Select multiple options from a dropdown list
|
|
8
|
+
- **Tag Display**: Show selected items as removable tags with customizable styling
|
|
9
|
+
- **Checkbox Interface**: Intuitive checkbox-based selection in dropdown
|
|
10
|
+
- **Customizable Tags**: Different tag variants (borderless, border, round) and colors
|
|
11
|
+
- **Option Control**: Hide or disable specific options
|
|
12
|
+
- **Search Integration**: Works with CommonPicker for consistent behavior
|
|
13
|
+
- **Focus Management**: Proper focus handling and keyboard navigation
|
|
14
|
+
- **Display Modes**: Support for edit and view modes
|
|
15
|
+
- **Value Management**: Flexible delimiter-based value storage
|
|
16
|
+
- **Empty State**: Customizable placeholder and empty text
|
|
17
|
+
|
|
18
|
+
## Installation
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
npm install @ticatec/uniface-element
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Basic Usage
|
|
25
|
+
|
|
26
|
+
```svelte
|
|
27
|
+
<script>
|
|
28
|
+
import OptionsMultiSelect from '@ticatec/uniface-element/OptionsMultiSelect';
|
|
29
|
+
|
|
30
|
+
let selectedValues = '';
|
|
31
|
+
let options = [
|
|
32
|
+
{ code: 'JS', text: 'JavaScript' },
|
|
33
|
+
{ code: 'TS', text: 'TypeScript' },
|
|
34
|
+
{ code: 'PY', text: 'Python' },
|
|
35
|
+
{ code: 'GO', text: 'Go' }
|
|
36
|
+
];
|
|
37
|
+
</script>
|
|
38
|
+
|
|
39
|
+
<OptionsMultiSelect
|
|
40
|
+
{options}
|
|
41
|
+
bind:value={selectedValues}
|
|
42
|
+
/>
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## API Reference
|
|
46
|
+
|
|
47
|
+
### Props
|
|
48
|
+
|
|
49
|
+
| Prop | Type | Default | Description |
|
|
50
|
+
|------|------|---------|-------------|
|
|
51
|
+
| `value` | `string` | `''` | Selected values as delimiter-separated string |
|
|
52
|
+
| `options` | `Array<any>` | `[]` | Array of option objects |
|
|
53
|
+
| `keyField` | `string` | `'code'` | Property name for option keys |
|
|
54
|
+
| `textField` | `string` | `'text'` | Property name for option display text |
|
|
55
|
+
| `delimiter` | `string` | `';'` | Delimiter for separating multiple values |
|
|
56
|
+
| `variant` | `'' \| 'plain' \| 'outlined' \| 'filled'` | `''` | Visual style variant |
|
|
57
|
+
| `compact` | `boolean` | `false` | Enables compact display mode |
|
|
58
|
+
| `disabled` | `boolean` | `false` | Disables the component |
|
|
59
|
+
| `readonly` | `boolean` | `false` | Makes the component read-only |
|
|
60
|
+
| `style` | `string` | `''` | Custom CSS styles |
|
|
61
|
+
| `placeholder` | `string` | `''` | Placeholder text when no items selected |
|
|
62
|
+
| `emptyText` | `string` | `''` | Text to show when no items selected (overrides placeholder) |
|
|
63
|
+
| `disableOptions` | `Array<string>` | `[]` | Keys of options to disable |
|
|
64
|
+
| `hideOptions` | `Array<string>` | `[]` | Keys of options to hide |
|
|
65
|
+
| `displayMode` | `DisplayMode` | `DisplayMode.Edit` | Edit or view mode |
|
|
66
|
+
| `menu$height` | `number` | `0` | Maximum height of dropdown menu |
|
|
67
|
+
| `tagColor` | `string` | `''` | Color variant for tags |
|
|
68
|
+
| `tagVariant` | `'borderless' \| 'border' \| 'round'` | `'border'` | Tag visual style |
|
|
69
|
+
| `onchange` | `OnChangeHandler<Array<string>>` | `null` | Change event handler |
|
|
70
|
+
| `onfocus` | `(() => void) \| null` | `null` | Focus event handler |
|
|
71
|
+
| `onblur` | `(() => void) \| null` | `null` | Blur event handler |
|
|
72
|
+
|
|
73
|
+
### Methods
|
|
74
|
+
|
|
75
|
+
| Method | Description |
|
|
76
|
+
|--------|-------------|
|
|
77
|
+
| `setFocus()` | Programmatically focus the component |
|
|
78
|
+
|
|
79
|
+
## Examples
|
|
80
|
+
|
|
81
|
+
### Programming Languages Selector
|
|
82
|
+
|
|
83
|
+
```svelte
|
|
84
|
+
<script>
|
|
85
|
+
import OptionsMultiSelect from '@ticatec/uniface-element/OptionsMultiSelect';
|
|
86
|
+
import FormField from '@ticatec/uniface-element/FormField';
|
|
87
|
+
|
|
88
|
+
let languages = '';
|
|
89
|
+
let programmingLanguages = [
|
|
90
|
+
{ code: 'JS', text: 'JavaScript' },
|
|
91
|
+
{ code: 'TS', text: 'TypeScript' },
|
|
92
|
+
{ code: 'PY', text: 'Python' },
|
|
93
|
+
{ code: 'JAVA', text: 'Java' },
|
|
94
|
+
{ code: 'CS', text: 'C#' },
|
|
95
|
+
{ code: 'GO', text: 'Go' },
|
|
96
|
+
{ code: 'RUST', text: 'Rust' },
|
|
97
|
+
{ code: 'PHP', text: 'PHP' }
|
|
98
|
+
];
|
|
99
|
+
|
|
100
|
+
function handleLanguageChange(selected) {
|
|
101
|
+
console.log('Selected languages:', selected);
|
|
102
|
+
}
|
|
103
|
+
</script>
|
|
104
|
+
|
|
105
|
+
<FormField label="Programming Languages">
|
|
106
|
+
<OptionsMultiSelect
|
|
107
|
+
options={programmingLanguages}
|
|
108
|
+
bind:value={languages}
|
|
109
|
+
variant="outlined"
|
|
110
|
+
tagColor="1"
|
|
111
|
+
tagVariant="round"
|
|
112
|
+
placeholder="Select programming languages"
|
|
113
|
+
onchange={handleLanguageChange}
|
|
114
|
+
/>
|
|
115
|
+
</FormField>
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### Skills Assessment
|
|
119
|
+
|
|
120
|
+
```svelte
|
|
121
|
+
<script>
|
|
122
|
+
import OptionsMultiSelect from '@ticatec/uniface-element/OptionsMultiSelect';
|
|
123
|
+
|
|
124
|
+
let selectedSkills = '';
|
|
125
|
+
let skills = [
|
|
126
|
+
{ code: 'FE', text: 'Frontend Development' },
|
|
127
|
+
{ code: 'BE', text: 'Backend Development' },
|
|
128
|
+
{ code: 'DB', text: 'Database Design' },
|
|
129
|
+
{ code: 'DEVOPS', text: 'DevOps' },
|
|
130
|
+
{ code: 'UI', text: 'UI/UX Design' },
|
|
131
|
+
{ code: 'TEST', text: 'Testing' },
|
|
132
|
+
{ code: 'MOBILE', text: 'Mobile Development' },
|
|
133
|
+
{ code: 'ML', text: 'Machine Learning' }
|
|
134
|
+
];
|
|
135
|
+
|
|
136
|
+
let disabledSkills = ['ML']; // Machine Learning temporarily unavailable
|
|
137
|
+
|
|
138
|
+
$: selectedArray = selectedSkills ? selectedSkills.split(';') : [];
|
|
139
|
+
</script>
|
|
140
|
+
|
|
141
|
+
<div class="skills-selector">
|
|
142
|
+
<h3>Technical Skills</h3>
|
|
143
|
+
<OptionsMultiSelect
|
|
144
|
+
options={skills}
|
|
145
|
+
bind:value={selectedSkills}
|
|
146
|
+
variant="filled"
|
|
147
|
+
tagColor="2"
|
|
148
|
+
tagVariant="border"
|
|
149
|
+
disableOptions={disabledSkills}
|
|
150
|
+
placeholder="Select your technical skills"
|
|
151
|
+
menu$height={200}
|
|
152
|
+
/>
|
|
153
|
+
|
|
154
|
+
<div class="selected-count">
|
|
155
|
+
Selected: {selectedArray.length} skill{selectedArray.length !== 1 ? 's' : ''}
|
|
156
|
+
</div>
|
|
157
|
+
</div>
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
### Event Categories Filter
|
|
161
|
+
|
|
162
|
+
```svelte
|
|
163
|
+
<script>
|
|
164
|
+
import OptionsMultiSelect from '@ticatec/uniface-element/OptionsMultiSelect';
|
|
165
|
+
|
|
166
|
+
let filterCategories = '';
|
|
167
|
+
let eventCategories = [
|
|
168
|
+
{ id: 'CONF', name: 'Conferences' },
|
|
169
|
+
{ id: 'WORK', name: 'Workshops' },
|
|
170
|
+
{ id: 'MEET', name: 'Meetups' },
|
|
171
|
+
{ id: 'WEB', name: 'Webinars' },
|
|
172
|
+
{ id: 'HACK', name: 'Hackathons' },
|
|
173
|
+
{ id: 'NET', name: 'Networking' },
|
|
174
|
+
{ id: 'TRAIN', name: 'Training' },
|
|
175
|
+
{ id: 'EXPO', name: 'Exhibitions' }
|
|
176
|
+
];
|
|
177
|
+
|
|
178
|
+
let hiddenCategories = ['EXPO']; // Not available in current region
|
|
179
|
+
|
|
180
|
+
function applyFilter(categories) {
|
|
181
|
+
console.log('Filtering events by categories:', categories);
|
|
182
|
+
// Apply filter logic here
|
|
183
|
+
}
|
|
184
|
+
</script>
|
|
185
|
+
|
|
186
|
+
<div class="event-filter">
|
|
187
|
+
<OptionsMultiSelect
|
|
188
|
+
options={eventCategories}
|
|
189
|
+
keyField="id"
|
|
190
|
+
textField="name"
|
|
191
|
+
bind:value={filterCategories}
|
|
192
|
+
variant="outlined"
|
|
193
|
+
tagColor="3"
|
|
194
|
+
tagVariant="borderless"
|
|
195
|
+
hideOptions={hiddenCategories}
|
|
196
|
+
placeholder="Filter by event categories"
|
|
197
|
+
onchange={applyFilter}
|
|
198
|
+
/>
|
|
199
|
+
</div>
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
### Team Assignment
|
|
203
|
+
|
|
204
|
+
```svelte
|
|
205
|
+
<script>
|
|
206
|
+
import OptionsMultiSelect from '@ticatec/uniface-element/OptionsMultiSelect';
|
|
207
|
+
|
|
208
|
+
let assignedMembers = '';
|
|
209
|
+
let teamMembers = [
|
|
210
|
+
{ userId: '001', fullName: 'Alice Johnson' },
|
|
211
|
+
{ userId: '002', fullName: 'Bob Smith' },
|
|
212
|
+
{ userId: '003', fullName: 'Carol Davis' },
|
|
213
|
+
{ userId: '004', fullName: 'David Wilson' },
|
|
214
|
+
{ userId: '005', fullName: 'Eva Brown' },
|
|
215
|
+
{ userId: '006', fullName: 'Frank Miller' }
|
|
216
|
+
];
|
|
217
|
+
|
|
218
|
+
let unavailableMembers = ['003', '005']; // On vacation
|
|
219
|
+
|
|
220
|
+
function handleAssignment(members) {
|
|
221
|
+
console.log('Assigned team members:', members);
|
|
222
|
+
// Send assignment notification
|
|
223
|
+
}
|
|
224
|
+
</script>
|
|
225
|
+
|
|
226
|
+
<div class="team-assignment">
|
|
227
|
+
<label>Assign Team Members</label>
|
|
228
|
+
<OptionsMultiSelect
|
|
229
|
+
options={teamMembers}
|
|
230
|
+
keyField="userId"
|
|
231
|
+
textField="fullName"
|
|
232
|
+
bind:value={assignedMembers}
|
|
233
|
+
variant="outlined"
|
|
234
|
+
tagColor="4"
|
|
235
|
+
tagVariant="round"
|
|
236
|
+
disableOptions={unavailableMembers}
|
|
237
|
+
delimiter=","
|
|
238
|
+
placeholder="Select team members for this task"
|
|
239
|
+
onchange={handleAssignment}
|
|
240
|
+
/>
|
|
241
|
+
</div>
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
### Product Features Selection
|
|
245
|
+
|
|
246
|
+
```svelte
|
|
247
|
+
<script>
|
|
248
|
+
import OptionsMultiSelect from '@ticatec/uniface-element/OptionsMultiSelect';
|
|
249
|
+
|
|
250
|
+
let selectedFeatures = '';
|
|
251
|
+
let productFeatures = [
|
|
252
|
+
{ feature: 'AUTH', description: 'User Authentication' },
|
|
253
|
+
{ feature: 'DASHBOARD', description: 'Dashboard Analytics' },
|
|
254
|
+
{ feature: 'REPORTS', description: 'Custom Reports' },
|
|
255
|
+
{ feature: 'API', description: 'API Integration' },
|
|
256
|
+
{ feature: 'EXPORT', description: 'Data Export' },
|
|
257
|
+
{ feature: 'NOTIFICATIONS', description: 'Push Notifications' },
|
|
258
|
+
{ feature: 'BACKUP', description: 'Automated Backup' },
|
|
259
|
+
{ feature: 'MULTI_LANG', description: 'Multi-language Support' }
|
|
260
|
+
];
|
|
261
|
+
|
|
262
|
+
let isReadonly = false;
|
|
263
|
+
|
|
264
|
+
function toggleReadonly() {
|
|
265
|
+
isReadonly = !isReadonly;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
function calculatePrice(features) {
|
|
269
|
+
const featurePrices = {
|
|
270
|
+
'AUTH': 10, 'DASHBOARD': 25, 'REPORTS': 20, 'API': 15,
|
|
271
|
+
'EXPORT': 10, 'NOTIFICATIONS': 12, 'BACKUP': 18, 'MULTI_LANG': 8
|
|
272
|
+
};
|
|
273
|
+
|
|
274
|
+
return features.reduce((total, feature) => total + (featurePrices[feature] || 0), 0);
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
$: selectedArray = selectedFeatures ? selectedFeatures.split(';') : [];
|
|
278
|
+
$: totalPrice = calculatePrice(selectedArray);
|
|
279
|
+
</script>
|
|
280
|
+
|
|
281
|
+
<div class="product-config">
|
|
282
|
+
<h3>Product Configuration</h3>
|
|
283
|
+
|
|
284
|
+
<OptionsMultiSelect
|
|
285
|
+
options={productFeatures}
|
|
286
|
+
keyField="feature"
|
|
287
|
+
textField="description"
|
|
288
|
+
bind:value={selectedFeatures}
|
|
289
|
+
variant="filled"
|
|
290
|
+
tagColor="5"
|
|
291
|
+
tagVariant="border"
|
|
292
|
+
{readonly}
|
|
293
|
+
placeholder="Select product features"
|
|
294
|
+
menu$height={250}
|
|
295
|
+
/>
|
|
296
|
+
|
|
297
|
+
<div class="config-summary">
|
|
298
|
+
<p>Selected Features: {selectedArray.length}</p>
|
|
299
|
+
<p>Total Price: ${totalPrice}/month</p>
|
|
300
|
+
<button on:click={toggleReadonly}>
|
|
301
|
+
{isReadonly ? 'Edit' : 'Lock'} Configuration
|
|
302
|
+
</button>
|
|
303
|
+
</div>
|
|
304
|
+
</div>
|
|
305
|
+
```
|
|
306
|
+
|
|
307
|
+
### Survey Interests
|
|
308
|
+
|
|
309
|
+
```svelte
|
|
310
|
+
<script>
|
|
311
|
+
import OptionsMultiSelect from '@ticatec/uniface-element/OptionsMultiSelect';
|
|
312
|
+
|
|
313
|
+
let interests = '';
|
|
314
|
+
let surveyOptions = [
|
|
315
|
+
{ code: 'TECH', text: 'Technology' },
|
|
316
|
+
{ code: 'HEALTH', text: 'Health & Fitness' },
|
|
317
|
+
{ code: 'TRAVEL', text: 'Travel' },
|
|
318
|
+
{ code: 'FOOD', text: 'Food & Cooking' },
|
|
319
|
+
{ code: 'SPORTS', text: 'Sports' },
|
|
320
|
+
{ code: 'MUSIC', text: 'Music' },
|
|
321
|
+
{ code: 'ART', text: 'Arts & Culture' },
|
|
322
|
+
{ code: 'BOOKS', text: 'Books & Literature' },
|
|
323
|
+
{ code: 'GAMES', text: 'Gaming' },
|
|
324
|
+
{ code: 'FINANCE', text: 'Personal Finance' }
|
|
325
|
+
];
|
|
326
|
+
|
|
327
|
+
function handleInterestChange(selected) {
|
|
328
|
+
console.log('User interests updated:', selected);
|
|
329
|
+
// Save to user profile
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
function handleFocus() {
|
|
333
|
+
console.log('Survey section focused');
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
function handleBlur() {
|
|
337
|
+
console.log('Survey section blurred');
|
|
338
|
+
}
|
|
339
|
+
</script>
|
|
340
|
+
|
|
341
|
+
<div class="survey-section">
|
|
342
|
+
<h3>What are you interested in?</h3>
|
|
343
|
+
<p>Select all topics that interest you (minimum 3, maximum 7)</p>
|
|
344
|
+
|
|
345
|
+
<OptionsMultiSelect
|
|
346
|
+
options={surveyOptions}
|
|
347
|
+
bind:value={interests}
|
|
348
|
+
variant="outlined"
|
|
349
|
+
tagColor="6"
|
|
350
|
+
tagVariant="round"
|
|
351
|
+
placeholder="Choose your interests"
|
|
352
|
+
emptyText="No interests selected yet"
|
|
353
|
+
onchange={handleInterestChange}
|
|
354
|
+
onfocus={handleFocus}
|
|
355
|
+
onblur={handleBlur}
|
|
356
|
+
/>
|
|
357
|
+
</div>
|
|
358
|
+
```
|
|
359
|
+
|
|
360
|
+
### Compact Table Usage
|
|
361
|
+
|
|
362
|
+
```svelte
|
|
363
|
+
<script>
|
|
364
|
+
import OptionsMultiSelect from '@ticatec/uniface-element/OptionsMultiSelect';
|
|
365
|
+
|
|
366
|
+
let permissionOptions = [
|
|
367
|
+
{ code: 'READ', text: 'Read' },
|
|
368
|
+
{ code: 'WRITE', text: 'Write' },
|
|
369
|
+
{ code: 'DELETE', text: 'Delete' },
|
|
370
|
+
{ code: 'ADMIN', text: 'Admin' }
|
|
371
|
+
];
|
|
372
|
+
|
|
373
|
+
let users = [
|
|
374
|
+
{ id: 1, name: 'John Doe', permissions: 'READ;WRITE' },
|
|
375
|
+
{ id: 2, name: 'Jane Smith', permissions: 'READ;WRITE;DELETE' },
|
|
376
|
+
{ id: 3, name: 'Admin User', permissions: 'READ;WRITE;DELETE;ADMIN' }
|
|
377
|
+
];
|
|
378
|
+
|
|
379
|
+
function updatePermissions(userId, permissions) {
|
|
380
|
+
const user = users.find(u => u.id === userId);
|
|
381
|
+
if (user) {
|
|
382
|
+
user.permissions = permissions.join(';');
|
|
383
|
+
users = [...users];
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
</script>
|
|
387
|
+
|
|
388
|
+
<table class="permissions-table">
|
|
389
|
+
<thead>
|
|
390
|
+
<tr>
|
|
391
|
+
<th>User</th>
|
|
392
|
+
<th>Permissions</th>
|
|
393
|
+
</tr>
|
|
394
|
+
</thead>
|
|
395
|
+
<tbody>
|
|
396
|
+
{#each users as user}
|
|
397
|
+
<tr>
|
|
398
|
+
<td>{user.name}</td>
|
|
399
|
+
<td>
|
|
400
|
+
<OptionsMultiSelect
|
|
401
|
+
options={permissionOptions}
|
|
402
|
+
value={user.permissions}
|
|
403
|
+
compact
|
|
404
|
+
variant="outlined"
|
|
405
|
+
tagColor="7"
|
|
406
|
+
tagVariant="borderless"
|
|
407
|
+
onchange={(perms) => updatePermissions(user.id, perms)}
|
|
408
|
+
/>
|
|
409
|
+
</td>
|
|
410
|
+
</tr>
|
|
411
|
+
{/each}
|
|
412
|
+
</tbody>
|
|
413
|
+
</table>
|
|
414
|
+
```
|
|
415
|
+
|
|
416
|
+
## Tag Styling
|
|
417
|
+
|
|
418
|
+
The component supports different tag variants and colors:
|
|
419
|
+
|
|
420
|
+
### Tag Variants
|
|
421
|
+
- `borderless`: Clean tags without borders
|
|
422
|
+
- `border`: Tags with visible borders
|
|
423
|
+
- `round`: Rounded pill-style tags
|
|
424
|
+
|
|
425
|
+
### Tag Colors
|
|
426
|
+
Use color strings (e.g., "1", "2", "3") to apply different color schemes to tags.
|
|
427
|
+
|
|
428
|
+
## Best Practices
|
|
429
|
+
|
|
430
|
+
1. **Option Management**: Keep option lists focused and relevant
|
|
431
|
+
2. **Performance**: Consider virtualizing for very large option lists
|
|
432
|
+
3. **Accessibility**: Provide clear labels and descriptions
|
|
433
|
+
4. **Validation**: Implement min/max selection limits when needed
|
|
434
|
+
5. **User Experience**: Use appropriate tag styling for your design system
|
|
435
|
+
6. **Data Format**: Choose delimiters that won't conflict with your data
|
|
436
|
+
7. **State Management**: Handle loading states for dynamic options
|
|
437
|
+
|
|
438
|
+
## Styling
|
|
439
|
+
|
|
440
|
+
```css
|
|
441
|
+
.options-popover {
|
|
442
|
+
max-height: 300px;
|
|
443
|
+
overflow-y: auto;
|
|
444
|
+
border: 1px solid #e0e0e0;
|
|
445
|
+
border-radius: 4px;
|
|
446
|
+
background: white;
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
.option-item {
|
|
450
|
+
padding: 8px 12px;
|
|
451
|
+
display: flex;
|
|
452
|
+
align-items: center;
|
|
453
|
+
gap: 8px;
|
|
454
|
+
cursor: pointer;
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
.option-item:hover {
|
|
458
|
+
background-color: #f5f5f5;
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
.option-item.disabled {
|
|
462
|
+
opacity: 0.5;
|
|
463
|
+
cursor: not-allowed;
|
|
464
|
+
}
|
|
465
|
+
```
|
|
466
|
+
|
|
467
|
+
## Accessibility
|
|
468
|
+
|
|
469
|
+
- Full keyboard navigation support
|
|
470
|
+
- ARIA labels and roles for screen readers
|
|
471
|
+
- Focus management and visual indicators
|
|
472
|
+
- High contrast mode compatibility
|
|
473
|
+
- Checkbox accessibility standards
|
|
474
|
+
|
|
475
|
+
## Related Components
|
|
476
|
+
|
|
477
|
+
- [OptionsSelect](../options-select/README.md) - For single option selection
|
|
478
|
+
- [Tag](../tag/README.md) - For individual tag styling
|
|
479
|
+
- [FormField](../form-field/README.md) - For form layout and labels
|
|
480
|
+
- [CommonPicker](../common/README.md) - Base picker functionality
|