design-system-next 2.5.0 → 2.7.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.
@@ -161,9 +161,23 @@
161
161
  'active:spr-background-color-single-active active:spr-scale-90': true,
162
162
  }"
163
163
  >
164
- <Icon v-if="parentLink.icon && props.activeNav.parentNav !== parentLink.title" :icon="parentLink.icon" class="spr-h-[1.25em] spr-w-[1.25em]" />
165
- <Icon v-else-if="props.activeNav.parentNav === parentLink.title" :icon="`${parentLink.icon}-fill`" class="spr-text-kangkong-700 spr-h-[1.25em] spr-w-[1.25em]" />
166
- <Icon v-else icon="ph:globe" />
164
+ <template v-if="parentLink.icon && parentLink.icon.includes('https://')">
165
+ <img
166
+ v-if="parentLink.icon && props.activeNav.parentNav !== parentLink.title"
167
+ :src="parentLink.icon"
168
+ :alt="`${parentLink.title} icon`"
169
+ class="spr-h-[1.25em] spr-w-[1.25em] spr-max-w-[1.25em]" />
170
+ <img
171
+ v-else-if="props.activeNav.parentNav === parentLink.title"
172
+ :src="parentLink.icon.replace(/\.(svg|png|jpg)$/, '-fill.$1')"
173
+ :alt="`${parentLink.title} icon`"
174
+ class="spr-h-[1.25em] spr-w-[1.25em] spr-max-w-[1.25em]" />
175
+ </template>
176
+ <template v-else>
177
+ <Icon v-if="parentLink.icon && props.activeNav.parentNav !== parentLink.title" :icon="parentLink.icon" class="spr-h-[1.25em] spr-w-[1.25em]" />
178
+ <Icon v-else-if="props.activeNav.parentNav === parentLink.title" :icon="`${parentLink.icon}-fill`" class="spr-text-kangkong-700 spr-h-[1.25em] spr-w-[1.25em]" />
179
+ <Icon v-else icon="ph:globe" />
180
+ </template>
167
181
  </div>
168
182
 
169
183
  <template #popper>
@@ -317,9 +331,23 @@
317
331
  }"
318
332
  @click="handleRedirect(parentLink, parentLink.title, '', '')"
319
333
  >
320
- <Icon v-if="parentLink.icon && props.activeNav.parentNav !== parentLink.title" :icon="parentLink.icon" class="spr-h-[1.25em] spr-w-[1.25em]" />
321
- <Icon v-else-if="props.activeNav.parentNav === parentLink.title" :icon="`${parentLink.icon}-fill`" class="spr-text-kangkong-700 spr-h-[1.25em] spr-w-[1.25em]" />
322
- <Icon v-else icon="ph:globe" />
334
+ <template v-if="parentLink.icon && parentLink.icon.includes('https://')">
335
+ <img
336
+ v-if="parentLink.icon && props.activeNav.parentNav !== parentLink.title"
337
+ :src="parentLink.icon"
338
+ :alt="`${parentLink.title} icon`"
339
+ class="spr-h-[1.25em] spr-w-[1.25em] spr-max-w-[1.25em]" />
340
+ <img
341
+ v-else-if="props.activeNav.parentNav === parentLink.title"
342
+ :src="parentLink.icon.replace(/\.(svg|png|jpg)$/, '-fill.$1')"
343
+ :alt="`${parentLink.title} icon`"
344
+ class="spr-h-[1.25em] spr-w-[1.25em] spr-max-w-[1.25em]" />
345
+ </template>
346
+ <template v-else>
347
+ <Icon v-if="parentLink.icon && props.activeNav.parentNav !== parentLink.title" :icon="parentLink.icon" class="spr-h-[1.25em] spr-w-[1.25em]" />
348
+ <Icon v-else-if="props.activeNav.parentNav === parentLink.title" :icon="`${parentLink.icon}-fill`" class="spr-text-kangkong-700 spr-h-[1.25em] spr-w-[1.25em]" />
349
+ <Icon v-else icon="ph:globe" />
350
+ </template>
323
351
  </div>
324
352
  </Tooltip>
325
353
  </template>
@@ -358,9 +386,23 @@
358
386
  'active:spr-background-color-single-active active:spr-scale-90': true,
359
387
  }"
360
388
  >
