@globalbrain/sefirot 3.50.0 → 4.0.0-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.
Files changed (106) hide show
  1. package/config/nuxt.d.ts +4 -0
  2. package/config/nuxt.js +31 -0
  3. package/config/vite.d.ts +8 -0
  4. package/config/vite.js +69 -0
  5. package/lib/components/SActionList.vue +0 -1
  6. package/lib/components/SActionListItem.vue +3 -11
  7. package/lib/components/SAlert.vue +8 -13
  8. package/lib/components/SButton.vue +9 -10
  9. package/lib/components/SCardBlock.vue +0 -6
  10. package/lib/components/SControlActionBarClose.vue +1 -1
  11. package/lib/components/SControlActionBarCollapse.vue +2 -2
  12. package/lib/components/SControlInputSearch.vue +2 -2
  13. package/lib/components/SDescAvatar.vue +1 -2
  14. package/lib/components/SDescFile.vue +4 -6
  15. package/lib/components/SDescPill.vue +1 -2
  16. package/lib/components/SDescText.vue +1 -1
  17. package/lib/components/SDropdownSectionDateRange.vue +2 -2
  18. package/lib/components/SDropdownSectionDateRangeDateFromTo.vue +2 -2
  19. package/lib/components/SDropdownSectionDateRangeYear.vue +2 -2
  20. package/lib/components/SDropdownSectionDateRangeYearHalf.vue +2 -2
  21. package/lib/components/SDropdownSectionDateRangeYearQuarter.vue +2 -2
  22. package/lib/components/SDropdownSectionFilter.vue +4 -6
  23. package/lib/components/SIndicator.vue +10 -16
  24. package/lib/components/SInputAddon.vue +6 -8
  25. package/lib/components/SInputBase.vue +6 -8
  26. package/lib/components/SInputCheckbox.vue +7 -11
  27. package/lib/components/SInputCheckboxes.vue +3 -4
  28. package/lib/components/SInputDate.vue +3 -4
  29. package/lib/components/SInputDropdown.vue +10 -13
  30. package/lib/components/SInputDropdownItemAvatar.vue +2 -3
  31. package/lib/components/SInputDropdownItemText.vue +2 -3
  32. package/lib/components/SInputFile.vue +3 -4
  33. package/lib/components/SInputHMS.vue +4 -5
  34. package/lib/components/SInputImage.vue +5 -7
  35. package/lib/components/SInputNumber.vue +10 -11
  36. package/lib/components/SInputRadio.vue +3 -4
  37. package/lib/components/SInputRadios.vue +3 -4
  38. package/lib/components/SInputSegments.vue +3 -4
  39. package/lib/components/SInputSelect.vue +7 -9
  40. package/lib/components/SInputSwitch.vue +3 -4
  41. package/lib/components/SInputSwitches.vue +3 -4
  42. package/lib/components/SInputText.vue +7 -9
  43. package/lib/components/SInputTextarea.vue +3 -4
  44. package/lib/components/SInputYMD.vue +4 -5
  45. package/lib/components/SLink.vue +1 -1
  46. package/lib/components/SLocalNavMenu.vue +3 -4
  47. package/lib/components/SLoginPage.vue +3 -3
  48. package/lib/components/SLoginPagePasswordDialog.vue +4 -4
  49. package/lib/components/SPagination.vue +2 -2
  50. package/lib/components/SPill.vue +1 -5
  51. package/lib/components/SSnackbar.vue +2 -3
  52. package/lib/components/SStep.vue +4 -5
  53. package/lib/components/STable.vue +1 -2
  54. package/lib/components/STableCell.vue +5 -13
  55. package/lib/components/STableCellAvatar.vue +10 -27
  56. package/lib/components/STableCellAvatars.vue +6 -19
  57. package/lib/components/STableCellDay.vue +4 -11
  58. package/lib/components/STableCellNumber.vue +8 -9
  59. package/lib/components/STableCellPill.vue +5 -33
  60. package/lib/components/STableCellPills.vue +4 -14
  61. package/lib/components/STableCellState.vue +3 -3
  62. package/lib/components/STableCellText.vue +22 -50
  63. package/lib/components/STableColumn.vue +4 -6
  64. package/lib/components/STableFooter.vue +4 -5
  65. package/lib/components/STableHeader.vue +2 -19
  66. package/lib/components/STableHeaderMenu.vue +1 -2
  67. package/lib/components/STableHeaderMenuItem.vue +2 -3
  68. package/lib/components/STableItem.vue +1 -1
  69. package/lib/composables/Data.ts +8 -102
  70. package/lib/composables/Error.ts +3 -3
  71. package/lib/composables/Table.ts +17 -22
  72. package/lib/composables/Utils.ts +2 -2
  73. package/lib/composables/Validation.ts +76 -14
  74. package/lib/http/Http.ts +27 -10
  75. package/lib/mixins/Card.ts +0 -27
  76. package/lib/mixins/Fundamental.ts +0 -3
  77. package/lib/support/Day.ts +5 -5
  78. package/lib/support/Utils.ts +35 -14
  79. package/lib/validation/validators/maxLength.ts +2 -2
  80. package/lib/validation/validators/maxValue.ts +2 -2
  81. package/lib/validation/validators/minLength.ts +2 -2
  82. package/lib/validation/validators/minValue.ts +2 -2
  83. package/lib/validation/validators/required.ts +4 -4
  84. package/package.json +40 -40
  85. package/lib/components/SCardFooter.vue +0 -22
  86. package/lib/components/SCardFooterAction.vue +0 -31
  87. package/lib/components/SCardFooterActions.vue +0 -18
  88. package/lib/components/SCardHeader.vue +0 -15
  89. package/lib/components/SCardHeaderAction.vue +0 -28
  90. package/lib/components/SCardHeaderActionClose.vue +0 -27
  91. package/lib/components/SCardHeaderActionCollapse.vue +0 -47
  92. package/lib/components/SCardHeaderActions.vue +0 -13
  93. package/lib/components/SCardHeaderTitle.vue +0 -29
  94. package/lib/components/SIcon.vue +0 -13
  95. package/lib/components/SSheet.vue +0 -87
  96. package/lib/components/SSheetFooter.vue +0 -16
  97. package/lib/components/SSheetFooterAction.vue +0 -34
  98. package/lib/components/SSheetFooterActions.vue +0 -14
  99. package/lib/components/SSheetForm.vue +0 -15
  100. package/lib/components/SSheetMedium.vue +0 -72
  101. package/lib/components/SSheetTitle.vue +0 -13
  102. package/lib/components/STableHeaderActions.vue +0 -20
  103. package/lib/composables/D.ts +0 -21
  104. package/lib/composables/Form.ts +0 -109
  105. package/lib/composables/V.ts +0 -97
  106. package/lib/mixins/Sheet.ts +0 -30
