@globalbrain/sefirot 2.21.0 → 2.23.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 (58) hide show
  1. package/lib/components/SDropdown.vue +1 -1
  2. package/lib/components/SDropdownSection.vue +1 -1
  3. package/lib/components/SDropdownSectionActions.vue +1 -1
  4. package/lib/components/SDropdownSectionComponent.vue +1 -1
  5. package/lib/components/SDropdownSectionFilter.vue +3 -3
  6. package/lib/components/SDropdownSectionFilterItem.vue +1 -1
  7. package/lib/components/SDropdownSectionMenu.vue +1 -1
  8. package/lib/components/SIcon.vue +1 -1
  9. package/lib/components/SInputAddon.vue +1 -1
  10. package/lib/components/SInputBase.vue +6 -3
  11. package/lib/components/SInputCheckbox.vue +50 -34
  12. package/lib/components/SInputCheckboxes.vue +48 -39
  13. package/lib/components/SInputDate.vue +6 -4
  14. package/lib/components/SInputDropdown.vue +6 -4
  15. package/lib/components/SInputFile.vue +6 -13
  16. package/lib/components/SInputHMS.vue +4 -3
  17. package/lib/components/SInputNumber.vue +6 -5
  18. package/lib/components/SInputRadio.vue +4 -4
  19. package/lib/components/SInputRadios.vue +4 -3
  20. package/lib/components/SInputSelect.vue +4 -3
  21. package/lib/components/SInputSwitch.vue +4 -3
  22. package/lib/components/SInputSwitches.vue +4 -3
  23. package/lib/components/SInputText.vue +4 -3
  24. package/lib/components/SInputTextarea.vue +38 -32
  25. package/lib/components/SInputYMD.vue +4 -3
  26. package/lib/components/SMarkdown.vue +2 -1
  27. package/lib/components/SSheetFooterAction.vue +2 -1
  28. package/lib/components/SSnackbar.vue +2 -1
  29. package/lib/components/SStep.vue +2 -2
  30. package/lib/components/SSteps.vue +5 -4
  31. package/lib/components/STable.vue +1 -1
  32. package/lib/components/STableCell.vue +1 -1
  33. package/lib/components/STableCellAvatars.vue +1 -1
  34. package/lib/components/STableCellDay.vue +1 -1
  35. package/lib/components/STableCellPills.vue +1 -1
  36. package/lib/components/STableColumn.vue +1 -1
  37. package/lib/components/STooltip.vue +2 -1
  38. package/lib/composables/Data.ts +2 -1
  39. package/lib/composables/Dropdown.ts +4 -2
  40. package/lib/composables/Flyout.ts +2 -1
  41. package/lib/composables/Form.ts +6 -3
  42. package/lib/composables/Grid.ts +2 -1
  43. package/lib/composables/Markdown.ts +4 -2
  44. package/lib/composables/Table.ts +4 -3
  45. package/lib/composables/Tooltip.ts +2 -1
  46. package/lib/composables/Utils.ts +4 -2
  47. package/lib/composables/Validation.ts +5 -3
  48. package/lib/composables/markdown/LinkPlugin.ts +1 -1
  49. package/lib/mixins/Sheet.ts +1 -1
  50. package/lib/styles/variables.css +10 -10
  51. package/lib/support/Day.ts +2 -1
  52. package/lib/validation/rules/hms.ts +2 -1
  53. package/lib/validation/rules/requiredHms.ts +2 -1
  54. package/lib/validation/rules/requiredYmd.ts +2 -1
  55. package/lib/validation/rules/ymd.ts +2 -1
  56. package/lib/validation/validators/hms.ts +3 -3
  57. package/lib/validation/validators/requiredYmd.ts +2 -1
  58. package/package.json +3 -3
@@ -1,5 +1,5 @@
1
1
  <script setup lang="ts">
2
- import { DropdownSection } from '../composables/Dropdown'
2
+ import type { DropdownSection } from '../composables/Dropdown'
3
3
  import SDropdownSection from './SDropdownSection.vue'
4
4
 