361
- <Icon v-if="parentLink.icon && props.activeNav.parentNav !== parentLink.title" :icon="parentLink.icon" class="spr-h-[1.25em] spr-w-[1.25em]" />
362
- <Icon v-else-if="props.activeNav.parentNav === parentLink.title" :icon="`${parentLink.icon}-fill`" class="spr-text-kangkong-700 spr-h-[1.25em] spr-w-[1.25em]" />
363
- <Icon v-else icon="ph:globe" />
389
+ <template v-if="parentLink.icon && parentLink.icon.includes('https://')">
390
+ <img
391
+ v-if="parentLink.icon && props.activeNav.parentNav !== parentLink.title"
392
+ :src="parentLink.icon"
393
+ :alt="`${parentLink.title} icon`"
394
+ class="spr-h-[1.25em] spr-w-[1.25em] spr-max-w-[1.25em]" />
395
+ <img
396
+ v-else-if="props.activeNav.parentNav === parentLink.title"
397
+ :src="parentLink.icon.replace(/\.(svg|png|jpg)$/, '-fill.$1')"
398
+ :alt="`${parentLink.title} icon`"
399
+ class="spr-h-[1.25em] spr-w-[1.25em] spr-max-w-[1.25em]" />
400
+ </template>
401
+ <template v-else>
402
+ <Icon v-if="parentLink.icon && props.activeNav.parentNav !== parentLink.title" :icon="parentLink.icon" class="spr-h-[1.25em] spr-w-[1.25em]" />
403
+ <Icon v-else-if="props.activeNav.parentNav === parentLink.title" :icon="`${parentLink.icon}-fill`" class="spr-text-kangkong-700 spr-h-[1.25em] spr-w-[1.25em]" />
404
+ <Icon v-else icon="ph:globe" />
405
+ </template>
364
406
  </div>
365
407
 
366
408
  <template #popper>
@@ -510,9 +552,23 @@
510
552
  }"
511
553
  @click="handleRedirect(parentLink, parentLink.title, '', '')"
512
554
  >
513
- <Icon v-if="parentLink.icon && props.activeNav.parentNav !== parentLink.title" :icon="parentLink.icon" class="spr-h-[1.25em] spr-w-[1.25em]" />
514
- <Icon v-else-if="props.activeNav.parentNav === parentLink.title" :icon="`${parentLink.icon}-fill`" class="spr-text-kangkong-700 spr-h-[1.25em] spr-w-[1.25em]" />
515
- <Icon v-else icon="ph:globe" />
555
+ <template v-if="parentLink.icon && parentLink.icon.includes('https://')">
556
+ <img
557
+ v-if="parentLink.icon && props.activeNav.parentNav !== parentLink.title"
558
+ :src="parentLink.icon"
559
+ :alt="`${parentLink.title} icon`"
560
+ class="spr-h-[1.25em] spr-w-[1.25em] spr-max-w-[1.25em]" />
561
+ <img
562
+ v-else-if="props.activeNav.parentNav === parentLink.title"
563
+ :src="parentLink.icon.replace(/\.(svg|png|jpg)$/, '-fill.$1')"
564
+ :alt="`${parentLink.title} icon`"
565
+ class="spr-h-[1.25em] spr-w-[1.25em] spr-max-w-[1.25em]" />
566
+ </template>
567
+ <template v-else>
568
+ <Icon v-if="parentLink.icon && props.activeNav.parentNav !== parentLink.title" :icon="parentLink.icon" class="spr-h-[1.25em] spr-w-[1.25em]" />
569
+ <Icon v-else-if="props.activeNav.parentNav === parentLink.title" :icon="`${parentLink.icon}-fill`" class="spr-text-kangkong-700 spr-h-[1.25em] spr-w-[1.25em]" />
570
+ <Icon v-else icon="ph:globe" />
571
+ </template>
516
572
  </div>
517
573
  </Tooltip>
518
574
  </template>
@@ -616,6 +672,7 @@
616
672
  instant-move
617
673
  >
618
674
  <div
675
+ id="sidenav_user_menu"
619
676
  :class="[
620
677
  'spr-background-color spr-flex spr-h-[36px] spr-w-[36px] spr-cursor-pointer spr-items-center spr-justify-center spr-rounded-full',
621
678
  'spr-border-color-weak spr-border spr-border-solid',
@@ -671,6 +728,7 @@
671
728
  <template v-for="(userMenuItem, userMenuItemIndex) in props.userMenu.items" :key="userMenuItemIndex">
672
729
  <div
673
730
  v-if="!userMenuItem.hidden"
731
+ :id="`usermenu_${generateId(userMenuItem.title)}`"
674
732
  :class="[
675
733
  'spr-flex spr-cursor-pointer spr-gap-2 spr-p-2 spr-align-middle spr-duration-150 spr-ease-in-out',
676
734
  'hover:spr-background-color-hover',
@@ -6,13 +6,13 @@
6
6
  @click="handleClick"
7
7
  >
8
8
  <div class="spr-flex spr-flex-auto spr-items-center">