@@ -12,9 +12,6 @@ const props = defineProps<{
12
12
  mode?: Mode
13
13
  label?: string
14
14
  clickable?: boolean
15
-
16
- // @deprecated Use `as` instead.
17
- tag?: string
18
15
  }>()
19
16
 
20
17
  const emit = defineEmits<{
@@ -29,8 +26,7 @@ const classes = computed(() => [
29
26
  ])
30
27
 
31
28
  const computedTag = computed(() => {
32
- const as = props.as ?? props.tag
33
- return as || (props.clickable ? 'button' : 'span')
29
+ return props.as || (props.clickable ? 'button' : 'span')
34
30
  })
35
31
 
36
32
  function onClick() {
@@ -1,8 +1,7 @@
1
1
  <script setup lang="ts">
2
- import IconX from '@iconify-icons/ph/x'
3
2
  import { type SnackbarAction, useSnackbars } from '../stores/Snackbars'
4
3
  import SButton from './SButton.vue'
5
- import SIcon from './SIcon.vue'
4
+ import IconX from '~icons/ph/x'
6
5
 
7
6
  const props = defineProps<{
8
7
  id: number
@@ -21,7 +20,7 @@ function close() {
21
20
  <template>
22
21
  <div class="SSnackbar" :class="[mode ?? 'neutral']">
23
22
  <button class="close" @click="close">
24
- <SIcon :icon="IconX" class="close-icon" />
23
+ <IconX class="close-icon" />
25
24
  </button>
26
25
 
27
26
  <p class="content">
@@ -1,9 +1,8 @@
1
1
  <script setup lang="ts">
2
- import IconCheck from '@iconify-icons/ph/check'
3
- import IconX from '@iconify-icons/ph/x'
4
2
  import { type PropType } from 'vue'
5
3
  import { type BarMode, type StepStatus } from '../composables/Step'
6
- import SIcon from './SIcon.vue'
4
+ import IconCheck from '~icons/ph/check'
5
+ import IconX from '~icons/ph/x'
7
6
 
8
7
  defineProps({
9
8
  status: { type: String as PropType<StepStatus>, required: true },
@@ -19,8 +18,8 @@ defineProps({
19
18
  <div class="bar" :class="[barLeft]" />
20
19
  <div class="point">
21
20
  <div v-if="status === 'active'" class="inner-dot" />
22
- <SIcon v-else-if="status === 'done'" :icon="IconCheck" class="icon" />
23
- <SIcon v-else-if="status === 'failed'" :icon="IconX" class="icon" />
21
+ <IconCheck v-else-if="status === 'done'" class="icon" />
22
+ <IconX v-else-if="status === 'failed'" class="icon" />
24
23
  </div>
25
24
  <div class="bar" :class="[barRight]" />
26
25
  </div>
@@ -98,7 +98,7 @@ const showFooter = computed(() => {
98
98
  return footer
99
99
  }
100
100
 
101
- return (
101
+ return !!(
102
102
  unref(props.options.page)
103
103
  && unref(props.options.perPage)
104
104
  && unref(props.options.total)
@@ -363,7 +363,6 @@ function updateSelected(selected: any) {
363
363
  :total="unref(options.total)"
364
364
  :reset="unref(options.reset)"
365
365
  :menu="unref(options.menu)"
366
- :actions="unref(options.actions)"
367
366
  :borderless="unref(options.borderless)"
368
367
  :on-reset="options.onReset"
369
368
  :selected="Array.isArray(selected) ? selected : undefined"
@@ -37,7 +37,7 @@ const computedCell = computed<TableCell | undefined>(() =>
37
37
  :record="record"
38
38
  :align="computedCell?.align"
39
39
  :icon="computedCell?.icon"
40
- :getter="computedCell?.value"
40
+ :text="computedCell?.value"
41
41
  :link="computedCell?.link"
42
42
  :color="computedCell?.color"
43
43
  :icon-color="computedCell?.iconColor"
@@ -49,7 +49,7 @@ const computedCell = computed<TableCell | undefined>(() =>
49
49
  :record="record"
50
50
  :align="computedCell.align"
51
51
  :icon="computedCell.icon"
52
- :getter="computedCell.value"
52
+ :number="computedCell.value"
53
53
  :separator="computedCell.separator"
54
54
  :link="computedCell.link"
55
55
  :color="computedCell.color"
@@ -58,29 +58,23 @@ const computedCell = computed<TableCell | undefined>(() =>
58
58
  />
59
59
  <STableCellDay
60
60
  v-else-if="computedCell.type === 'day'"
61
- :value="value"
62
- :record="record"
63
61
  :align="computedCell.align"
64
- :getter="computedCell.value"
62
+ :day="computedCell.value"
65
63
  :format="computedCell.format"
66
64
  :color="computedCell.color"
67
65
  />
68
66
  <STableCellPill
69
67
  v-else-if="computedCell.type === 'pill'"
70
- :value="value"
71
- :record="record"
72
- :getter="computedCell.value"
68
+ :pill="computedCell.value"
73
69
  :color="computedCell.color"
74
70
  />
75
71
  <STableCellPills
76
72
  v-else-if="computedCell.type === 'pills'"
77
- :value="value"
78
- :record="record"
79
73
  :pills="computedCell.pills"
80
74
  />
81
75
  <STableCellState
82
76
  v-else-if="computedCell.type === 'state'"
83
- :value="computedCell.label"
77
+ :state="computedCell.label"
84
78
  :mode="computedCell.mode"
85
79
  />
86
80
  <STableCellAvatar
@@ -95,8 +89,6 @@ const computedCell = computed<TableCell | undefined>(() =>
95
89
  />
96
90
  <STableCellAvatars
97
91
  v-else-if="computedCell.type === 'avatars'"
98
- :value="value"
99
- :record="record"
100
92
  :avatars="computedCell.avatars"
101
93
  :color="computedCell.color"
102
94
  :avatar-count="computedCell.avatarCount"
@@ -1,48 +1,31 @@
1
1
  <script setup lang="ts">
2
- import { computed } from 'vue'
3
2
  import SAvatar from './SAvatar.vue'
4
3
  import SLink from './SLink.vue'
5
4
 
6
- const props = defineProps<{
5
+ defineProps<{
7
6
  value?: any
8
7
  record?: any
9
- image?: string | null | ((value: any, record: any) => string | null | undefined)
10
- name?: string | null | ((value: any, record: any) => string | null | undefined)
11
- link?: string | null | ((value: any, record: any) => string | null | undefined)
8
+ image?: string | null
9
+ name?: string | null
10
+ link?: string | null
12
11
  color?: 'neutral' | 'soft' | 'mute'
13
12
  onClick?(value: any, record: any): void
14
13
  }>()
15
-
16
- const _image = computed(() => resolve(props.image))
17
- const _name = computed(() => resolve(props.name))
18
- const _link = computed(() => resolve(props.link))
19
-
20
- function resolve(
21
- value?: string | null | ((value: any, record: any) => string | null | undefined)
22
- ) {
23
- if (value == null || value === '') {
24
- return null
25
- }
26
-
27
- return typeof value === 'function'
28
- ? value(props.value, props.record)
29
- : value
30
- }
31
14
  </script>
32
15
 
33
16
  <template>
34
- <div class="STableCellAvatar" :class="[{ link: link || onClick }, color]">
17
+ <div class="STableCellAvatar" :class="[{ link: !!(link || onClick) }, color]">
35
18
  <SLink
36
19
  class="container"
37
- :href="_link ?? undefined"
20
+ :href="link || undefined"
38
21
  :role="onClick ? 'button' : null"
39
22
  @click="() => onClick?.(value, record)"
40
23
  >
41
- <div v-if="_image || _name" class="avatar">
42
- <SAvatar size="mini" :avatar="_image" :name="_name" />
24
+ <div v-if="image || name" class="avatar">
25
+ <SAvatar size="mini" :avatar="image" :name="name" />
43
26
  </div>
44
- <span v-if="_name" class="name">
45
- {{ _name }}
27
+ <span v-if="name" class="name">
28
+ {{ name }}
46
29
  </span>
47
30
  </SLink>
48
31
  </div>
@@ -5,9 +5,7 @@ import { type Position } from '../composables/Tooltip'
5
5
  import SAvatar from './SAvatar.vue'
6
6
 
7
7
  const props = withDefaults(defineProps<{
8
- value?: any
9
- record?: any
10
- avatars: TableCellAvatarsOption[] | ((value: any, record: any) => TableCellAvatarsOption[])
8
+ avatars: TableCellAvatarsOption[]
11
9
  color?: 'neutral' | 'soft' | 'mute'
12
10
  avatarCount?: number
13
11
  nameCount?: number
@@ -17,22 +15,16 @@ const props = withDefaults(defineProps<{
17
15
  nameCount: 2
18
16
  })
19
17
 
20
- const _avatars = computed(() => {
21
- return typeof props.avatars === 'function'
22
- ? props.avatars(props.value, props.record)
23
- : props.avatars
24
- })
25
-
26
18
  const avatarDiff = computed(() => {
27
- return _avatars.value.length - props.avatarCount
19
+ return props.avatars.length - props.avatarCount
28
20
  })
29
21
 
30
22
  const displayAvatars = computed(() => {
31
- return _avatars.value.slice(0, props.avatarCount)
23
+ return props.avatars.slice(0, props.avatarCount)
32
24
  })
33
25
 
34
26
  const nameDiff = computed(() => {
35
- return _avatars.value.length - props.nameCount
27
+ return props.avatars.length - props.nameCount
36
28
  })
37
29
 
38
30
  const displayNames = computed(() => {
@@ -41,8 +33,7 @@ const displayNames = computed(() => {
41
33
  return null
42
34
  }
43
35
 
44
- const slicedAvatars = _avatars.value.slice(0, props.nameCount)
45
-
36
+ const slicedAvatars = props.avatars.slice(0, props.nameCount)
46
37
  const names = slicedAvatars.map((avatar) => avatar.name).join(', ')
47
38
 
48
39
  if (nameDiff.value > 0) {
@@ -57,11 +48,7 @@ const displayNames = computed(() => {
57
48
  <div class="STableCellAvatars" :class="[color]">
58
49
  <div class="container">
59
50
  <div v-if="displayAvatars.length" class="avatars">
60
- <div
61
- v-for="(avatar, index) in displayAvatars"
62
- :key="index"
63
- class="avatar"
64
- >
51
+ <div v-for="(avatar, index) in displayAvatars" :key="index" class="avatar">
65
52
  <div class="avatar-box">
66
53
  <SAvatar size="mini" :avatar="avatar.image" :name="avatar.name" :tooltip="tooltip" />
67
54
  </div>
@@ -1,25 +1,18 @@
1
1
  <script setup lang="ts">
2
- import { computed } from 'vue'
3
2
  import { type Day } from '../support/Day'
4
3
 
5
- const props = defineProps<{
6
- value?: Day | null
7
- record?: any
4
+ defineProps<{
5
+ day?: Day | null
8
6
  align?: 'left' | 'center' | 'right'
9
- getter?: Day | null
10
7
  format?: string
11
8
  color?: 'neutral' | 'soft' | 'mute'
12
9
  }>()
13
-
14
- const _value = computed(() => {
15
- return props.getter ? props.getter : props.value
16
- })
17
10
  </script>
18
11
 
19
12
  <template>
20
13
  <div class="STableCellDay" :class="[align ?? 'left', color ?? 'neutral']">
21
- <div v-if="_value" class="value">
22
- {{ _value.format(format ?? 'YYYY-MM-DD HH:mm:ss') }}
14
+ <div v-if="day" class="value">
15
+ {{ day.format(format ?? 'YYYY-MM-DD HH:mm:ss') }}
23
16
  </div>
24
17
  </div>
25
18
  </template>
@@ -1,16 +1,15 @@
1
1
  <script setup lang="ts">
2
- import { computed } from 'vue'
2
+ import { type Component, computed } from 'vue'
3
3
  import { type TableCellValueColor } from '../composables/Table'
4
4
  import { format } from '../support/Num'
5
- import SIcon from './SIcon.vue'
6
5
  import SLink from './SLink.vue'
7
6
 
8
7
  const props = defineProps<{
9
8
  value?: any
10
9
  record?: any
11
10
  align?: 'left' | 'center' | 'right'
12
- icon?: any
13
- getter?: number | null
11
+ icon?: Component
12
+ number?: number | null
14
13
  separator?: boolean
15
14
  color?: TableCellValueColor
16
15
  iconColor?: TableCellValueColor
@@ -18,14 +17,14 @@ const props = defineProps<{
18
17
  onClick?(value: any, record: any): void
19
18
  }>()
20
19
 
21
- const _value = computed(() => props.getter ?? props.value)
20
+ const _value = computed(() => props.number ?? props.value)
22
21
  const _color = computed(() => props.color ?? 'neutral')
23
22
  const _iconColor = computed(() => props.iconColor ?? _color.value)
24
23
 
25
24
  const classes = computed(() => [
26
25
  props.align ?? 'left',
27
26
  _color,
28
- { link: props.link || props.onClick }
27
+ { link: !!(props.link || props.onClick) }
29
28
  ])
30
29
  </script>
31
30
 
@@ -38,10 +37,10 @@ const classes = computed(() => [
38
37
  :role="onClick ? 'button' : null"
39
38
  @click="() => onClick?.(value, record)"
40
39
  >
41
- <div v-if="icon" class="icon" :class="[_iconColor]">
42
- <SIcon :icon="icon" class="svg" />
40
+ <div v-if="icon" class="icon" :class="_iconColor">
41
+ <component :is="icon" class="svg" />
43
42
  </div>
44
- <div class="value" :class="[_color ?? 'neutral']">
43
+ <div class="value" :class="_color">
45
44
  {{ separator ? format(_value) : _value }}
46
45
  </div>
47
46
  </SLink>
@@ -1,43 +1,15 @@
1
1
  <script setup lang="ts">
2
- import { computed } from 'vue'
3
2
  import SPill, { type Mode } from './SPill.vue'
4
3
 
5
- const props = defineProps<{
6
- value?: any
7
- record?: any
8
- getter?: string | ((value: any, record: any) => string)
9
- color?: Mode | ((value: any, record: any) => Mode)
4
+ defineProps<{
5
+ pill?: string
6
+ color?: Mode
10
7
  }>()
11
-
12
- const _value = computed(() => {
13
- if (props.getter === undefined) {
14
- return props.value
15
- }
16
-
17
- return typeof props.getter === 'string'
18
- ? props.getter
19
- : props.getter(props.value, props.record)
20
- })
21
-
22
- const _color = computed(() => {
23
- if (props.color === undefined) {
24
- return props.color
25
- }
26
-
27
- return typeof props.color === 'string'
28
- ? props.color
29
- : props.color(props.value, props.record)
30
- })
31
8
  </script>
32
9
 
33
10
  <template>
34
- <div class="STableCellPill" :class="[_color ?? 'neutral']">
35
- <SPill
36
- v-if="_value"
37
- size="mini"
38
- :mode="_color"
39
- :label="_value"
40
- />
11
+ <div class="STableCellPill" :class="[color || 'neutral']">
12
+ <SPill v-if="pill" size="mini" :mode="color" :label="pill" />
41
13
  </div>
42
14
  </template>
43
15
 
@@ -1,28 +1,18 @@
1
1
  <script setup lang="ts">
2
- import { computed } from 'vue'
3
2
  import { type TableCellPillItem } from '../composables/Table'
4
3
  import STableCellPill from './STableCellPill.vue'
5
4
 
6
- const props = defineProps<{
7
- value?: any
8
- record?: any
9
- pills: TableCellPillItem[] | ((value: any, record: any) => TableCellPillItem[])
5
+ defineProps<{
6
+ pills: TableCellPillItem[]
10
7
  }>()
11
-
12
- const items = computed(() => {
13
- return Array.isArray(props.pills)
14
- ? props.pills
15
- : props.pills(props.value, props.record)
16
- })
17
8
  </script>
18
9
 
19
10
  <template>
20
11
  <div class="STableCellPills">
21
12
  <STableCellPill
22
- v-for="item in items"
13
+ v-for="item in pills"
23
14
  :key="item.label"
24
- :value="item.label"
25
- :record="record"
15
+ :pill="item.label"
26
16
  :color="item.color"
27
17
  />
28
18
  </div>
@@ -2,7 +2,7 @@
2
2
  import SState, { type Mode } from './SState.vue'
3
3
 
4
4
  defineProps<{
5
- value?: string
5
+ state?: string
6
6
  mode?: Mode
7
7
  }>()
8
8
  </script>
@@ -10,10 +10,10 @@ defineProps<{
10
10
  <template>
11
11
  <div class="STableCellState" :class="[mode ?? 'neutral']">
12
12
  <SState
13
- v-if="value"
13
+ v-if="state"
14
14
  size="mini"
15
15
  :mode="mode"
16
- :label="value"
16
+ :label="state"
17
17
  />
18
18
  </div>
19
19
  </template>
@@ -1,72 +1,44 @@
1
1
  <script setup lang="ts">
2
- import { computed } from 'vue'
3
- import SIcon from './SIcon.vue'
2
+ import { type Component, computed } from 'vue'
3
+ import { type TableCellValueColor } from '../composables/Table'
4
4
  import SLink from './SLink.vue'
5
5
 
6
- export type Color =
7
- | 'default'
8
- | 'mute'
9
- | 'neutral'
10
- | 'info'
11
- | 'success'
12
- | 'warning'
13
- | 'danger'
14
- | 'soft'
15
-
16
6
  const props = defineProps<{
17
7
  value?: any
18
- record: any
8
+ record?: any
19
9
  align?: 'left' | 'center' | 'right'
20
- icon?: any
21
- getter?: string | null | ((value: any, record: any) => string | null)
22
- color?: Color | ((value: any, record: any) => Color)
23
- iconColor?: Color | ((value: any, record: any) => Color)
24
- link?: string | null | ((value: any, record: any) => string)
10
+ icon?: Component
11
+ text?: string | null
12
+ color?: TableCellValueColor
13
+ iconColor?: TableCellValueColor
14
+ link?: string | null
25
15
  onClick?(value: any, record: any): void
26
16
  }>()
27
17
 
28
- const _value = computed(() => {
29
- if (props.getter === undefined) {
30
- return props.value
31
- }
18
+ const _value = computed(() => props.text ?? props.value)
19
+ const _color = computed(() => props.color ?? 'neutral')
20
+ const _iconColor = computed(() => props.iconColor ?? _color.value)
32
21
 
33
- return typeof props.getter === 'function'
34
- ? props.getter(props.value, props.record)
35
- : props.getter
36
- })
37
-
38
- const _link = computed(() => {
39
- return typeof props.link === 'function'
40
- ? props.link(props.value, props.record)
41
- : props.link
42
- })
43
-
44
- const _color = computed(() => {
45
- return typeof props.color === 'function'
46
- ? props.color(props.value, props.record)
47
- : props.color ?? 'neutral'
48
- })
49
-
50
- const _iconColor = computed(() => {
51
- return typeof props.iconColor === 'function'
52
- ? props.iconColor(props.value, props.record)
53
- : props.iconColor ?? _color.value
54
- })
22
+ const classes = computed(() => [
23
+ props.align ?? 'left',
24
+ _color,
25
+ { link: !!(props.link || props.onClick) }
26
+ ])
55
27
  </script>
56
28
 
57
29
  <template>
58
- <div class="STableCellText" :class="[align ?? 'left', { link: link || onClick }, _color]">
30
+ <div class="STableCellText" :class="classes">
59
31
  <SLink
60
- v-if="_value"
32
+ v-if="_value != null"
61
33
  class="container"
62
- :href="_link"
34
+ :href="link"
63
35
  :role="onClick ? 'button' : null"
64
36
  @click="() => onClick?.(value, record)"
65
37
  >
66
- <div v-if="icon" class="icon" :class="[_iconColor ?? _color]">
67
- <SIcon :icon="icon" class="svg" />
38
+ <div v-if="icon" class="icon" :class="_iconColor">
39
+ <component :is="icon" class="svg" />
68
40
  </div>
69
- <div class="text" :class="[_color]">
41
+ <div class="text" :class="_color">
70
42
  {{ _value }}
71
43
  </div>
72
44
  </SLink>
@@ -1,11 +1,9 @@
1
1
  <script setup lang="ts">
2
- import IconDotsThree from '@iconify-icons/ph/dots-three'
3
2
  import { computed, nextTick, ref, unref, watch } from 'vue'
4
3
  import { type DropdownSection } from '../composables/Dropdown'
5
4
  import { useFlyout } from '../composables/Flyout'
6
- import { isArray } from '../support/Utils'
7
5
  import SDropdown from './SDropdown.vue'
8
- import SIcon from './SIcon.vue'
6
+ import IconDotsThree from '~icons/ph/dots-three'
9
7
 
10
8
  const props = withDefaults(defineProps<{
11
9
  name: string
@@ -40,8 +38,8 @@ const active = computed(() => {
40
38
 
41
39
  const selected = unref(item.selected)
42
40
 
43
- if (!isArray(selected)) {
44
- return selected !== null
41
+ if (!Array.isArray(selected)) {
42
+ return selected != null
45
43
  }
46
44
 
47
45
  if (!selected.length) {
@@ -130,7 +128,7 @@ function stopDialogPositionListener() {
130
128
 
131
129
  <div v-if="dropdown" class="action" ref="container">
132
130
  <button class="button" :class="{ active: buttonActive }" @click="toggle">
133
- <SIcon :icon="IconDotsThree" class="icon" />
131
+ <IconDotsThree class="icon" />
134
132
  </button>
135
133
 
136
134
  <transition name="fade">
@@ -1,9 +1,8 @@
1
1
  <script setup lang="ts">
2
- import IconCaretLeft from '@iconify-icons/ph/caret-left-bold'
3
- import IconCaretRight from '@iconify-icons/ph/caret-right-bold'
4
2
  import { computed } from 'vue'
5
3
  import { format } from '../support/Num'
6
- import SIcon from './SIcon.vue'
4
+ import IconCaretLeft from '~icons/ph/caret-left-bold'
5
+ import IconCaretRight from '~icons/ph/caret-right-bold'
7
6
 
8
7
  const props = defineProps<{
9
8
  total?: number | null
@@ -44,10 +43,10 @@ const hasNext = computed(() => {
44
43
 
45
44
  <div v-if="onPrev && onNext" class="actions">
46
45
  <button class="button prev" :class="{ active: hasPrev }" @click="() => hasPrev && onPrev?.()">
47
- <SIcon :icon="IconCaretLeft" class="icon" />
46
+ <IconCaretLeft class="icon" />
48
47
  </button>
49
48
  <button class="button next" :class="{ active: hasNext }" @click="() => hasNext && onNext?.()">
50
- <SIcon :icon="IconCaretRight" class="icon" />
49
+ <IconCaretRight class="icon" />
51
50
  </button>
52
51
  </div>
53
52
  </div>
@@ -1,23 +1,19 @@
1
1
  <script setup lang="ts">
2
2
  import { computed } from 'vue'
3
- import { type TableHeaderAction, type TableMenu } from '../composables/Table'
3
+ import { type TableMenu } from '../composables/Table'
4
4
  import { format } from '../support/Num'
5
- import { isNullish } from '../support/Utils'
6
- import STableHeaderActions from './STableHeaderActions.vue'
7
5
  import STableHeaderMenu from './STableHeaderMenu.vue'
8
6
 
9
7
  const props = defineProps<{
10
8
  total?: number | null
11
- reset?: boolean
12
9
  menu?: TableMenu[] | TableMenu[][]
13
- actions?: TableHeaderAction[]
14
10
  borderless?: boolean
15
11
  onReset?(): void
16
12
  selected?: unknown[]
17
13
  }>()
18
14
 
19
15
  const stats = computed(() => {
20
- if (isNullish(props.total)) {
16
+ if (props.total == null) {
21
17
  return null
22
18
  }
23
19
 
@@ -25,13 +21,6 @@ const stats = computed(() => {
25
21
  ? `${format(props.selected.length)} of ${props.total} selected`
26
22
  : `${format(props.total)} ${props.total > 1 ? 'records' : 'record'}`
27
23
  })
28
-
29
- // deprecated `reset` prop in favor of `actions`, remove this in next major version
30
- const resetAction = computed(() => {
31
- return props.reset
32
- ? [{ label: 'Reset filters', onClick: props.onReset!, type: 'info' }] // onReset is required when reset is true
33
- : []
34
- })
35
24
  </script>
36
25
 
37
26
  <template>
@@ -41,12 +30,6 @@ const resetAction = computed(() => {
41
30
  <div v-if="stats" class="stats">
42
31
  {{ stats }}
43
32
  </div>
44
- <div v-if="actions?.length" class="actions">
45
- <STableHeaderActions :actions="actions" />
46
- </div>
47
- <div v-else-if="resetAction.length">
48
- <STableHeaderActions :actions="resetAction" />
49
- </div>
50
33
  </div>
51
34
  <div v-if="menu && menu.length" class="menu">
52
35
  <STableHeaderMenu :menu="menu" />
@@ -1,7 +1,6 @@
1
1
  <script setup lang="ts">
2
2
  import { computed } from 'vue'
3
3
  import { type TableMenu } from '../composables/Table'
4
- import { isArray } from '../support/Utils'
5
4
  import STableHeaderMenuItem from './STableHeaderMenuItem.vue'
6
5
 
7
6
  const props = defineProps<{
@@ -9,7 +8,7 @@ const props = defineProps<{
9
8
  }>()
10
9
 
11
10
  const normalizedMenu = computed(() => {
12
- return isArray(props.menu[0])
11
+ return Array.isArray(props.menu[0])
13
12
  ? props.menu as TableMenu[][]
14
13
  : [props.menu] as TableMenu[][]
15
14
  })