5
5
  defineProps<{
@@ -1,5 +1,5 @@
1
1
  <script setup lang="ts">
2
- import { DropdownSection } from '../composables/Dropdown'
2
+ import type { DropdownSection } from '../composables/Dropdown'
3
3
  import SDropdownSectionActions from './SDropdownSectionActions.vue'
4
4
  import SDropdownSectionComponent from './SDropdownSectionComponent.vue'
5
5
  import SDropdownSectionFilter from './SDropdownSectionFilter.vue'
@@ -1,5 +1,5 @@
1
1
  <script setup lang="ts">
2
- import { DropdownSectionActionsOption } from '../composables/Dropdown'
2
+ import type { DropdownSectionActionsOption } from '../composables/Dropdown'
3
3
 
4
4
  defineProps<{
5
5
  options: DropdownSectionActionsOption[]
@@ -1,5 +1,5 @@
1
1
  <script setup lang="ts">
2
- import { DefineComponent } from 'vue'
2
+ import type { DefineComponent } from 'vue'
3
3
 
4
4
  defineProps<{
5
5
  comp: DefineComponent
@@ -1,9 +1,9 @@
1
1
  <script setup lang="ts">
2
2
  import IconCheck from '@iconify-icons/ph/check'
3
- import { MaybeRef } from '@vueuse/core'
3
+ import type { MaybeRef } from '@vueuse/core'
4
4
  import Fuse from 'fuse.js'
5
5
  import { computed, onMounted, ref, unref } from 'vue'
6
- import { DropdownSectionFilterOption, DropdownSectionFilterSelectedValue } from '../composables/Dropdown'
6
+ import type { DropdownSectionFilterOption, DropdownSectionFilterSelectedValue } from '../composables/Dropdown'
7
7
  import { isArray } from '../support/Utils'
8
8
  import SDropdownSectionFilterItem from './SDropdownSectionFilterItem.vue'
9
9
  import SIcon from './SIcon.vue'
@@ -23,7 +23,7 @@ const fuse = computed(() => {
23
23
  })
24
24
 
25
25
  const filteredOptions = computed(() => {
26
- return !props.search || !query.value
26
+ return (!props.search || !query.value)
27
27
  ? unref(props.options)
28
28
  : fuse.value.search(query.value).map((r) => r.item)
29
29
  })
@@ -1,5 +1,5 @@
1
1
  <script setup lang="ts">
2
- import { DropdownSectionFilterOption } from '../composables/Dropdown'
2
+ import type { DropdownSectionFilterOption } from '../composables/Dropdown'
3
3
  import SDropdownSectionFilterItemAvatar from './SDropdownSectionFilterItemAvatar.vue'
4
4
  import SDropdownSectionFilterItemText from './SDropdownSectionFilterItemText.vue'
5
5
 
@@ -1,5 +1,5 @@
1
1
  <script setup lang="ts">
2
- import { DropdownSectionMenuOption } from '../composables/Dropdown'
2
+ import type { DropdownSectionMenuOption } from '../composables/Dropdown'
3
3
 
4
4
  defineProps<{
5
5
  options: DropdownSectionMenuOption[]
@@ -1,6 +1,6 @@
1
1
  <script setup lang="ts">
2
2
  import { Icon, IconifyIcon } from '@iconify/vue/dist/offline'
3
- import { DefineComponent } from 'vue'
3
+ import type { DefineComponent } from 'vue'
4
4
 
5
5
  defineProps<{
6
6
  icon: IconifyIcon | DefineComponent
@@ -1,7 +1,7 @@
1
1
  <script setup lang="ts">
2
2
  import IconCaretDown from '@iconify-icons/ph/caret-down-bold'
3
+ import type { DropdownSection } from 'sefirot/composables/Dropdown'
3
4
  import {
4
- DropdownSection,
5
5
  getSelectedOption,
6
6
  useManualDropdownPosition
7
7
  } from 'sefirot/composables/Dropdown'
@@ -1,8 +1,9 @@
1
1
  <script setup lang="ts">
2
+ import type { IconifyIcon } from '@iconify/vue/dist/offline'
2
3
  import IconQuestion from '@iconify-icons/ph/question'
3
- import { IconifyIcon } from '@iconify/vue/dist/offline'
4
- import { DefineComponent, computed, unref, useSlots } from 'vue'
5
- import { Validatable } from '../composables/Validation'
4
+ import type { DefineComponent } from 'vue'
5
+ import { computed, unref, useSlots } from 'vue'
6
+ import type { Validatable } from '../composables/Validation'
6
7
  import SIcon from './SIcon.vue'
7
8
  import STooltip from './STooltip.vue'
8
9
 
@@ -122,11 +123,13 @@ function getErrorMsg(validation: Validatable) {
122
123
  display: flex;
123
124
  align-items: center;
124
125
  gap: 4px;
126
+ transition: color 0.25s;
125
127
  }
126
128
 
127
129
  .label-text-value {
128
130
  font-weight: 500;
129
131
  color: var(--input-label-color);
132
+ transition: color 0.25s;
130
133
  }
131
134
 
132
135
  .label-text-info {
@@ -1,39 +1,54 @@
1
1
  <script setup lang="ts">
2
- import IconCheck from '@iconify-icons/ph/check'
3
- import { IconifyIcon } from '@iconify/vue/dist/offline'
4
- import { DefineComponent, PropType } from 'vue'
5
- import { Validatable } from '../composables/Validation'
2
+ import type { IconifyIcon } from '@iconify/vue/dist/offline'
3
+ import IconCheck from '@iconify-icons/ph/check-bold'
4
+ import { computed } from 'vue'
5
+ import type { Validatable } from '../composables/Validation'
6
6
  import SIcon from './SIcon.vue'
7
7
  import SInputBase from './SInputBase.vue'
8
8
 
9
9
  export type Size = 'mini' | 'small' | 'medium'
10
10
  export type Color = 'neutral' | 'mute' | 'info' | 'success' | 'warning' | 'danger'
11
11
 
12
- const props = defineProps({
13
- size: { type: String as PropType<Size>, default: 'small' },
14
- label: { type: String, default: null },
15
- info: { type: String, default: null },
16
- note: { type: String, default: null },
17
- help: { type: String, default: null },
18
- checkIcon: { type: Object as PropType<IconifyIcon | DefineComponent>, default: null },
19
- checkText: { type: String, default: null },
20
- checkColor: { type: String as PropType<Color>, default: null },
21
- text: { type: String, required: true },
22
- modelValue: { type: Boolean, required: true },
23
- validation: { type: Object as PropType<Validatable>, default: null }
12
+ const props = withDefaults(defineProps<{
13
+ size?: Size
14
+ label?: string
15
+ info?: string
16
+ note?: string
17
+ help?: string
18
+ checkIcon?: IconifyIcon
19
+ checkText?: string
20
+ checkColor?: Color
21
+ text?: string
22
+ value?: boolean
23
+ modelValue?: boolean
24
+ validation?: Validatable
25
+ hideError?: boolean
26
+ }>(), {
27
+ value: undefined,
28
+ modelValue: undefined
24
29
  })
25
30
 
26
- const emit = defineEmits(['update:modelValue'])
31
+ const emit = defineEmits<{
32
+ (e: 'update:model-value', value: boolean): void
33
+ (e: 'change', value: boolean): void
34
+ }>()
27
35
 
28
- function emitChange() {
29
- emit('update:modelValue', !props.modelValue)
36
+ const _value = computed(() => {
37
+ return props.modelValue !== undefined
38
+ ? props.modelValue
39
+ : props.value !== undefined ? props.value : false
40
+ })
41
+
42
+ function onClick() {
43
+ emit('update:model-value', !_value.value)
44
+ emit('change', !_value.value)
30
45
  }
31
46
  </script>
32
47
 
33
48
  <template>
34
49
  <SInputBase
35
50
  class="SInputCheckbox"
36
- :class="[size]"
51
+ :class="[size ?? 'small']"
37
52
  :label="label"
38
53
  :note="note"
39
54
  :info="info"
@@ -44,21 +59,21 @@ function emitChange() {
44
59
  :validation="validation"
45
60
  >
46
61
  <div class="container">
47
- <div class="input" :class="{ on: modelValue }" role="button" @click="emitChange">
62
+ <div class="input" :class="{ on: _value }" role="button" @click="onClick">
48
63
  <div class="box">
49
64
  <div class="check">
50
65
  <SIcon :icon="IconCheck" class="check-icon" />
51
66
  </div>
52
67
  </div>
53
68
 
54
- <p class="text">{{ text }}</p>
69
+ <p v-if="text" class="text">{{ text }}</p>
55
70
  </div>
56
71
  </div>
57
72
  <template v-if="$slots.info" #info><slot name="info" /></template>
58
73
  </SInputBase>
59
74
  </template>
60
75
 
61
- <style lang="postcss" scoped>
76
+ <style scoped lang="postcss">
62
77
  .container {
63
78
  display: flex;
64
79
  }
@@ -68,19 +83,19 @@ function emitChange() {
68
83
  display: flex;
69
84
  align-items: center;
70
85
  height: 32px;
86
+ cursor: pointer;
71
87
 
72
88
  &:hover {
73
89
  .box {
74
- border-color: var(--c-black);
90
+ border-color: var(--c-info-light);
75
91
  }
76
92
  }
77
93
  }
78
94
 
79
95
  .input.on {
80
96
  .box {
81
- border-color: var(--c-black);
82
- background-color: var(--c-black);
83
- box-shadow: var(--shadow-depth-3);
97
+ border-color: var(--c-info-light);
98
+ background-color: var(--c-info-light);
84
99
  }
85
100
 
86
101
  .check {
@@ -91,11 +106,12 @@ function emitChange() {
91
106
 
92
107
  .box {
93
108
  position: relative;
94
- border: 2px solid var(--c-text-3);
95
- border-radius: 2px;
96
- width: 18px;
97
- height: 18px;
98
- transition: border-color .25s, background-color .25s, box-shadow .25s;
109
+ border: 1px solid var(--c-divider-1);
110
+ border-radius: 4px;
111
+ width: 16px;
112
+ height: 16px;
113
+ background-color: var(--input-bg-color);
114
+ transition: border-color 0.25s, background-color 0.25s;
99
115
  }
100
116
 
101
117
  .check {
@@ -118,9 +134,9 @@ function emitChange() {
118
134
 
119
135
  .text {
120
136
  margin: 0;
121
- padding-left: 12px;
137
+ padding-left: 10px;
122
138
  line-height: 20px;
123
139
  font-size: 14px;
124
- font-weight: 500;
140
+ font-weight: 400;
125
141
  }
126
142
  </style>
@@ -1,50 +1,73 @@
1
1
  <script setup lang="ts">
2
- import { IconifyIcon } from '@iconify/vue/dist/offline'
3
- import { DefineComponent, PropType } from 'vue'
2
+ import type { IconifyIcon } from '@iconify/vue/dist/offline'
3
+ import { computed } from 'vue'
4
+ import type { Validatable } from '../composables/Validation'
4
5
  import SInputBase from './SInputBase.vue'
5
6
  import SInputCheckbox from './SInputCheckbox.vue'
6
7
 
7
8
  export type Size = 'mini' | 'small' | 'medium'
8
9
  export type Color = 'neutral' | 'mute' | 'info' | 'success' | 'warning' | 'danger'
9
10
 
10
- interface CheckboxOption {
11
+ export type Value = string | number | boolean
12
+
13
+ export interface Option {
11
14
  label: string
12
- value: any
15
+ value: Value
13
16
  }
14
17
 
15
- const props = defineProps({
16
- size: { type: String as PropType<Size>, default: 'small' },
17
- name: { type: String, default: null },
18
- label: { type: String, default: null },
19
- info: { type: String, default: null },
20
- note: { type: String, default: null },
21
- help: { type: String, default: null },
22
- checkIcon: { type: Object as PropType<IconifyIcon | DefineComponent>, default: null },
23
- checkText: { type: String, default: null },
24
- checkColor: { type: String as PropType<Color>, default: null },
25
- options: { type: Array as PropType<CheckboxOption[]>, required: true },
26
- modelValue: { type: Array, required: true }
18
+ const props = withDefaults(defineProps<{
19
+ size?: Size
20
+ name?: string
21
+ label?: string
22
+ info?: string
23
+ note?: string
24
+ help?: string
25
+ checkIcon?: IconifyIcon
26
+ checkText?: string
27
+ checkColor?: Color
28
+ options: Option[]
29
+ nullable?: boolean
30
+ value?: Value[]
31
+ modelValue?: Value[]
32
+ validation?: Validatable
33
+ hideError?: boolean
34
+ }>(), {
35
+ nullable: true
27
36
  })
28
37
 
29
- const emit = defineEmits(['update:modelValue'])
38
+ const emit = defineEmits<{
39
+ (e: 'update:model-value', value: Value[]): void
40
+ (e: 'change', value: Value[]): void
41
+ }>()
42
+
43
+ const _value = computed(() => {
44
+ return props.modelValue !== undefined
45
+ ? props.modelValue
46
+ : props.value !== undefined ? props.value : []
47
+ })
30
48
 
31
- function isChecked(value: unknown): boolean {
32
- return props.modelValue.includes(value)
49
+ function isChecked(value: Value): boolean {
50
+ return _value.value.includes(value)
33
51
  }
34
52
 
35
- function handleChange(value: unknown): void {
36
- const distinct = props.modelValue
53
+ function handleChange(value: Value): void {
54
+ const distinct = _value.value
37
55
  .filter((v) => v !== value)
38
- .concat(props.modelValue.includes(value) ? [] : [value])
56
+ .concat(_value.value.includes(value) ? [] : [value])
39
57
 
40
- emit('update:modelValue', distinct)
58
+ if (distinct.length === 0 && !props.nullable) {
59
+ return
60
+ }
61
+
62
+ emit('update:model-value', distinct)
63
+ emit('change', distinct)
41
64
  }
42
65
  </script>
43
66
 
44
67
  <template>
45
68
  <SInputBase
46
69
  class="SInputCheckboxes"
47
- :class="[size]"
70
+ :class="[size ?? 'small']"
48
71
  :name="name"
49
72
  :label="label"
50
73
  :note="note"
@@ -56,7 +79,7 @@ function handleChange(value: unknown): void {
56
79
  >
57
80
  <div class="container">
58
81
  <div class="row">
59
- <div v-for="option in options" :key="option.value" class="col">
82
+ <div v-for="option in options" :key="String(option.value)" class="col">
60
83
  <SInputCheckbox
61
84
  :text="option.label"
62
85
  :model-value="isChecked(option.value)"
@@ -68,17 +91,3 @@ function handleChange(value: unknown): void {
68
91
  <template v-if="$slots.info" #info><slot name="info" /></template>
69
92
  </SInputBase>
70
93
  </template>
71
-
72
- <style lang="postcss" scoped>
73
- .container {
74
- display: flex;
75
- }
76
-
77
- .row {
78
- margin: -2px -8px;
79
- }
80
-
81
- .col {
82
- padding: 2px 8px;
83
- }
84
- </style>
@@ -1,9 +1,11 @@
1
1
  <script setup lang="ts">
2
- import { IconifyIcon } from '@iconify/vue/dist/offline'
2
+ import type { IconifyIcon } from '@iconify/vue/dist/offline'
3
3
  import { DatePicker } from 'v-calendar'
4
- import { DefineComponent, computed } from 'vue'
5
- import { Validatable } from '../composables/Validation'
6
- import { Day, day } from '../support/Day'
4
+ import type { DefineComponent } from 'vue'
5
+ import { computed } from 'vue'
6
+ import type { Validatable } from '../composables/Validation'
7
+ import type { Day } from '../support/Day'
8
+ import { day } from '../support/Day'
7
9
  import SInputBase from './SInputBase.vue'
8
10
 
9
11
  export type Color = 'neutral' | 'mute' | 'info' | 'success' | 'warning' | 'danger'
@@ -1,12 +1,14 @@
1
1
  <script setup lang="ts">
2
+ import type { IconifyIcon } from '@iconify/vue/dist/offline'
2
3
  import IconCaretDown from '@iconify-icons/ph/caret-down-bold'
3
4
  import IconCaretUp from '@iconify-icons/ph/caret-up-bold'
4
- import { IconifyIcon } from '@iconify/vue/dist/offline'
5
5
  import xor from 'lodash-es/xor'
6
- import { DefineComponent, computed, ref } from 'vue'
7
- import { DropdownSectionFilter, useManualDropdownPosition } from '../composables/Dropdown'
6
+ import type { DefineComponent } from 'vue'
7
+ import { computed, ref } from 'vue'
8
+ import type { DropdownSectionFilter } from '../composables/Dropdown'
9
+ import { useManualDropdownPosition } from '../composables/Dropdown'
8
10
  import { useFlyout } from '../composables/Flyout'
9
- import { Validatable } from '../composables/Validation'
11
+ import type { Validatable } from '../composables/Validation'
10
12
  import { isArray } from '../support/Utils'
11
13
  import SDropdown from './SDropdown.vue'
12
14
  import SIcon from './SIcon.vue'
@@ -1,7 +1,8 @@
1
1
  <script setup lang="ts">
2
- import { IconifyIcon } from '@iconify/vue/dist/offline'
3
- import { DefineComponent, computed, ref } from 'vue'
4
- import { Validatable } from '../composables/Validation'
2
+ import type { IconifyIcon } from '@iconify/vue/dist/offline'
3
+ import type { DefineComponent } from 'vue'
4
+ import { computed, ref } from 'vue'
5
+ import type { Validatable } from '../composables/Validation'
5
6
  import SInputBase from './SInputBase.vue'
6
7
 
7
8
  export type Size = 'mini' | 'small' | 'medium'
@@ -110,7 +111,7 @@ function onChange(e: Event) {
110
111
  .placeholder {
111
112
  line-height: 30px;
112
113
  font-size: var(--input-font-size, var(--input-mini-font-size));
113
- font-weight: 500;
114
+ font-weight: 400;
114
115
  }
115
116
  }
116
117
 
@@ -122,7 +123,7 @@ function onChange(e: Event) {
122
123
  .button {
123
124
  padding: 0 8px;
124
125
  line-height: 26px;
125
- font-size: 14px;
126
+ font-size: 13px;
126
127
  font-weight: 500;
127
128
  }
128
129
 
@@ -132,10 +133,6 @@ function onChange(e: Event) {
132
133
  font-size: var(--input-font-size, var(--input-small-font-size));
133
134
  font-weight: 400;
134
135
  }
135
-
136
- .placeholder {
137
- font-weight: 500;
138
- }
139
136
  }
140
137
 
141
138
  .SInputFile.medium {
@@ -156,10 +153,6 @@ function onChange(e: Event) {
156
153
  font-size: var(--input-font-size, var(--input-medium-font-size));
157
154
  font-weight: 400;
158
155
  }
159
-
160
- .placeholder {
161
- font-weight: 500;
162
- }
163
156
  }
164
157
 
165
158
  .SInputFile.has-error {
@@ -1,7 +1,8 @@
1
1
  <script setup lang="ts">
2
- import { IconifyIcon } from '@iconify/vue/dist/offline'
3
- import { DefineComponent, computed, ref } from 'vue'
4
- import { Validatable } from '../composables/Validation'
2
+ import type { IconifyIcon } from '@iconify/vue/dist/offline'
3
+ import type { DefineComponent } from 'vue'
4
+ import { computed, ref } from 'vue'
5
+ import type { Validatable } from '../composables/Validation'
5
6
  import SInputBase from './SInputBase.vue'
6
7
 
7
8
  export type Size = 'mini' | 'small' | 'medium'
@@ -1,7 +1,8 @@
1
1
  <script setup lang="ts">
2
- import { IconifyIcon } from '@iconify/vue/dist/offline'
3
- import { DefineComponent, computed } from 'vue'
4
- import { Validatable } from '../composables/Validation'
2
+ import type { IconifyIcon } from '@iconify/vue/dist/offline'
3
+ import type { DefineComponent } from 'vue'
4
+ import { computed } from 'vue'
5
+ import type { Validatable } from '../composables/Validation'
5
6
  import { isNullish, isString } from '../support/Utils'
6
7
  import SInputText from './SInputText.vue'
7
8
 
@@ -40,7 +41,7 @@ const emit = defineEmits<{
40
41
  }>()
41
42
 
42
43
  const _value = computed(() => {
43
- return props.modelValue !== undefined
44
+ return (props.modelValue !== undefined)
44
45
  ? props.modelValue
45
46
  : props.value !== undefined ? props.value : null
46
47
  })
@@ -72,7 +73,7 @@ const displayValue = computed(() => {
72
73
  return props.displayValue
73
74
  }
74
75
 
75
- return !props.separator || valueWithSeparator.value === null
76
+ return (!props.separator || valueWithSeparator.value === null)
76
77
  ? null
77
78
  : valueWithSeparator.value
78
79
  })
@@ -1,7 +1,7 @@
1
1
  <script setup lang="ts">
2
- import { IconifyIcon } from '@iconify/vue/dist/offline'
3
- import { DefineComponent } from 'vue'
4
- import { Validatable } from '../composables/Validation'
2
+ import type { IconifyIcon } from '@iconify/vue/dist/offline'
3
+ import type { DefineComponent } from 'vue'
4
+ import type { Validatable } from '../composables/Validation'
5
5
  import SInputBase from './SInputBase.vue'
6
6
 
7
7
  export type Size = 'mini' | 'small' | 'medium'
@@ -112,7 +112,7 @@ function onClick() {
112
112
  align-items: center;
113
113
  border-radius: 50%;
114
114
  width: 100%;
115
- background-color: var(--c-info-bg);
115
+ background-color: var(--c-info-light);
116
116
  opacity: 0;
117
117
  transform: scale(0);
118
118
  transition: opacity 0.25s, transform 0.1s;
@@ -1,7 +1,8 @@
1
1
  <script setup lang="ts">
2
- import { IconifyIcon } from '@iconify/vue/dist/offline'
3
- import { DefineComponent, computed } from 'vue'
4
- import { Validatable } from '../composables/Validation'
2
+ import type { IconifyIcon } from '@iconify/vue/dist/offline'
3
+ import type { DefineComponent } from 'vue'
4
+ import { computed } from 'vue'
5
+ import type { Validatable } from '../composables/Validation'
5
6
  import SInputBase from './SInputBase.vue'
6
7
  import SInputRadio from './SInputRadio.vue'
7
8
 
@@ -1,9 +1,10 @@
1
1
  <script setup lang="ts">
2
+ import type { IconifyIcon } from '@iconify/vue/dist/offline'
2
3
  import IconCaretDown from '@iconify-icons/ph/caret-down-bold'
3
4
  import IconCaretUp from '@iconify-icons/ph/caret-up-bold'
4
- import { IconifyIcon } from '@iconify/vue/dist/offline'
5
- import { DefineComponent, computed, ref } from 'vue'
6
- import { Validatable } from '../composables/Validation'
5
+ import type { DefineComponent } from 'vue'
6
+ import { computed, ref } from 'vue'
7
+ import type { Validatable } from '../composables/Validation'
7
8
  import SIcon from './SIcon.vue'
8
9
  import SInputBase from './SInputBase.vue'
9
10
 
@@ -1,7 +1,8 @@
1
1
  <script setup lang="ts">
2
- import { IconifyIcon } from '@iconify/vue/dist/offline'
3
- import { DefineComponent, computed } from 'vue'
4
- import { Validatable } from '../composables/Validation'
2
+ import type { IconifyIcon } from '@iconify/vue/dist/offline'
3
+ import type { DefineComponent } from 'vue'
4
+ import { computed } from 'vue'
5
+ import type { Validatable } from '../composables/Validation'
5
6
  import SInputBase from './SInputBase.vue'
6
7
 
7
8
  export type Size = 'mini' | 'small' | 'medium'
@@ -1,7 +1,8 @@
1
1
  <script setup lang="ts">
2
- import { IconifyIcon } from '@iconify/vue/dist/offline'
3
- import { DefineComponent, computed } from 'vue'
4
- import { Validatable } from '../composables/Validation'
2
+ import type { IconifyIcon } from '@iconify/vue/dist/offline'
3
+ import type { DefineComponent } from 'vue'
4
+ import { computed } from 'vue'
5
+ import type { Validatable } from '../composables/Validation'
5
6
  import SInputBase from './SInputBase.vue'
6
7
  import SInputSwitch from './SInputSwitch.vue'
7
8
 
@@ -1,7 +1,8 @@
1
1
  <script setup lang="ts">
2
- import { IconifyIcon } from '@iconify/vue/dist/offline'
3
- import { DefineComponent, computed, ref } from 'vue'
4
- import { Validatable } from '../composables/Validation'
2
+ import type { IconifyIcon } from '@iconify/vue/dist/offline'
3
+ import type { DefineComponent } from 'vue'
4
+ import { computed, ref } from 'vue'
5
+ import type { Validatable } from '../composables/Validation'
5
6
  import { isString } from '../support/Utils'
6
7
  import SIcon from './SIcon.vue'
7
8
  import SInputBase from './SInputBase.vue'
@@ -1,7 +1,7 @@
1
1
  <script setup lang="ts">
2
- import { IconifyIcon } from '@iconify/vue/dist/offline'
3
- import { DefineComponent, computed } from 'vue'
4
- import { Validatable } from '../composables/Validation'
2
+ import type { IconifyIcon } from '@iconify/vue/dist/offline'
3
+ import { computed } from 'vue'
4
+ import type { Validatable } from '../composables/Validation'
5
5
  import SInputBase from './SInputBase.vue'
6
6
 
7
7
  export type Size = 'mini' | 'small' | 'medium'
@@ -14,21 +14,30 @@ const props = defineProps<{
14
14
  info?: string
15
15
  note?: string
16
16
  help?: string
17
- checkIcon?: IconifyIcon | DefineComponent
17
+ checkIcon?: IconifyIcon
18
18
  checkText?: string
19
19
  checkColor?: Color
20
20
  placeholder?: string
21
21
  disabled?: boolean
22
22
  rows?: number | 'fill'
23
- modelValue: string | null
23
+ value?: string | null
24
+ modelValue?: string | null
24
25
  hideError?: boolean
25
26
  validation?: Validatable
26
27
  }>()
27
28
 
28
29
  const emit = defineEmits<{
29
- (e: 'update:modelValue', value: string): void
30
+ (e: 'update:model-value', value: string | null): void
31
+ (e: 'input', value: string | null): void
32
+ (e: 'blur', value: string | null): void
30
33
  }>()
31
34
 
35
+ const _value = computed(() => {
36
+ return props.modelValue !== undefined
37
+ ? props.modelValue
38
+ : props.value !== undefined ? props.value : null
39
+ })
40
+
32
41
  const classes = computed(() => [
33
42
  props.size ?? 'small',
34
43
  { disabled: props.disabled },
@@ -36,12 +45,17 @@ const classes = computed(() => [
36
45
  ])
37
46
 
38
47
  function emitInput(e: Event): void {
39
- emit('update:modelValue', (e.target as HTMLInputElement).value)
48
+ const v = (e.target as HTMLInputElement).value || null
49
+ emit('update:model-value', v)
50
+ emit('input', v)
40
51
  }
41
52
 
42
53
  function emitBlur(e: FocusEvent): void {
43
54
  props.validation?.$touch()
44
- emit('update:modelValue', (e.target as HTMLInputElement).value)
55
+
56
+ const v = (e.target as HTMLInputElement).value || null
57
+ emit('update:model-value', v)
58
+ emit('blur', v)
45
59
  }
46
60
  </script>
47
61
 
@@ -67,7 +81,7 @@ function emitBlur(e: FocusEvent): void {
67
81
  :placeholder="placeholder"
68
82
  :rows="rows ?? 3"
69
83
  :disabled="disabled"
70
- :value="modelValue ?? ''"
84
+ :value="_value ?? undefined"
71
85
  @input="emitInput"
72
86
  @blur="emitBlur"
73
87
  />
@@ -78,21 +92,21 @@ function emitBlur(e: FocusEvent): void {
78
92
  <style scoped lang="postcss">
79
93
  .SInputTextarea.mini {
80
94
  .input {
81
- padding: 6px 12px;
95
+ padding: 6px 10px;
82
96
  width: 100%;
83
97
  min-height: 80px;
84
98
  line-height: 20px;
85
- font-size: 14px;
99
+ font-size: var(--input-font-size, var(--input-mini-font-size));
86
100
  }
87
101
  }
88
102
 
89
103
  .SInputTextarea.small {
90
104
  .input {
91
- padding: 12px;
105
+ padding: 7px 12px;
92
106
  width: 100%;
93
107
  min-height: 96px;
94
108
  line-height: 24px;
95
- font-size: 16px;
109
+ font-size: var(--input-font-size, var(--input-small-font-size));
96
110
  }
97
111
  }
98
112
 
@@ -102,25 +116,27 @@ function emitBlur(e: FocusEvent): void {
102
116
  width: 100%;
103
117
  min-height: 96px;
104
118
  line-height: 24px;
105
- font-size: 16px;
119
+ font-size: var(--input-font-size, var(--input-medium-font-size));
106
120
  }
107
121
  }
108
122
 
109
123
  .SInputTextarea.disabled {
110
124
  .input,
111
125
  .input:hover {
112
- background-color: var(--input-disabled-bg);
126
+ border-color: var(--input-disabled-border-color);
127
+ color: var(--input-disabled-value-color);
128
+ background-color: var(--input-disabled-bg-color);
113
129
  cursor: not-allowed;
114
130
  }
115
131
  }
116
132
 
117
133
  .SInputTextarea.has-error {
118
134
  .input {
119
- border-color: var(--c-danger);
135
+ border-color: var(--input-error-border-color);
120
136
 
121
137
  &:hover,
122
138
  &:focus {
123
- border-color: var(--c-danger);
139
+ border-color: var(--input-error-border-color);
124
140
  }
125
141
  }
126
142
  }
@@ -128,34 +144,24 @@ function emitBlur(e: FocusEvent): void {
128
144
  .input {
129
145
  display: block;
130
146
  flex-grow: 1;
131
- border: 1px solid var(--c-divider);
147
+ border: 1px solid var(--input-border-color);
132
148
  border-radius: 6px;
133
149
  width: 100%;
134
150
  font-weight: 400;
135
- background-color: var(--c-bg);
151
+ background-color: var(--input-bg-color);
136
152
  transition: border-color 0.25s, background-color 0.25s;
137
153
 
138
154
  &::placeholder {
139
- font-weight: 500;
140
- color: var(--c-text-3);
155
+ color: var(--input-placeholder-color);
141
156
  }
142
157
 
143
158
  &:hover {
144
- border-color: var(--c-black);
159
+ border-color: var(--input-hover-border-color);
145
160
  }
146
161
 
147
162
  &:focus,
148
163
  &:hover:focus {
149
- border-color: var(--c-info);
150
- }
151
-
152
- .dark &:hover {
153
- border-color: var(--c-gray);
154
- }
155
-
156
- .dark &:focus,
157
- .dark &:hover:focus {
158
- border-color: var(--c-info);
164
+ border-color: var(--input-focus-border-color);
159
165
  }
160
166
 
161
167
  &.fill {
@@ -1,7 +1,8 @@
1
1
  <script setup lang="ts">
2
- import { IconifyIcon } from '@iconify/vue/dist/offline'
3
- import { DefineComponent, computed, ref } from 'vue'
4
- import { Validatable } from '../composables/Validation'
2
+ import type { IconifyIcon } from '@iconify/vue/dist/offline'
3
+ import type { DefineComponent } from 'vue'
4
+ import { computed, ref } from 'vue'
5
+ import type { Validatable } from '../composables/Validation'
5
6
  import SInputBase from './SInputBase.vue'
6
7
 
7
8
  export type Size = 'mini' | 'small' | 'medium'
@@ -1,6 +1,7 @@
1
1
  <script setup lang="ts">
2
2
  import { computed, nextTick, ref, watch } from 'vue'
3
- import { LinkCallback, LinkSubscriberPayload, useLink, useMarkdown } from '../composables/Markdown'
3
+ import type { LinkCallback, LinkSubscriberPayload } from '../composables/Markdown'
4
+ import { useLink, useMarkdown } from '../composables/Markdown'
4
5
 
5
6
  const props = defineProps<{
6
7
  tag?: string
@@ -1,5 +1,6 @@
1
1
  <script setup lang="ts">
2
- import SButton, { Mode, Type } from './SButton.vue'
2
+ import type { Mode, Type } from './SButton.vue'
3
+ import SButton from './SButton.vue'
3
4
 
4
5
  defineProps<{
5
6
  type?: Type
@@ -1,6 +1,7 @@
1
1
  <script setup lang="ts">
2
2
  import IconX from '@iconify-icons/ph/x'
3
- import { SnackbarAction, useSnackbars } from '../stores/Snackbars'
3
+ import type { SnackbarAction } from '../stores/Snackbars'
4
+ import { useSnackbars } from '../stores/Snackbars'
4
5
  import SButton from './SButton.vue'
5
6
  import SIcon from './SIcon.vue'
6
7
 
@@ -1,8 +1,8 @@
1
1
  <script setup lang="ts">
2
2
  import IconCheck from '@iconify-icons/ph/check'
3
3
  import IconX from '@iconify-icons/ph/x'
4
- import { PropType } from 'vue'
5
- import { BarMode, StepStatus } from '../composables/Step'
4
+ import type { PropType } from 'vue'
5
+ import type { BarMode, StepStatus } from '../composables/Step'
6
6
  import SIcon from './SIcon.vue'
7
7
 
8
8
  defineProps({
@@ -1,6 +1,7 @@
1
1
  <script setup lang="ts">
2
- import { PropType, computed } from 'vue'
3
- import { BarMode, Step } from '../composables/Step'
2
+ import type { PropType } from 'vue'
3
+ import { computed } from 'vue'
4
+ import type { BarMode, Step } from '../composables/Step'
4
5
  import SStep from './SStep.vue'
5
6
 
6
7
  const props = defineProps({
@@ -19,7 +20,7 @@ function getBarLeftMode(index: number): BarMode | null {
19
20
  const current = props.steps[index]
20
21
  const prev = props.steps[index - 1]
21
22
 
22
- return isActive(prev) && isActive(current) ? 'active' : 'mute'
23
+ return (isActive(prev) && isActive(current)) ? 'active' : 'mute'
23
24
  }
24
25
 
25
26
  function getBarRightMode(index: number): BarMode | null {
@@ -30,7 +31,7 @@ function getBarRightMode(index: number): BarMode | null {
30
31
  const current = props.steps[index]
31
32
  const next = props.steps[index + 1]
32
33
 
33
- return isActive(current) && isActive(next) ? 'active' : 'mute'
34
+ return (isActive(current) && isActive(next)) ? 'active' : 'mute'
34
35
  }
35
36
 
36
37
  function isActive(step: Step): boolean {
@@ -1,6 +1,6 @@
1
1
  <script setup lang="ts">
2
2
  import { computed, reactive, ref, toRefs, watch } from 'vue'
3
- import { Table } from '../composables/Table'
3
+ import type { Table } from '../composables/Table'
4
4
  import SSpinner from './SSpinner.vue'
5
5
  import STableCell from './STableCell.vue'
6
6
  import STableColumn from './STableColumn.vue'
@@ -1,6 +1,6 @@
1
1
  <script setup lang="ts">
2
2
  import { computed } from 'vue'
3
- import { TableCell } from '../composables/Table'
3
+ import type { TableCell } from '../composables/Table'
4
4
  import STableCellAvatar from './STableCellAvatar.vue'
5
5
  import STableCellAvatars from './STableCellAvatars.vue'
6
6
  import STableCellDay from './STableCellDay.vue'
@@ -1,6 +1,6 @@
1
1
  <script setup lang="ts">
2
2
  import { computed } from 'vue'
3
- import { TableCellAvatarsOption } from '../composables/Table'
3
+ import type { TableCellAvatarsOption } from '../composables/Table'
4
4
  import SAvatar from './SAvatar.vue'
5
5
 
6
6
  const props = defineProps<{
@@ -1,5 +1,5 @@
1
1
  <script setup lang="ts">
2
- import { Day } from '../support/Day'
2
+ import type { Day } from '../support/Day'
3
3
 
4
4
  defineProps<{
5
5
  value?: Day | null
@@ -1,6 +1,6 @@
1
1
  <script setup lang="ts">
2
2
  import { computed } from 'vue'
3
- import { TableCellPillColor } from '../composables/Table'
3
+ import type { TableCellPillColor } from '../composables/Table'
4
4
  import STableCellPill from './STableCellPill.vue'
5
5
 
6
6
  export interface Pill {
@@ -1,7 +1,7 @@
1
1
  <script setup lang="ts">
2
2
  import IconDotsThree from '@iconify-icons/ph/dots-three'
3
3
  import { computed, nextTick, ref, unref, watch } from 'vue'
4
- import { DropdownSection } from '../composables/Dropdown'
4
+ import type { DropdownSection } from '../composables/Dropdown'
5
5
  import { useFlyout } from '../composables/Flyout'
6
6
  import { isArray } from '../support/Utils'
7
7
  import SDropdown from './SDropdown.vue'
@@ -1,6 +1,7 @@
1
1
  <script setup lang="ts">
2
2
  import { computed, ref } from 'vue'
3
- import { Position, useTooltip } from '../composables/Tooltip'
3
+ import type { Position } from '../composables/Tooltip'
4
+ import { useTooltip } from '../composables/Tooltip'
4
5
  import SMarkdown from './SMarkdown.vue'
5
6
 
6
7
  const props = defineProps<{
@@ -1,6 +1,7 @@
1
1
  import { watchOnce } from '@vueuse/core'
2
2
  import cloneDeep from 'lodash-es/cloneDeep'
3
- import { WatchSource, reactive } from 'vue'
3
+ import type { WatchSource } from 'vue'
4
+ import { reactive } from 'vue'
4
5
  import { isNullish, isObject } from '../support/Utils'
5
6
 
6
7
  export interface Data<T extends Record<string, any>> {
@@ -1,5 +1,7 @@
1
- import { MaybeRef, useElementBounding, useWindowSize } from '@vueuse/core'
2
- import { Ref, ref, unref } from 'vue'
1
+ import type { MaybeRef } from '@vueuse/core'
2
+ import { useElementBounding, useWindowSize } from '@vueuse/core'
3
+ import type { Ref } from 'vue'
4
+ import { ref, unref } from 'vue'
3
5
 
4
6
  export type DropdownSection =
5
7
  | DropdownSectionMenu
@@ -1,4 +1,5 @@
1
- import { Ref, ref, watch } from 'vue'
1
+ import type { Ref } from 'vue'
2
+ import { ref, watch } from 'vue'
2
3
 
3
4
  export function useFlyout(container?: Ref<any>) {
4
5
  const el = container ?? ref<any>(null)
@@ -1,7 +1,10 @@
1
- import { Ref, computed } from 'vue'
1
+ import type { Ref } from 'vue'
2
+ import { computed } from 'vue'
2
3
  import { useSnackbars } from '../stores/Snackbars'
3
- import { UseDataInput, useData } from './Data'
4
- import { Validation, useValidation } from './Validation'
4
+ import type { UseDataInput } from './Data'
5
+ import { useData } from './Data'
6
+ import type { Validation } from './Validation'
7
+ import { useValidation } from './Validation'
5
8
 
6
9
  export interface Form<T extends Record<string, any>> {
7
10
  data: T
@@ -1,4 +1,5 @@
1
- import { Ref, onMounted, onUnmounted, ref, watchEffect } from 'vue'
1
+ import type { Ref } from 'vue'
2
+ import { onMounted, onUnmounted, ref, watchEffect } from 'vue'
2
3
 
3
4
  export interface Grid {
4
5
  container: Ref<HTMLElement | null>
@@ -1,7 +1,9 @@
1
1
  import MarkdownIt from 'markdown-it'
2
- import { Ref, onUnmounted } from 'vue'
2
+ import type { Ref } from 'vue'
3
+ import { onUnmounted } from 'vue'
3
4
  import { useRouter } from 'vue-router'
4
- import { LinkAttrs, isCallbackUrl, isExternalUrl, linkPlugin } from './markdown/LinkPlugin'
5
+ import type { LinkAttrs } from './markdown/LinkPlugin'
6
+ import { isCallbackUrl, isExternalUrl, linkPlugin } from './markdown/LinkPlugin'
5
7
 
6
8
  export type UseMarkdown = (source: string, inline: boolean) => string
7
9
 
@@ -1,6 +1,7 @@
1
- import { MaybeRef } from '@vueuse/core'
2
- import { Component, reactive } from 'vue'
3
- import { DropdownSection } from './Dropdown'
1
+ import type { MaybeRef } from '@vueuse/core'
2
+ import type { Component } from 'vue'
3
+ import { reactive } from 'vue'
4
+ import type { DropdownSection } from './Dropdown'
4
5
 
5
6
  export interface Table {
6
7
  orders: string[]
@@ -1,4 +1,5 @@
1
- import { Ref, ref } from 'vue'
1
+ import type { Ref } from 'vue'
2
+ import { ref } from 'vue'
2
3
 
3
4
  export type Position = 'top' | 'right' | 'bottom' | 'left'
4
5
 
@@ -1,5 +1,7 @@
1
- import { MaybeComputedRef, resolveUnref } from '@vueuse/core'
2
- import { ComputedRef, computed } from 'vue'
1
+ import type { MaybeComputedRef } from '@vueuse/core'
2
+ import { resolveUnref } from '@vueuse/core'
3
+ import type { ComputedRef } from 'vue'
4
+ import { computed } from 'vue'
3
5
 
4
6
  export type WhenCondition<T> = MaybeComputedRef<T>
5
7
 
@@ -1,10 +1,12 @@
1
- import {
1
+ import type {
2
2
  GlobalConfig,
3
3
  Validation,
4
- ValidationArgs,
4
+ ValidationArgs
5
+ } from '@vuelidate/core'
6
+ import {
5
7
  useVuelidate
6
8
  } from '@vuelidate/core'
7
- import { Ref, ToRefs } from 'vue'
9
+ import type { Ref, ToRefs } from 'vue'
8
10
 
9
11
  export type { Validation, ValidationArgs, GlobalConfig }
10
12
 
@@ -1,4 +1,4 @@
1
- import MarkdownIt from 'markdown-it'
1
+ import type MarkdownIt from 'markdown-it'
2
2
 
3
3
  export type LinkAttrs = Record<string, string>
4
4
 
@@ -1,4 +1,4 @@
1
- import { App } from 'vue'
1
+ import type { App } from 'vue'
2
2
  import SSheet from '../components/SSheet.vue'
3
3
  import SSheetFooter from '../components/SSheetFooter.vue'
4
4
  import SSheetFooterAction from '../components/SSheetFooterAction.vue'
@@ -65,16 +65,16 @@
65
65
  --c-text-dark-2: rgba(235, 235, 245, 0.6);
66
66
  --c-text-dark-3: rgba(235, 235, 245, 0.3);
67
67
 
68
- --c-info: #0284c7;
69
- --c-info-light: #0ea5e9;
70
- --c-info-lighter: #38bdf8;
71
- --c-info-lghtest: #7dd3fc;
72
- --c-info-dark: #0369a1;
73
- --c-info-darker: #075985;
74
- --c-info-darkest: #0c4a6e;
75
- --c-info-dimm-1: rgba(2, 132, 199, 0.12);
76
- --c-info-dimm-2: rgba(2, 132, 199, 0.2);
77
- --c-info-dimm-3: rgba(2, 132, 199, 0.28);
68
+ --c-info: #1668b6;
69
+ --c-info-light: #2997ff;
70
+ --c-info-lighter: #5bafff;
71
+ --c-info-lghtest: #7dc0ff;
72
+ --c-info-dark: #104c85;
73
+ --c-info-darker: #0c3963;
74
+ --c-info-darkest: #092e51;
75
+ --c-info-dimm-1: rgba(22, 104, 182, 0.12);
76
+ --c-info-dimm-2: rgba(22, 104, 182, 0.2);
77
+ --c-info-dimm-3: rgba(22, 104, 182, 0.28);
78
78
  --c-info-text: var(--c-info-light);
79
79
  --c-info-text-light: var(--c-info-lighter);
80
80
  --c-info-text-lighter: var(--c-info-lightest);
@@ -1,4 +1,5 @@
1
- import dayjs, { ConfigType, Dayjs } from 'dayjs'
1
+ import type { ConfigType, Dayjs } from 'dayjs'
2
+ import dayjs from 'dayjs'
2
3
  import PluginRelativeTime from 'dayjs/plugin/relativeTime'
3
4
  import PluginTimezone from 'dayjs/plugin/timezone'
4
5
  import PluginUtc from 'dayjs/plugin/utc'
@@ -1,5 +1,6 @@
1
1
  import { helpers } from '@vuelidate/validators'
2
- import { Hms, HmsType, hms as baseHms } from '../validators/hms'
2
+ import type { Hms, HmsType } from '../validators/hms'
3
+ import { hms as baseHms } from '../validators/hms'
3
4
 
4
5
  export function hms(required?: HmsType[], msg?: string) {
5
6
  return helpers.withMessage(
@@ -1,5 +1,6 @@
1
1
  import { helpers } from '@vuelidate/validators'
2
- import { Hms, HmsType, requiredHms as baseRequiredHms } from '../validators/requiredHms'
2
+ import type { Hms, HmsType } from '../validators/requiredHms'
3
+ import { requiredHms as baseRequiredHms } from '../validators/requiredHms'
3
4
 
4
5
  export function requiredHms(required?: HmsType[], msg?: string) {
5
6
  return helpers.withMessage(
@@ -1,5 +1,6 @@
1
1
  import { helpers } from '@vuelidate/validators'
2
- import { Ymd, YmdType, requiredYmd as baseRequiredYmd } from '../validators/requiredYmd'
2
+ import type { Ymd, YmdType } from '../validators/requiredYmd'
3
+ import { requiredYmd as baseRequiredYmd } from '../validators/requiredYmd'
3
4
 
4
5
  export function requiredYmd(required?: YmdType[], msg?: string) {
5
6
  return helpers.withMessage(
@@ -1,5 +1,6 @@
1
1
  import { helpers } from '@vuelidate/validators'
2
- import { Ymd, YmdType, ymd as baseYmd } from '../validators/ymd'
2
+ import type { Ymd, YmdType } from '../validators/ymd'
3
+ import { ymd as baseYmd } from '../validators/ymd'
3
4
 
4
5
  export function ymd(required?: YmdType[], msg?: string) {
5
6
  return helpers.withMessage(
@@ -22,8 +22,8 @@ export function hms(hms: Hms, required: HmsType[] = ['h', 'm', 's']): boolean {
22
22
 
23
23
  const valueAsNumber = Number(value)
24
24
 
25
- return r === 'h'
26
- ? valueAsNumber >= 0 && valueAsNumber < 24
27
- : valueAsNumber >= 0 && valueAsNumber < 60
25
+ return (r === 'h')
26
+ ? (valueAsNumber >= 0 && valueAsNumber < 24)
27
+ : (valueAsNumber >= 0 && valueAsNumber < 60)
28
28
  })
29
29
  }
@@ -1,4 +1,5 @@
1
- import { Ymd, YmdMap, YmdType } from './ymd'
1
+ import type { Ymd, YmdType } from './ymd'
2
+ import { YmdMap } from './ymd'
2
3
 
3
4
  export type { Ymd, YmdType, YmdMap }
4
5
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@globalbrain/sefirot",
3
- "version": "2.21.0",
3
+ "version": "2.23.0",
4
4
  "packageManager": "pnpm@7.26.2",
5
5
  "description": "Vue Components for Global Brain Design System.",
6
6
  "author": "Kia Ishii <ka.ishii@globalbrains.com>",
@@ -46,7 +46,7 @@
46
46
  "dayjs": "^1.11.7"
47
47
  },
48
48
  "devDependencies": {
49
- "@globalbrain/eslint-config": "^1.2.1",
49
+ "@globalbrain/eslint-config": "^1.3.0",
50
50
  "@histoire/plugin-vue": "^0.12.4",
51
51
  "@iconify-icons/ph": "^1.2.3",
52
52
  "@iconify/vue": "^4.0.2",
@@ -64,7 +64,7 @@
64
64
  "chalk": "^4.1.2",
65
65
  "conventional-changelog-cli": "^2.2.2",
66
66
  "enquirer": "^2.3.6",
67
- "eslint": "^8.32.0",
67
+ "eslint": "^8.35.0",
68
68
  "execa": "^5.1.1",
69
69
  "fuse.js": "^6.6.2",
70
70
  "histoire": "^0.12.4",