9
- <Icon
10
- v-if="showIcon"
11
- :icon="snackIcon"
12
- :width="iconSize"
13
- :height="iconSize"
14
- :class="[snackToneCssClass, 'spr-mr-size-spacing-3xs']"
15
- />
9
+ <Icon
10
+ v-if="showIcon"
11
+ :icon="snackIcon"
12
+ :width="iconSize"
13
+ :height="iconSize"
14
+ :class="[snackToneCssClass, 'spr-mr-size-spacing-3xs spr-flex-shrink-0']"
15
+ />
16
16
  <label>{{ text }}</label>
17
17
  </div>
18
18
  <template v-if="showAction">
@@ -27,7 +27,7 @@
27
27
  <spr-button
28
28
  v-if="actionIconProps"
29
29
  icon-only
30
- :class="['!spr-p-size-spacing-4xs hover:spr-cursor-pointer', { 'spr-mr-2': actionText !== ''}]"
30
+ :class="['!spr-p-size-spacing-4xs hover:spr-cursor-pointer', { 'spr-mr-2': actionText !== '' }]"
31
31
  size="small"
32
32
  variant="secondary"
33
33
  :tone="actionIconProps.tone"
@@ -17,14 +17,13 @@
17
17
  </template>
18
18
  </spr-table-actions>
19
19
  </div>
20
-
21
20
  <div :class="getTableClasses.tableBackgroundClasses">
22
21
  <table aria-describedby="describe" class="spr-w-full spr-table-fixed" cellspacing="0" cellpadding="0">
23
22
  <thead>
24
23
  <tr v-if="!(props.removeHeaderOnEmpty && sortedData.length <= 0)">
25
24
  <th v-if="props.isMultiSelect" :class="[getTableClasses.multiselectClass, getTableClasses.headerClasses]">
26
25
  <div class="spr-flex spr-justify-center spr-items-center">
27
- <spr-checkbox label="" :checked="isAllSelected" @update:model-value="handleSelectAll"/>
26
+ <spr-checkbox label="" :checked="isAllSelected || isIndeterminate" :indeterminate="isIndeterminate" @update:model-value="handleSelectAll"/>
28
27
  </div>
29
28
  </th>
30
29
  <th v-for="(header, keyHeader) in headers" :key="keyHeader" :class="[getTableClasses.headerClasses]">
@@ -184,6 +183,7 @@ const {
184
183
  getTableClasses,
185
184
  getEmptyStateSize,
186
185
  isAllSelected,
186
+ isIndeterminate,
187
187
 
188
188
  isRowSelected,
189
189
  sortData,
@@ -19,6 +19,11 @@ export const useTable = (props: TablePropTypes, emit: SetupContext<TableEmitType
19
19
  return selectedData.value.length === sortedData.value.length;
20
20
  });
21
21
 
22
+ const isIndeterminate = computed(() => {
23
+ if (selectedData.value.length === 0) return false;
24
+ return selectedData.value.length > 0 && selectedData.value.length < sortedData.value.length;
25
+ });
26
+
22
27
  const sortedData = computed(() => {
23
28
  if (!sortField.value || sortOrder.value) return dataTable.value;
24
29
 
@@ -170,10 +175,10 @@ export const useTable = (props: TablePropTypes, emit: SetupContext<TableEmitType
170
175
  };
171
176
 
172
177
  const handleSelectAll = () => {
173
- if (isAllSelected.value) {
178
+ if (isAllSelected.value || isIndeterminate.value) {
174
179
  selectedData.value = [];
175
180
  } else {
176
- selectedData.value = sortedData.value;
181
+ selectedData.value = [...sortedData.value];
177
182
  }
178
183
  };
179
184
 
@@ -210,5 +215,6 @@ export const useTable = (props: TablePropTypes, emit: SetupContext<TableEmitType
210
215
  selectedData,
211
216
  isAllSelected,
212
217
  isRowSelected,
218
+ isIndeterminate,
213
219
  };
214
220
  };
@@ -51,6 +51,10 @@ export const timePickerPropTypes = {
51
51
  type: String,
52
52
  default: '',
53
53
  },
54
+ placeholder: {
55
+ type: String,
56
+ default: '',
57
+ },
54
58
  };
55
59
  export const timePickerEmitTypes = {
56
60
  'update:modelValue': (evt: MouseEvent): evt is MouseEvent => evt instanceof MouseEvent,
@@ -75,6 +75,8 @@ export const useTimePicker = (props: TimePickerPropTypes, emit: SetupContext<Tim
75
75
  };
76
76
 
77
77
  const getPlaceHolder: ComputedRef<string> = computed(() => {
78
+ if (props.placeholder) return props.placeholder;
79
+
78
80
  return format.value === '12' ? 'HH : MM AM/PM' : 'HH : MM';
79
81
  });
80
82