@meistrari/tela-build 1.54.1 → 1.55.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.
@@ -217,6 +217,7 @@ type ComboboxProps = {
217
217
  backgroundClass: string
218
218
  }
219
219
  compact?: boolean
220
+ align?: 'start' | 'center' | 'end'
220
221
  hasGroupingLabels?: boolean
221
222
  colorIcon?: string
222
223
  disablePortal?: boolean
@@ -60,6 +60,11 @@ const meta: Meta<typeof Combobox> = {
60
60
  control: 'boolean',
61
61
  description: 'Whether to use compact spacing and sizing. Defaults to true. When false, uses larger padding and spacing.',
62
62
  },
63
+ align: {
64
+ control: 'select',
65
+ options: ['start', 'center', 'end'],
66
+ description: 'Alignment of the dropdown content against the trigger. Defaults to "start".',
67
+ },
63
68
  hasGroupingLabels: {
64
69
  control: 'boolean',
65
70
  description: 'Whether to display group labels when options are grouped. Defaults to true. Only shown when search is empty.',
@@ -35,6 +35,7 @@ const props = withDefaults(defineProps<{
35
35
  backgroundClass: string
36
36
  }
37
37
  compact?: boolean
38
+ align?: 'start' | 'center' | 'end'
38
39
  hasGroupingLabels?: boolean
39
40
  colorIcon?: string
40
41
  disablePortal?: boolean
@@ -63,6 +64,7 @@ const props = withDefaults(defineProps<{
63
64
  labelOutputMax?: string
64
65
  }>(), {
65
66
  compact: true,
67
+ align: 'start',
66
68
  hasGroupingLabels: true,
67
69
  disablePortal: false,
68
70
  contentClass: '',
@@ -347,7 +349,7 @@ watch(innerValue, (raw) => {
347
349
  </div>
348
350
  </TelaComboboxTrigger>
349
351
  </TelaComboboxAnchor>
350
- <TelaComboboxList :class="cn('z-999', compact ? 'w-440px' : 'w-327px', props.contentClass)" :disable-portal="props.disablePortal" align="start">
352
+ <TelaComboboxList :class="cn('z-999', compact ? 'w-440px' : 'w-327px', props.contentClass)" :disable-portal="props.disablePortal" :align="align">
351
353
  <TelaComboboxInput
352
354
  v-if="hasSearchbar"
353
355
  v-model="search"
@@ -285,6 +285,15 @@ function handleDeleteSearchValue() {
285
285
  }
286
286
  }
287
287
 
288
+ function selectAll() {
289
+ if (selectedValues.value.length === filteredOptions.value.length) {
290
+ emit('update:modelValue', [])
291
+ }
292
+ else {
293
+ emit('update:modelValue', filteredOptions.value.map(option => option.value))
294
+ }
295
+ }
296
+
288
297
  function handleSearchKeydown(e: KeyboardEvent) {
289
298
  if ((e.metaKey || e.ctrlKey) && e.key === 'Backspace') {
290
299
  e.preventDefault()
@@ -473,6 +482,16 @@ function handleSearchKeydown(e: KeyboardEvent) {
473
482
  >
474
483
  </div>
475
484
 
485
+ <div v-if="filteredOptions.length > 0" flex items-center justify-between pl-10px pr-10px py-4px border-b="0.5px border">
486
+ <span body-12-semibold text-gray-700>{{ t('common.itemCount', { count: filteredOptions.length }) }}</span>
487
+
488
+ <TelaButton variant="ghost" size="sm" class="rounded-lg" @click="selectAll">
489
+ <span body-12-regular text-gray-900 underline>
490
+ {{ selectedValues.length !== filteredOptions.length ? t('common.selectAll') : t('common.clearAll') }}
491
+ </span>
492
+ </TelaButton>
493
+ </div>
494
+
476
495
  <SelectViewport class="p-4px" w-full>
477
496
  <div
478
497
  v-if="!hasAvailableOptions"
@@ -543,6 +562,14 @@ function handleSearchKeydown(e: KeyboardEvent) {
543
562
  "
544
563
  @click="toggleSelection(option.value)"
545
564
  >
565
+ <TelaCheckbox
566
+ :model-value="isSelected(option.value)"
567
+ :disabled="readOnly"
568
+ cursor-pointer
569
+ mr-12px
570
+ min-w-16px
571
+ pointer-events-none
572
+ />
546
573
  <div
547
574
  v-if="option.icon" mr-12px rounded-4px w-40px h-40px flex items-center justify-center
548
575
  b="0.5px gray-200"
@@ -568,9 +595,6 @@ function handleSearchKeydown(e: KeyboardEvent) {
568
595
  </span>
569
596
  </div>
570
597
  <div flex-auto />
571
- <span v-if="isSelected(option.value)" class="relative flex h-3.5 w-3.5 items-center justify-center">
572
- <TelaIcon name="i-ph-check" size="14px" color="gray-500" />
573
- </span>
574
598
  </button>
575
599
  </SelectItem>
576
600
  </SelectGroup>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meistrari/tela-build",
3
- "version": "1.54.1",
3
+ "version": "1.55.1",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "app.config.ts",