@globalbrain/sefirot 0.72.0 → 2.0.0-draft.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.
Files changed (174) hide show
  1. package/CHANGELOG.md +2 -820
  2. package/README.md +1 -1
  3. package/lib/assets/styles/bootstrap.css +1 -2
  4. package/lib/assets/styles/variables.css +14 -47
  5. package/lib/components/SAvatar.vue +9 -18
  6. package/lib/components/SButton.vue +35 -48
  7. package/lib/components/SDialog.vue +16 -34
  8. package/lib/components/SDropdown.vue +36 -55
  9. package/lib/components/SDropdownItem.vue +27 -39
  10. package/lib/components/SDropdownItemText.vue +4 -9
  11. package/lib/components/SDropdownItemUser.vue +4 -12
  12. package/lib/components/SInputBase.vue +33 -45
  13. package/lib/components/SInputCheckbox.vue +17 -37
  14. package/lib/components/SInputDropdown.vue +109 -171
  15. package/lib/components/SInputDropdownItem.vue +26 -32
  16. package/lib/components/SInputDropdownItemText.vue +6 -11
  17. package/lib/components/SInputDropdownItemTextTag.vue +10 -17
  18. package/lib/components/SInputDropdownItemUser.vue +5 -13
  19. package/lib/components/SInputDropdownItemUserTag.vue +9 -16
  20. package/lib/components/SInputFile.vue +38 -53
  21. package/lib/components/SInputHMS.vue +91 -114
  22. package/lib/components/SInputNumber.vue +27 -106
  23. package/lib/components/SInputRadio.vue +21 -34
  24. package/lib/components/SInputRadios.vue +36 -46
  25. package/lib/components/SInputText.vue +59 -633
  26. package/lib/components/SInputTextarea.vue +54 -113
  27. package/lib/components/SInputYMD.vue +94 -105
  28. package/lib/components/SLink.vue +16 -52
  29. package/lib/components/SModal.vue +53 -90
  30. package/lib/components/SPortalModals.vue +37 -53
  31. package/lib/components/SPortalSnackbars.vue +9 -24
  32. package/lib/components/SSheet.vue +10 -23
  33. package/lib/components/SSheetFooter.vue +0 -2
  34. package/lib/components/SSheetFooterAction.vue +9 -14
  35. package/lib/components/SSheetFooterActions.vue +1 -3
  36. package/lib/components/SSheetHeader.vue +9 -24
  37. package/lib/components/SSheetHeaderTitle.vue +0 -2
  38. package/lib/components/SSheetMedium.vue +12 -14
  39. package/lib/components/SSnackbar.vue +18 -28
  40. package/lib/composables/Dialog.ts +9 -17
  41. package/lib/composables/Dropdown.ts +1 -1
  42. package/lib/composables/{Menu.ts → Flyout.ts} +11 -4
  43. package/lib/composables/Form.ts +42 -44
  44. package/lib/composables/Modal.ts +9 -9
  45. package/lib/composables/Snackbar.ts +18 -0
  46. package/lib/composables/Validation.ts +28 -0
  47. package/lib/mixins/Sheet.ts +3 -3
  48. package/lib/store/Sefirot.ts +8 -13
  49. package/lib/store/dialog/index.ts +20 -10
  50. package/lib/store/modal/index.ts +11 -13
  51. package/lib/store/snackbars/index.ts +3 -4
  52. package/lib/support/{Util.ts → Utils.ts} +0 -2
  53. package/lib/types/Utils.ts +0 -7
  54. package/lib/types/vue-shims.d.ts +7 -0
  55. package/lib/validation/rules/checked.ts +6 -10
  56. package/lib/validation/rules/fileExtension.ts +9 -9
  57. package/lib/validation/rules/hms.ts +9 -9
  58. package/lib/validation/rules/index.ts +10 -74
  59. package/lib/validation/rules/maxLength.ts +10 -9
  60. package/lib/validation/rules/minLength.ts +12 -0
  61. package/lib/validation/rules/required.ts +2 -10
  62. package/lib/validation/rules/requiredHms.ts +11 -0
  63. package/lib/validation/rules/requiredIf.ts +3 -11
  64. package/lib/validation/rules/requiredYmd.ts +11 -0
  65. package/lib/validation/rules/ymd.ts +11 -0
  66. package/lib/validation/validators/checked.ts +1 -1
  67. package/lib/validation/validators/fileExtension.ts +1 -1
  68. package/lib/validation/validators/hms.ts +5 -5
  69. package/lib/validation/validators/requiredHms.ts +17 -0
  70. package/lib/validation/validators/requiredYmd.ts +7 -0
  71. package/lib/validation/validators/ymd.ts +41 -0
  72. package/package.json +45 -50
  73. package/lib/components/SAction.vue +0 -37
  74. package/lib/components/SActionAvatar.vue +0 -25
  75. package/lib/components/SActionButton.vue +0 -40
  76. package/lib/components/SActionPill.vue +0 -35
  77. package/lib/components/SActionSwitch.vue +0 -37
  78. package/lib/components/SAlert.vue +0 -145
  79. package/lib/components/SButtonGroup.vue +0 -160
  80. package/lib/components/SCard.vue +0 -111
  81. package/lib/components/SCardFooter.vue +0 -74
  82. package/lib/components/SCardHeader.vue +0 -213
  83. package/lib/components/SGrid.vue +0 -237
  84. package/lib/components/SGridActionLink.vue +0 -53
  85. package/lib/components/SGridActionMulti.vue +0 -139
  86. package/lib/components/SGridActionSingle.vue +0 -64
  87. package/lib/components/SHeader.vue +0 -180
  88. package/lib/components/SInputCheckboxes.vue +0 -87
  89. package/lib/components/SInputDate.vue +0 -192
  90. package/lib/components/SInputDay.vue +0 -87
  91. package/lib/components/SInputMonth.vue +0 -86
  92. package/lib/components/SInputSelect.vue +0 -298
  93. package/lib/components/SInputSwitch.vue +0 -212
  94. package/lib/components/SInputSwitches.vue +0 -108
  95. package/lib/components/SInputTime.vue +0 -255
  96. package/lib/components/SInputYear.vue +0 -60
  97. package/lib/components/SMarkdown.vue +0 -56
  98. package/lib/components/SPlaceholderBlank.vue +0 -113
  99. package/lib/components/SPlaceholderImage.vue +0 -83
  100. package/lib/components/SPortalScreens.vue +0 -62
  101. package/lib/components/SProgressBar.vue +0 -89
  102. package/lib/components/SResponsive.vue +0 -46
  103. package/lib/components/SScreen.vue +0 -81
  104. package/lib/components/SStep.vue +0 -107
  105. package/lib/components/SSteps.vue +0 -75
  106. package/lib/components/STag.vue +0 -67
  107. package/lib/components/STooltip.vue +0 -134
  108. package/lib/components/SWindow.vue +0 -158
  109. package/lib/components/icons/SIconCopy.vue +0 -6
  110. package/lib/composables/Action.ts +0 -141
  111. package/lib/composables/Alert.ts +0 -50
  112. package/lib/composables/Card.ts +0 -46
  113. package/lib/composables/FormValidation.ts +0 -150
  114. package/lib/composables/Header.ts +0 -72
  115. package/lib/composables/InputDropdown.ts +0 -6
  116. package/lib/composables/Markdown.ts +0 -138
  117. package/lib/composables/Router.ts +0 -20
  118. package/lib/composables/Step.ts +0 -7
  119. package/lib/composables/Store.ts +0 -9
  120. package/lib/composables/Tag.ts +0 -32
  121. package/lib/composables/Tooltip.ts +0 -91
  122. package/lib/composables/Utils.ts +0 -115
  123. package/lib/composables/markdown/LinkPlugin.ts +0 -45
  124. package/lib/compositions/useForm.ts +0 -17
  125. package/lib/compositions/useResizeObserver.ts +0 -25
  126. package/lib/compositions/useTime.ts +0 -26
  127. package/lib/store/alert/index.ts +0 -32
  128. package/lib/store/screen/index.ts +0 -46
  129. package/lib/types/v-calendar.d.ts +0 -5
  130. package/lib/validation/Validation.ts +0 -151
  131. package/lib/validation/rules/day.ts +0 -11
  132. package/lib/validation/rules/email.ts +0 -11
  133. package/lib/validation/rules/every.ts +0 -38
  134. package/lib/validation/rules/include.ts +0 -11
  135. package/lib/validation/rules/includeSome.ts +0 -11
  136. package/lib/validation/rules/integer.ts +0 -11
  137. package/lib/validation/rules/maxValue.ts +0 -11
  138. package/lib/validation/rules/minValue.ts +0 -11
  139. package/lib/validation/rules/month.ts +0 -11
  140. package/lib/validation/rules/not.ts +0 -10
  141. package/lib/validation/rules/regex.ts +0 -11
  142. package/lib/validation/rules/requiredHMS.ts +0 -11
  143. package/lib/validation/rules/requiredMonthDate.ts +0 -11
  144. package/lib/validation/rules/requiredYearMonth.ts +0 -11
  145. package/lib/validation/rules/requiredYearMonthDate.ts +0 -11
  146. package/lib/validation/rules/rule.ts +0 -5
  147. package/lib/validation/rules/sameAs.ts +0 -11
  148. package/lib/validation/rules/url.ts +0 -11
  149. package/lib/validation/rules/validateIf.ts +0 -27
  150. package/lib/validation/rules/year.ts +0 -11
  151. package/lib/validation/rules/yearMonth.ts +0 -11
  152. package/lib/validation/rules/yearMonthDate.ts +0 -11
  153. package/lib/validation/validators/day.ts +0 -29
  154. package/lib/validation/validators/email.ts +0 -5
  155. package/lib/validation/validators/include.ts +0 -5
  156. package/lib/validation/validators/includeSome.ts +0 -5
  157. package/lib/validation/validators/index.ts +0 -51
  158. package/lib/validation/validators/integer.ts +0 -6
  159. package/lib/validation/validators/maxLength.ts +0 -3
  160. package/lib/validation/validators/maxValue.ts +0 -3
  161. package/lib/validation/validators/minValue.ts +0 -3
  162. package/lib/validation/validators/month.ts +0 -3
  163. package/lib/validation/validators/monthDate.ts +0 -20
  164. package/lib/validation/validators/regex.ts +0 -3
  165. package/lib/validation/validators/required.ts +0 -27
  166. package/lib/validation/validators/requiredHMS.ts +0 -17
  167. package/lib/validation/validators/requiredMonthDate.ts +0 -8
  168. package/lib/validation/validators/requiredYearMonth.ts +0 -8
  169. package/lib/validation/validators/requiredYearMonthDate.ts +0 -9
  170. package/lib/validation/validators/sameAs.ts +0 -5
  171. package/lib/validation/validators/url.ts +0 -5
  172. package/lib/validation/validators/year.ts +0 -3
  173. package/lib/validation/validators/yearMonth.ts +0 -20
  174. package/lib/validation/validators/yearMonthDate.ts +0 -21
