@globalbrain/sefirot 3.24.0 → 3.24.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.
@@ -11,7 +11,7 @@ const props = defineProps<{
11
11
  search?: boolean
12
12
  selected: MaybeRef<DropdownSectionFilterSelectedValue>
13
13
  options: MaybeRef<DropdownSectionFilterOption[]>
14
- onClick?(value: string | number | boolean): void
14
+ onClick?(value: any): void
15
15
  }>()
16
16
 
17
17
  const input = ref<HTMLElement | null>(null)
@@ -35,7 +35,7 @@ onMounted(() => {
35
35
  input.value?.focus()
36
36
  })
37
37
 
38
- function isActive(value: string | number | boolean) {
38
+ function isActive(value: any) {
39
39
  const selected = unref(props.selected)
40
40
 
41
41
  return isArray(selected)
@@ -51,7 +51,7 @@ function focusNext(event: any) {
51
51
  event.target.parentNode.nextElementSibling?.firstElementChild?.focus()
52
52
  }
53
53
 
54
- function handleClick(option: DropdownSectionFilterOption, value: string | number | boolean) {
54
+ function handleClick(option: DropdownSectionFilterOption, value: any) {
55
55
  option.onClick && option.onClick(value)
56
56
  props.onClick && props.onClick(value)
57
57
  }
@@ -8,7 +8,7 @@ import SInputCheckbox from './SInputCheckbox.vue'
8
8
  export type Size = 'mini' | 'small' | 'medium'
9
9
  export type Color = 'neutral' | 'mute' | 'info' | 'success' | 'warning' | 'danger'
10
10
 
11
- export type Value = string | number | boolean
11
+ export type Value = any
12
12
 
13
13
  export interface Option {
14
14
  label: string
@@ -16,9 +16,9 @@ import SInputDropdownItem from './SInputDropdownItem.vue'
16
16
  export type Size = 'mini' | 'small' | 'medium'
17
17
  export type Color = 'neutral' | 'mute' | 'info' | 'success' | 'warning' | 'danger'
18
18
 
19
- export type PrimitiveValue = string | number | boolean | null
20
- export type ArrayValue = (string | number | boolean)[]
21
- export type OptionValue = string | number | boolean
19
+ export type PrimitiveValue = any
20
+ export type ArrayValue = any[]
21
+ export type OptionValue = any
22
22
 
23
23
  export type Option = OptionText | OptionAvatar
24
24
 
@@ -6,7 +6,7 @@ export type Item = ItemText | ItemAvatar
6
6
 
7
7
  export interface ItemBase {
8
8
  type?: 'text' | 'avatar'
9
- value: string | number | boolean
9
+ value: any
10
10
  }
11
11
 
12
12
  export interface ItemText extends ItemBase {
@@ -27,7 +27,7 @@ defineProps<{
27
27
  }>()
28
28
 
29
29
  defineEmits<{
30
- (e: 'remove', value: string | number | boolean): void
30
+ (e: 'remove', value: any): void
31
31
  }>()
32
32
  </script>
33
33
 
@@ -6,13 +6,13 @@ import SIcon from './SIcon.vue'
6
6
  defineProps<{
7
7
  label: string
8
8
  image?: string | null
9
- value: string | number | boolean
9
+ value: any
10
10
  removable: boolean
11
11
  disabled: boolean
12
12
  }>()
13
13
 
14
14
  defineEmits<{
15
- (e: 'remove', value: string | number | boolean): void
15
+ (e: 'remove', value: any): void
16
16
  }>()
17
17
  </script>
18
18
 
@@ -4,13 +4,13 @@ import SIcon from './SIcon.vue'
4
4
 
5
5
  defineProps<{
6
6
  label: string
7
- value: string | number | boolean
7
+ value: any
8
8
  removable: boolean
9
9
  disabled: boolean
10
10
  }>()
11
11
 
12
12
  defineEmits<{
13
- (e: 'remove', value: string | number | boolean): void
13
+ (e: 'remove', value: any): void
14
14
  }>()
15
15
  </script>
16
16
 
@@ -10,7 +10,7 @@ export type Color = 'neutral' | 'mute' | 'info' | 'success' | 'warning' | 'dange
10
10
 
11
11
  export interface Option {
12
12
  label: string
13
- value: string | number | boolean
13
+ value: any
14
14
  disabled?: boolean
15
15
  }
16
16
 
@@ -27,8 +27,8 @@ const props = withDefaults(defineProps<{
27
27
  options: Option[]
28
28
  nullable?: boolean
29
29
  disabled?: boolean
30
- value?: string | number | boolean | null
31
- modelValue?: string | number | boolean | null
30
+ value?: any
31
+ modelValue?: any
32
32
  validation?: Validatable
33
33
  hideError?: boolean
34
34
  }>(), {
@@ -37,8 +37,8 @@ const props = withDefaults(defineProps<{
37
37
  })
38
38
 
39
39
  const emit = defineEmits<{
40
- (e: 'update:model-value', value: string | number | boolean | null): void
41
- (e: 'change', value: string | number | boolean | null): void
40
+ (e: 'update:model-value', value: any): void
41
+ (e: 'change', value: any): void
42
42
  }>()
43
43
 
44
44
  const _value = computed(() => {
@@ -47,11 +47,11 @@ const _value = computed(() => {
47
47
  : props.value !== undefined ? props.value : null
48
48
  })
49
49
 
50
- function isChecked(value: string | number | boolean) {
50
+ function isChecked(value: any) {
51
51
  return value === _value.value
52
52
  }
53
53
 
54
- function onUpdate(value: string | number | boolean) {
54
+ function onUpdate(value: any) {
55
55
  if (value !== _value.value) {
56
56
  emit('update:model-value', value)
57
57
  return
@@ -62,7 +62,7 @@ function onUpdate(value: string | number | boolean) {
62
62
  }
63
63
  }
64
64
 
65
- function onChange(value: string | number | boolean) {
65
+ function onChange(value: any) {
66
66
  if (value !== _value.value) {
67
67
  emit('change', value)
68
68
  return
@@ -9,11 +9,11 @@ import SInputBase from './SInputBase.vue'
9
9
 
10
10
  export type Size = 'mini' | 'small' | 'medium'
11
11
  export type Color = 'neutral' | 'mute' | 'info' | 'success' | 'warning' | 'danger'
12
- export type Value = string | number | boolean | null
12
+ export type Value = any
13
13
 
14
14
  export interface Option {
15
15
  label: string
16
- value: string | number | boolean
16
+ value: any
17
17
  disabled?: boolean
18
18
  }
19
19
 
@@ -10,7 +10,7 @@ export type CheckColor = 'neutral' | 'mute' | 'info' | 'success' | 'warning' | '
10
10
 
11
11
  export interface Option {
12
12
  label: string
13
- value: string | number | boolean
13
+ value: any
14
14
  }
15
15
 
16
16
  const props = defineProps<{
@@ -25,24 +25,24 @@ const props = defineProps<{
25
25
  checkColor?: CheckColor
26
26
  options: Option[]
27
27
  disabled?: boolean
28
- modelValue: (string | number | boolean)[]
28
+ modelValue: any[]
29
29
  hideError?: boolean
30
30
  validation?: Validatable
31
31
  }>()
32
32
 
33
33
  const emit = defineEmits<{
34
- (e: 'update:modelValue', value: (string | number | boolean)[]): void
34
+ (e: 'update:modelValue', value: any[]): void
35
35
  }>()
36
36
 
37
37
  const classes = computed(() => [
38
38
  props.size ?? 'small'
39
39
  ])
40
40
 
41
- function isChecked(value: string | number | boolean): boolean {
41
+ function isChecked(value: any): boolean {
42
42
  return props.modelValue.includes(value)
43
43
  }
44
44
 
45
- function handleChange(value: string | number | boolean): void {
45
+ function handleChange(value: any): void {
46
46
  const difference = props.modelValue
47
47
  .filter((v) => v !== value)
48
48
  .concat(props.modelValue.includes(value) ? [] : [value])
@@ -31,15 +31,10 @@ export interface DropdownSectionFilter extends DropdownSectionBase {
31
31
  search?: boolean
32
32
  selected: MaybeRef<DropdownSectionFilterSelectedValue>
33
33
  options: MaybeRef<DropdownSectionFilterOption[]>
34
- onClick?(value: string | number | boolean): void
34
+ onClick?(value: any): void
35
35
  }
36
36
 
37
- export type DropdownSectionFilterSelectedValue =
38
- | string
39
- | number
40
- | boolean
41
- | null
42
- | (string | number | boolean)[]
37
+ export type DropdownSectionFilterSelectedValue = any
43
38
 
44
39
  export type DropdownSectionFilterOption =
45
40
  | DropdownSectionFilterOptionText
@@ -48,9 +43,9 @@ export type DropdownSectionFilterOption =
48
43
  export interface DropdownSectionFilterOptionBase {
49
44
  type?: 'text' | 'avatar'
50
45
  label: string
51
- value: string | number | boolean
46
+ value: any
52
47
  disabled?: boolean
53
- onClick?(value: string | number | boolean): void
48
+ onClick?(value: any): void
54
49
  }
55
50
 
56
51
  export interface DropdownSectionFilterOptionText extends DropdownSectionFilterOptionBase {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@globalbrain/sefirot",
3
- "version": "3.24.0",
3
+ "version": "3.24.1",
4
4
  "packageManager": "pnpm@8.14.1",
5
5
  "description": "Vue Components for Global Brain Design System.",
6
6
  "author": "Kia Ishii <ka.ishii@globalbrains.com>",