@@ -10,26 +10,19 @@
10
10
  </div>
11
11
  </template>
12
12
 
13
- <script lang="ts">
14
- import { PropType, defineComponent } from '@vue/composition-api'
15
- import { Item } from '../composables/Dropdown'
13
+ <script setup lang="ts">
14
+ import { PropType } from 'vue'
16
15
  import SIconX from './icons/SIconX.vue'
17
16
 
18
- export default defineComponent({
19
- components: {
20
- SIconX
21
- },
22
-
23
- props: {
24
- item: { type: Object as PropType<Item>, required: true },
25
- disabled: { type: Boolean, default: false }
26
- }
17
+ defineProps({
18
+ item: { type: Object as PropType<any>, required: true },
19
+ disabled: { type: Boolean, default: false }
27
20
  })
21
+
22
+ defineEmits(['remove'])
28
23
  </script>
29
24
 
30
25
  <style lang="postcss" scoped>
31
- @import "@/assets/styles/variables";
32
-
33
26
  .SInputDropdownItemTextTag {
34
27
  display: flex;
35
28
  border-radius: 12px;
@@ -37,7 +30,7 @@ export default defineComponent({
37
30
  background-color: var(--c-white-mute);
38
31
  }
39
32
 
40
- .dark-mode .SInputDropdownItemTextTag {
33
+ .dark .SInputDropdownItemTextTag {
41
34
  background-color: var(--c-black-mute);
42
35
  }
43
36
 
@@ -50,7 +43,7 @@ export default defineComponent({
50
43
  }
51
44
  }
52
45
 
53
- .dark-mode .SInputDropdownItemTextTag.disabled {
46
+ .dark .SInputDropdownItemTextTag.disabled {
54
47
  background-color: var(--c-gray-dark-2);
55
48
  }
56
49
 
@@ -76,7 +69,7 @@ export default defineComponent({
76
69
  }
77
70
  }
78
71
 
79
- .dark-mode .remove {
72
+ .dark .remove {
80
73
  &:hover .remove-box {
81
74
  background-color: var(--c-gray-dark-2)
82
75
  }
@@ -8,26 +8,18 @@
8
8
  </div>
9
9
  </template>
10
10
 
11
- <script lang="ts">
12
- import { PropType, defineComponent } from '@vue/composition-api'
11
+ <script setup lang="ts">
12
+ import { PropType } from 'vue'
13
13
  import { UserItem } from '../composables/Dropdown'
14
14
  import SAvatar from './SAvatar.vue'
15
15
 
16
- export default defineComponent({
17
- components: {
18
- SAvatar
19
- },
20
-
21
- props: {
22
- item: { type: Object as PropType<UserItem>, required: true },
23
- disabled: { type: Boolean, default: false }
24
- }
16
+ defineProps({
17
+ item: { type: Object as PropType<UserItem>, required: true },
18
+ disabled: { type: Boolean, default: false }
25
19
  })
26
20
  </script>
27
21
 
28
22
  <style lang="postcss" scoped>
29
- @import "@/assets/styles/variables";
30
-
31
23
  .SInputDropdownItemUser {
32
24
  position: relative;
33
25
  }
@@ -16,28 +16,21 @@
16
16
  </div>
17
17
  </template>
18
18
 
19
- <script lang="ts">
20
- import { PropType, defineComponent } from '@vue/composition-api'
19
+ <script setup lang="ts">
20
+ import { PropType } from 'vue'
21
21
  import { UserItem } from '../composables/Dropdown'
22
22
  import SIconX from './icons/SIconX.vue'
23
23
  import SAvatar from './SAvatar.vue'
24
24
 
25
- export default defineComponent({
26
- components: {
27
- SIconX,
28
- SAvatar
29
- },
30
-
31
- props: {
32
- item: { type: Object as PropType<UserItem>, required: true },
33
- disabled: { type: Boolean, default: false }
34
- }
25
+ defineProps({
26
+ item: { type: Object as PropType<UserItem>, required: true },
27
+ disabled: { type: Boolean, default: false }
35
28
  })
29
+
30
+ defineEmits(['remove'])
36
31
  </script>
37
32
 
38
33
  <style lang="postcss" scoped>
39
- @import "@/assets/styles/variables";
40
-
41
34
  .SInputDropdownItemUserTag {
42
35
  display: flex;
43
36
  border-radius: 12px;
@@ -50,7 +43,7 @@ export default defineComponent({
50
43
  background-color: var(--c-gray-light-4);
51
44
  }
52
45
 
53
- .dark-mode .SInputDropdownItemUserTag {
46
+ .dark .SInputDropdownItemUserTag {
54
47
  background-color: var(--c-black-mute);
55
48
  }
56
49
 
@@ -82,7 +75,7 @@ export default defineComponent({
82
75
  }
83
76
  }
84
77
 
85
- .dark-mode .remove {
78
+ .dark .remove {
86
79
  &:hover .remove-box {
87
80
  background-color: var(--c-gray-dark-2)
88
81
  }
@@ -2,7 +2,6 @@
2
2
  <SInputBase
3
3
  class="SInputFile"
4
4
  :class="classes"
5
- :name="name"
6
5
  :label="label"
7
6
  :note="note"
8
7
  :help="help"
@@ -13,7 +12,7 @@
13
12
  ref="input"
14
13
  class="input"
15
14
  type="file"
16
- @change="e => handleChange(e.target.files[0])"
15
+ @change="handleChange"
17
16
  >
18
17
 
19
18
  <div class="box" role="button" @click="open">
@@ -31,63 +30,49 @@
31
30
  </SInputBase>
32
31
  </template>
33
32
 
34
- <script lang="ts">
35
- import { PropType, defineComponent, ref, computed } from '@vue/composition-api'
36
- import { Validation } from '../validation/Validation'
33
+ <script setup lang="ts">
34
+ import { PropType, ref, computed } from 'vue'
35
+ import { Validation, Validatable } from '../composables/Validation'
37
36
  import SInputBase from './SInputBase.vue'
38
37
 
39
38
  type Size = 'mini' | 'small' | 'medium'
40
39
 
41
- export default defineComponent({
42
- components: {
43
- SInputBase
44
- },
45
-
46
- props: {
47
- size: { type: String as PropType<Size>, default: 'small' },
48
- name: { type: String, default: null },
49
- label: { type: String, default: null },
50
- note: { type: String, default: null },
51
- text: { type: String, default: 'Choose File' },
52
- help: { type: String, default: null },
53
- placeholder: { type: String, default: null },
54
- errorMessage: { type: Boolean, default: true },
55
- value: { type: File, default: null },
56
- validation: { type: Object as PropType<Validation>, default: null }
57
- },
58
-
59
- setup(props, { emit }) {
60
- const input = ref<HTMLInputElement | null>(null)
61
-
62
- const classes = computed(() => [props.size])
63
-
64
- const fileName = computed(() => {
65
- return props.value ? props.value.name : null
66
- })
67
-
68
- function open(): void {
69
- input.value!.click()
70
- }
40
+ const props = defineProps({
41
+ size: { type: String as PropType<Size>, default: 'small' },
42
+ label: { type: String, default: null },
43
+ note: { type: String, default: null },
44
+ text: { type: String, default: 'Choose File' },
45
+ help: { type: String, default: null },
46
+ placeholder: { type: String, default: null },
47
+ errorMessage: { type: Boolean, default: true },
48
+ modelValue: { type: Object as PropType<File | null>, default: null },
49
+ validation: { type: Object as PropType<Validatable>, default: null }
50
+ })
71
51
 
72
- function handleChange(file?: File): void {
73
- emit('input', file ?? null)
74
- file && props.validation?.$touch()
75
- }
52
+ const emit = defineEmits(['update:modelValue'])
76
53
 
77
- return {
78
- input,
79
- classes,
80
- fileName,
81
- open,
82
- handleChange
83
- }
84
- }
54
+ const input = ref<HTMLInputElement | null>(null)
55
+
56
+ const classes = computed(() => [props.size])
57
+
58
+ const fileName = computed(() => {
59
+ return props.modelValue ? props.modelValue.name : null
85
60
  })
61
+
62
+ function open(): void {
63
+ input.value!.click()
64
+ }
65
+
66
+ function handleChange(e: Event): void {
67
+ const file = (e.target as any).files[0]
68
+
69
+ emit('update:modelValue', file ?? null)
70
+
71
+ file && props.validation?.$touch()
72
+ }
86
73
  </script>
87
74
 
88
75
  <style lang="postcss" scoped>
89
- @import "@/assets/styles/variables";
90
-
91
76
  .SInputFile.mini {
92
77
  .action {
93
78
  padding: 2px 8px 2px 2px;
@@ -167,13 +152,13 @@ export default defineComponent({
167
152
 
168
153
  .box {
169
154
  display: flex;
170
- border: 1px solid var(--input-outlined-border);
155
+ border: 1px solid var(--input-border);
171
156
  border-radius: 4px;
172
157
  cursor: pointer;
173
158
  transition: border-color .25s;
174
159
 
175
160
  &:hover {
176
- border-color: var(--input-outlined-border-focus);
161
+ border-color: var(--input-focus-border);
177
162
 
178
163
  .button {
179
164
  background-color: var(--c-gray-light-4);
@@ -181,7 +166,7 @@ export default defineComponent({
181
166
  }
182
167
  }
183
168
 
184
- .dark-mode .box {
169
+ .dark .box {
185
170
  &:hover {
186
171
  .button {
187
172
  background-color: var(--c-gray-dark-3);
@@ -201,7 +186,7 @@ export default defineComponent({
201
186
  transition: background-color .25s;
202
187
  }
203
188
 
204
- .dark-mode .button {
189
+ .dark .button {
205
190
  background-color: var(--c-black-mute);
206
191
  transition: background-color .25s;
207
192
  }
@@ -1,8 +1,7 @@
1
1
  <template>
2
2
  <SInputBase
3
3
  class="SInputHMS"
4
- :class="[size, mode, { disabled }]"
5
- :name="name"
4
+ :class="[size, { disabled }]"
6
5
  :label="label"
7
6
  :note="note"
8
7
  :help="help"
@@ -13,7 +12,7 @@
13
12
  <input
14
13
  v-if="hour"
15
14
  class="input hour"
16
- :value="value && value.hour"
15
+ :value="modelValue?.hour ?? null"
17
16
  placeholder="00"
18
17
  :disabled="disabled"
19
18
  @blur="updateHour"
@@ -22,7 +21,7 @@
22
21
  <input
23
22
  v-if="minute"
24
23
  class="input minute"
25
- :value="value && value.minute"
24
+ :value="modelValue?.minute ?? null"
26
25
  placeholder="00"
27
26
  :disabled="disabled"
28
27
  @blur="updateMinute"
@@ -31,7 +30,7 @@
31
30
  <input
32
31
  v-if="second"
33
32
  class="input second"
34
- :value="value && value.second"
33
+ :value="modelValue?.second ?? null"
35
34
  placeholder="00"
36
35
  :disabled="disabled"
37
36
  @blur="updateSecond"
@@ -44,14 +43,13 @@
44
43
  </SInputBase>
45
44
  </template>
46
45
 
47
- <script lang="ts">
48
- import { PropType, defineComponent } from '@vue/composition-api'
46
+ <script setup lang="ts">
47
+ import { PropType } from 'vue'
49
48
  import { SyntheticInputEvent } from '../types/Utils'
50
- import { Validation } from '../validation/Validation'
49
+ import { Validatable } from '../composables/Validation'
51
50
  import SInputBase from './SInputBase.vue'
52
51
 
53
52
  type Size = 'mini' | 'small' | 'medium'
54
- type Mode = 'outlined'
55
53
 
56
54
  interface Value {
57
55
  hour?: string
@@ -67,120 +65,104 @@ export interface Fields {
67
65
  second?: boolean
68
66
  }
69
67
 
70
- export default defineComponent({
71
- components: {
72
- SInputBase
73
- },
74
-
75
- props: {
76
- size: { type: String as PropType<Size>, default: 'small' },
77
- mode: { type: String as PropType<Mode>, default: 'outlined' },
78
- name: { type: String, default: null },
79
- label: { type: String, default: null },
80
- note: { type: String, default: null },
81
- help: { type: String, default: null },
82
- placeholder: { type: String, default: null },
83
- hour: { type: Boolean, default: true },
84
- minute: { type: Boolean, default: true },
85
- second: { type: Boolean, default: true },
86
- disabled: { type: Boolean, default: false },
87
- errorMessage: { type: Boolean, default: true },
88
- value: { type: Object as PropType<Value>, default: null },
89
- validation: { type: Object as PropType<Validation>, default: null }
90
- },
91
-
92
- setup(props, { emit }) {
93
- const touched = {
94
- hour: false,
95
- minute: false,
96
- second: false
97
- }
68
+ const props = defineProps({
69
+ size: { type: String as PropType<Size>, default: 'small' },
70
+ label: { type: String, default: null },
71
+ note: { type: String, default: null },
72
+ help: { type: String, default: null },
73
+ placeholder: { type: String, default: null },
74
+ hour: { type: Boolean, default: true },
75
+ minute: { type: Boolean, default: true },
76
+ second: { type: Boolean, default: true },
77
+ disabled: { type: Boolean, default: false },
78
+ errorMessage: { type: Boolean, default: true },
79
+ modelValue: { type: Object as PropType<Value>, default: null },
80
+ validation: { type: Object as PropType<Validatable>, default: null }
81
+ })
98
82
 
99
- function updateHour(e: SyntheticInputEvent): void {
100
- const value = getValue(e.target.value)
83
+ const emit = defineEmits(['update:modelValue'])
101
84
 
102
- update('hour', value)
103
- }
85
+ const touched = {
86
+ hour: false,
87
+ minute: false,
88
+ second: false
89
+ }
104
90
 
105
- function updateMinute(e: SyntheticInputEvent): void {
106
- const value = getValue(e.target.value)
91
+ function updateHour(e: FocusEvent): void {
92
+ const value = getValue((e.target as HTMLInputElement).value)
107
93
 
108
- update('minute', value ? value.padStart(2, '0') : undefined)
109
- }
94
+ update('hour', value)
95
+ }
110
96
 
111
- function updateSecond(e: SyntheticInputEvent): void {
112
- const value = getValue(e.target.value)
97
+ function updateMinute(e: FocusEvent): void {
98
+ const value = getValue((e.target as HTMLInputElement).value)
113
99
 
114
- update('second', value ? value.padStart(2, '0') : undefined)
115
- }
100
+ update('minute', value ? value.padStart(2, '0') : undefined)
101
+ }
116
102
 
117
- function update(type: ValueType, value?: string): void {
118
- const data = { ...props.value } as Value
103
+ function updateSecond(e: FocusEvent): void {
104
+ const value = getValue((e.target as HTMLInputElement).value)
119
105
 
120
- setValue(data, type, value)
106
+ update('second', value ? value.padStart(2, '0') : undefined)
107
+ }
121
108
 
122
- data.hour === undefined && data.minute === undefined && data.second === undefined
123
- ? emit('input', null)
124
- : emit('input', data)
109
+ function update(type: ValueType, value?: string): void {
110
+ const data = { ...props.modelValue } as Value
125
111
 
126
- emitTouch(type)
127
- }
112
+ setValue(data, type, value)
128
113
 
129
- function getValue(value: string): string | undefined {
130
- if (value === '') {
131
- return undefined
132
- }
114
+ data.hour === undefined && data.minute === undefined && data.second === undefined
115
+ ? emit('update:modelValue', null)
116
+ : emit('update:modelValue', data)
133
117
 
134
- const input = Number(value)
118
+ emitTouch(type)
119
+ }
135
120
 
136
- return isNaN(input) ? undefined : String(input)
137
- }
121
+ function getValue(value: string): string | undefined {
122
+ if (value === '') {
123
+ return undefined
124
+ }
138
125
 
139
- function setValue(data: Value, type: ValueType, value?: string): void {
140
- if (value === undefined) {
141
- delete data[type]
142
- return
143
- }
126
+ const input = Number(value)
144
127
 
145
- data[type] = value
146
- }
128
+ return isNaN(input) ? undefined : String(input)
129
+ }
147
130
 
148
- function emitTouch(type: ValueType): void {
149
- if (!props.validation || props.validation.$isDirty.value) {
150
- return
151
- }
131
+ function setValue(data: Value, type: ValueType, value?: string): void {
132
+ if (value === undefined) {
133
+ delete data[type]
134
+ return
135
+ }
152
136
 
153
- touched[type] = true
137
+ data[type] = value
138
+ }
154
139
 
155
- if (createRequiredTouched().every(v => v)) {
156
- props.validation.$touch()
157
- }
158
- }
140
+ function emitTouch(type: ValueType): void {
141
+ if (!props.validation || props.validation.$dirty) {
142
+ return
143
+ }
159
144
 
160
- function createRequiredTouched(): boolean[] {
161
- const requiredTouched = [] as boolean[]
145
+ touched[type] = true
162
146
 
163
- for (const key in touched) {
164
- if ((props as any)[key]) {
165
- requiredTouched.push((touched as any)[key])
166
- }
167
- }
147
+ if (createRequiredTouched().every(v => v)) {
148
+ props.validation.$touch()
149
+ }
150
+ }
168
151
 
169
- return requiredTouched
170
- }
152
+ function createRequiredTouched(): boolean[] {
153
+ const requiredTouched = [] as boolean[]
171
154
 
172
- return {
173
- updateHour,
174
- updateMinute,
175
- updateSecond
155
+ for (const key in touched) {
156
+ if ((props as any)[key]) {
157
+ requiredTouched.push((touched as any)[key])
176
158
  }
177
159
  }
178
- })
160
+
161
+ return requiredTouched
162
+ }
179
163
  </script>
180
164
 
181
165
  <style lang="postcss" scoped>
182
- @import "@/assets/styles/variables";
183
-
184
166
  .SInputHMS.mini {
185
167
  .container {
186
168
  padding: 0 8px;
@@ -251,30 +233,18 @@ export default defineComponent({
251
233
  }
252
234
  }
253
235
 
254
- .SInputHMS.outlined {
255
- .container {
256
- border: 1px solid var(--input-outlined-border);
257
- border-radius: 4px;
258
- transition: border-color .25s;
259
-
260
- &:hover {
261
- border-color: var(--input-focus-border);
262
- }
236
+ .SInputHMS.disabled {
237
+ .container,
238
+ .input {
239
+ cursor: not-allowed;
263
240
  }
264
- }
265
241
 
266
- .SInputHMS.outlined.disabled {
267
242
  .container {
268
- border-color: var(--input-outlined-border);
269
- background-color: var(--input-outlined-bg-disabled);
243
+ border-color: var(--input-border);
244
+ background-color: var(--input-disabled-bg);
270
245
  }
271
246
  }
272
247
 
273
- .SInputHMS.disabled {
274
- .container { cursor: not-allowed; }
275
- .input { cursor: not-allowed; }
276
- }
277
-
278
248
  .SInputHMS.has-error {
279
249
  .container {
280
250
  border-color: var(--c-danger);
@@ -283,6 +253,13 @@ export default defineComponent({
283
253
 
284
254
  .container {
285
255
  display: inline-flex;
256
+ border: 1px solid var(--input-border);
257
+ border-radius: 4px;
258
+ transition: border-color .25s;
259
+
260
+ &:hover {
261
+ border-color: var(--input-focus-border);
262
+ }
286
263
  }
287
264
 
288
265
  .input {