@globalbrain/sefirot 0.71.0 → 2.0.0-draft.3

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 (173) hide show
  1. package/CHANGELOG.md +6 -804
  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 +19 -35
  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 +23 -33
  24. package/lib/components/SInputRadios.vue +37 -47
  25. package/lib/components/SInputText.vue +72 -628
  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 +1 -3
  38. package/lib/components/SSheetMedium.vue +13 -25
  39. package/lib/components/SSnackbar.vue +18 -28
  40. package/lib/composables/Dialog.ts +9 -17
  41. package/lib/composables/Dropdown.ts +2 -2
  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 -83
  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 -282
  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/composables/Action.ts +0 -141
  110. package/lib/composables/Alert.ts +0 -50
  111. package/lib/composables/Card.ts +0 -46
  112. package/lib/composables/FormValidation.ts +0 -150
  113. package/lib/composables/Header.ts +0 -72
  114. package/lib/composables/InputDropdown.ts +0 -6
  115. package/lib/composables/Markdown.ts +0 -138
  116. package/lib/composables/Router.ts +0 -20
  117. package/lib/composables/Step.ts +0 -7
  118. package/lib/composables/Store.ts +0 -9
  119. package/lib/composables/Tag.ts +0 -32
  120. package/lib/composables/Tooltip.ts +0 -91
  121. package/lib/composables/Utils.ts +0 -115
  122. package/lib/composables/markdown/LinkPlugin.ts +0 -45
  123. package/lib/compositions/useForm.ts +0 -17
  124. package/lib/compositions/useResizeObserver.ts +0 -25
  125. package/lib/compositions/useTime.ts +0 -26
  126. package/lib/store/alert/index.ts +0 -32
  127. package/lib/store/screen/index.ts +0 -46
  128. package/lib/types/v-calendar.d.ts +0 -5
  129. package/lib/validation/Validation.ts +0 -151
  130. package/lib/validation/rules/day.ts +0 -11
  131. package/lib/validation/rules/email.ts +0 -11
  132. package/lib/validation/rules/every.ts +0 -38
  133. package/lib/validation/rules/include.ts +0 -11
  134. package/lib/validation/rules/includeSome.ts +0 -11
  135. package/lib/validation/rules/integer.ts +0 -11
  136. package/lib/validation/rules/maxValue.ts +0 -11
  137. package/lib/validation/rules/minValue.ts +0 -11
  138. package/lib/validation/rules/month.ts +0 -11
  139. package/lib/validation/rules/not.ts +0 -10
  140. package/lib/validation/rules/regex.ts +0 -11
  141. package/lib/validation/rules/requiredHMS.ts +0 -11
  142. package/lib/validation/rules/requiredMonthDate.ts +0 -11
  143. package/lib/validation/rules/requiredYearMonth.ts +0 -11
  144. package/lib/validation/rules/requiredYearMonthDate.ts +0 -11
  145. package/lib/validation/rules/rule.ts +0 -5
  146. package/lib/validation/rules/sameAs.ts +0 -11
  147. package/lib/validation/rules/url.ts +0 -11
  148. package/lib/validation/rules/validateIf.ts +0 -27
  149. package/lib/validation/rules/year.ts +0 -11
  150. package/lib/validation/rules/yearMonth.ts +0 -11
  151. package/lib/validation/rules/yearMonthDate.ts +0 -11
  152. package/lib/validation/validators/day.ts +0 -29
  153. package/lib/validation/validators/email.ts +0 -5
  154. package/lib/validation/validators/include.ts +0 -5
  155. package/lib/validation/validators/includeSome.ts +0 -5
  156. package/lib/validation/validators/index.ts +0 -51
  157. package/lib/validation/validators/integer.ts +0 -6
  158. package/lib/validation/validators/maxLength.ts +0 -3
  159. package/lib/validation/validators/maxValue.ts +0 -3
  160. package/lib/validation/validators/minValue.ts +0 -3
  161. package/lib/validation/validators/month.ts +0 -3
  162. package/lib/validation/validators/monthDate.ts +0 -20
  163. package/lib/validation/validators/regex.ts +0 -3
  164. package/lib/validation/validators/required.ts +0 -27
  165. package/lib/validation/validators/requiredHMS.ts +0 -17
  166. package/lib/validation/validators/requiredMonthDate.ts +0 -8
  167. package/lib/validation/validators/requiredYearMonth.ts +0 -8
  168. package/lib/validation/validators/requiredYearMonthDate.ts +0 -9
  169. package/lib/validation/validators/sameAs.ts +0 -5
  170. package/lib/validation/validators/url.ts +0 -5
  171. package/lib/validation/validators/year.ts +0 -3
  172. package/lib/validation/validators/yearMonth.ts +0 -20
  173. package/lib/validation/validators/yearMonthDate.ts +0 -21
@@ -2,85 +2,62 @@
2
2
  <SInputBase
3
3
  class="SInputTextarea"
4
4
  :class="classes"
5
- :name="name"
6
5
  :label="label"
7
6
  :note="note"
8
7
  :help="help"
8
+ :error-message="errorMessage"
9
9
  :validation="validation"
10
10
  >
11
- <div class="container">
12
- <textarea
13
- :id="name"
14
- class="input"
15
- :placeholder="placeholder"
16
- :disabled="disabled"
17
- :value="value"
18
- :rows="rows"
19
- @input="emitInput"
20
- @blur="emitBlur"
21
- />
22
- </div>
11
+ <textarea
12
+ class="input"
13
+ :placeholder="placeholder"
14
+ :rows="rows"
15
+ :disabled="disabled"
16
+ :value="modelValue ?? undefined"
17
+ @input="emitInput"
18
+ @blur="emitBlur"
19
+ />
23
20
  </SInputBase>
24
21
  </template>
25
22
 
26
- <script lang="ts">
27
- import { PropType, defineComponent, computed } from '@vue/composition-api'
28
- import { SyntheticInputEvent } from '../types/Utils'
29
- import { Validation } from '../validation/Validation'
23
+ <script setup lang="ts">
24
+ import { PropType, computed } from 'vue'
25
+ import { Validatable } from '../composables/Validation'
30
26
  import SInputBase from './SInputBase.vue'
31
27
 
32
28
  type Size = 'mini' | 'small' | 'medium'
33
- type Mode = 'filled' | 'outlined' | 'clear'
34
-
35
- export default defineComponent({
36
- components: {
37
- SInputBase
38
- },
39
-
40
- props: {
41
- size: { type: String as PropType<Size>, default: 'medium' },
42
- mode: { type: String as PropType<Mode>, default: 'filled' },
43
- name: { type: String, default: null },
44
- label: { type: String, default: null },
45
- note: { type: String, default: null },
46
- help: { type: String, default: null },
47
- placeholder: { type: String, default: null },
48
- disabled: { type: Boolean, default: false },
49
- rows: { type: Number, default: 3 },
50
- value: { type: [String, Number], default: null },
51
- validation: { type: Object as PropType<Validation>, default: null }
52
- },
53
-
54
- setup(props, { emit }) {
55
- const classes = computed(() => [
56
- props.size,
57
- props.mode,
58
- {
59
- disabled: props.disabled
60
- }
61
- ])
62
-
63
- function emitInput(e: SyntheticInputEvent): void {
64
- emit('input', e.target.value)
65
- }
66
-
67
- function emitBlur(e: SyntheticInputEvent): void {
68
- props.validation && props.validation.$touch()
69
- emit('blur', e.target.value)
70
- }
71
29
 
72
- return {
73
- classes,
74
- emitInput,
75
- emitBlur
76
- }
77
- }
30
+ const props = defineProps({
31
+ size: { type: String as PropType<Size>, default: 'small' },
32
+ label: { type: String, default: null },
33
+ note: { type: String, default: null },
34
+ help: { type: String, default: null },
35
+ placeholder: { type: String, default: null },
36
+ disabled: { type: Boolean, default: false },
37
+ rows: { type: Number, default: 3 },
38
+ errorMessage: { type: Boolean, default: true },
39
+ modelValue: { type: String as PropType<string | null>, default: null },
40
+ validation: { type: Object as PropType<Validatable>, default: null }
78
41
  })
42
+
43
+ const emit = defineEmits(['update:modelValue'])
44
+
45
+ const classes = computed(() => [
46
+ props.size,
47
+ { disabled: props.disabled }
48
+ ])
49
+
50
+ function emitInput(e: Event): void {
51
+ emit('update:modelValue', (e.target as HTMLInputElement).value)
52
+ }
53
+
54
+ function emitBlur(e: FocusEvent): void {
55
+ props.validation?.$touch()
56
+ emit('update:modelValue', (e.target as HTMLInputElement).value)
57
+ }
79
58
  </script>
80
59
 
81
60
  <style lang="postcss" scoped>
82
- @import "@/assets/styles/variables";
83
-
84
61
  .SInputTextarea.mini {
85
62
  .input {
86
63
  padding: 6px 12px;
@@ -111,58 +88,11 @@ export default defineComponent({
111
88
  }
112
89
  }
113
90
 
114
- .SInputTextarea.filled {
115
- .input {
116
- background-color: var(--input-filled-bg);
117
-
118
- &:focus {
119
- border-color: var(--input-focus-border);
120
- background-color: var(--input-focus-bg);
121
- }
122
- }
123
-
124
- &.disabled .input {
125
- background-color: var(--input-filled-bg-disabled);
126
- }
127
- }
128
-
129
- .SInputTextarea.outlined {
130
- .input {
131
- border-color: var(--input-outlined-border);
132
- background-color: transparent;
133
-
134
- &:hover {
135
- border-color: var(--input-focus-border);
136
- }
137
-
138
- &:focus {
139
- border-color: var(--input-focus-border);
140
- }
141
- }
142
-
143
- &.disabled .input:hover {
144
- border-color: var(--input-outlined-border);
145
- }
146
-
147
- &.disabled .input {
148
- background-color: var(--input-outlined-bg-disabled);
149
- }
150
- }
151
-
152
- .SInputTextarea.clear {
153
- .input {
154
- padding: 0;
155
- }
156
-
157
- &.disabled .input {
158
- background-color: var(--input-clear-bg-disabled);
159
- }
160
- }
161
-
162
91
  .SInputTextarea.disabled {
92
+ .input,
163
93
  .input:hover {
94
+ background-color: var(--input-disabled-bg);
164
95
  cursor: not-allowed;
165
- border-color: transparent;
166
96
  }
167
97
  }
168
98
 
@@ -180,14 +110,25 @@ export default defineComponent({
180
110
  .input {
181
111
  display: block;
182
112
  flex-grow: 1;
183
- border: 1px solid transparent;
113
+ border: 1px solid var(--input-border);
184
114
  border-radius: 4px;
185
115
  width: 100%;
186
116
  font-weight: 400;
117
+ background-color: transparent;
187
118
  transition: border-color .25s, background-color .25s;
188
119
 
189
120
  &::placeholder {
121
+ font-weight: 500;
190
122
  color: var(--input-placeholder);
191
123
  }
124
+
125
+ &:hover {
126
+ border-color: var(--input-hover-border);
127
+ }
128
+
129
+ &:focus {
130
+ border-color: var(--input-focus-border);
131
+ background-color: transparent;
132
+ }
192
133
  }
193
134
  </style>
@@ -1,8 +1,7 @@
1
1
  <template>
2
2
  <SInputBase
3
3
  class="SInputYMD"
4
- :class="[size, mode, { disabled }]"
5
- :name="name"
4
+ :class="[size, { disabled }]"
6
5
  :label="label"
7
6
  :note="note"
8
7
  :help="help"
@@ -14,7 +13,7 @@
14
13
  v-if="year"
15
14
  class="input year"
16
15
  type="number"
17
- :value="value && value.year"
16
+ :value="modelValue?.year"
18
17
  placeholder="YYYY"
19
18
  :disabled="disabled"
20
19
  @blur="updateYear"
@@ -27,7 +26,7 @@
27
26
  v-if="month"
28
27
  class="input month"
29
28
  type="number"
30
- :value="value && value.month"
29
+ :value="modelValue?.month"
31
30
  placeholder="M"
32
31
  :disabled="disabled"
33
32
  @blur="updateMonth"
@@ -40,143 +39,120 @@
40
39
  v-if="date"
41
40
  class="input date"
42
41
  type="number"
43
- :value="value && value.date"
42
+ :value="modelValue?.date"
44
43
  placeholder="D"
45
44
  :disabled="disabled"
46
45
  @blur="updateDate"
47
46
  >
48
47
  </div>
49
-
50
- <template #before-help>
51
- <slot name="before-help" />
52
- </template>
53
48
  </SInputBase>
54
49
  </template>
55
50
 
56
- <script lang="ts">
57
- import { PropType, defineComponent } from '@vue/composition-api'
58
- import { SyntheticInputEvent } from '../types/Utils'
59
- import { Validation } from '../validation/Validation'
51
+ <script setup lang="ts">
52
+ import { PropType } from 'vue'
53
+ import { Validatable } from '../composables/Validation'
60
54
  import SInputBase from './SInputBase.vue'
61
55
 
62
- export type Size = 'mini' | 'small' | 'medium'
63
- export type Mode = 'outlined'
56
+ type Size = 'mini' | 'small' | 'medium'
64
57
 
65
- export interface Value {
58
+ interface Value {
66
59
  year?: number
67
60
  month?: number
68
61
  date?: number
69
62
  }
70
63
 
71
- export type ValueType = 'year' | 'month' | 'date'
64
+ type ValueType = 'year' | 'month' | 'date'
72
65
 
73
- export interface Fields {
66
+ interface Fields {
74
67
  year?: boolean
75
68
  month?: boolean
76
69
  date?: boolean
77
70
  }
78
71
 
79
- export default defineComponent({
80
- components: {
81
- SInputBase
82
- },
83
-
84
- props: {
85
- size: { type: String as PropType<Size>, default: 'medium' },
86
- mode: { type: String as PropType<Mode>, default: 'outlined' },
87
- name: { type: String, default: null },
88
- label: { type: String, default: null },
89
- note: { type: String, default: null },
90
- help: { type: String, default: null },
91
- placeholder: { type: String, default: null },
92
- year: { type: Boolean, default: true },
93
- month: { type: Boolean, default: true },
94
- date: { type: Boolean, default: true },
95
- disabled: { type: Boolean, default: false },
96
- errorMessage: { type: Boolean, default: true },
97
- value: { type: Object as PropType<Value>, default: null },
98
- validation: { type: Object as PropType<Validation>, default: null }
99
- },
100
-
101
- setup(props, { emit }) {
102
- const touched = {
103
- year: false,
104
- month: false,
105
- date: false
106
- }
72
+ const props = defineProps({
73
+ size: { type: String as PropType<Size>, default: 'small' },
74
+ label: { type: String, default: null },
75
+ note: { type: String, default: null },
76
+ help: { type: String, default: null },
77
+ year: { type: Boolean, default: true },
78
+ month: { type: Boolean, default: true },
79
+ date: { type: Boolean, default: true },
80
+ disabled: { type: Boolean, default: false },
81
+ errorMessage: { type: Boolean, default: true },
82
+ modelValue: { type: Object as PropType<Value>, default: null },
83
+ validation: { type: Object as PropType<Validatable>, default: null }
84
+ })
107
85
 
108
- function updateYear(e: SyntheticInputEvent): void {
109
- const value = Number(e.target.value)
110
- update('year', value === 0 ? undefined : value)
111
- }
86
+ const emit = defineEmits(['update:modelValue'])
112
87
 
113
- function updateMonth(e: SyntheticInputEvent): void {
114
- const value = Number(e.target.value)
115
- update('month', value === 0 ? undefined : value)
116
- }
88
+ const touched = {
89
+ year: false,
90
+ month: false,
91
+ date: false
92
+ }
117
93
 
118
- function updateDate(e: SyntheticInputEvent): void {
119
- const value = Number(e.target.value)
120
- update('date', value === 0 ? undefined : value)
121
- }
94
+ function updateYear(e: FocusEvent): void {
95
+ const value = Number((e.target as HTMLInputElement).value)
96
+ update('year', value === 0 ? undefined : value)
97
+ }
122
98
 
123
- function update(type: ValueType, value?: number): void {
124
- const data = { ...props.value } as Value
99
+ function updateMonth(e: FocusEvent): void {
100
+ const value = Number((e.target as HTMLInputElement).value)
101
+ update('month', value === 0 ? undefined : value)
102
+ }
125
103
 
126
- setValue(data, type, value)
104
+ function updateDate(e: FocusEvent): void {
105
+ const value = Number((e.target as HTMLInputElement).value)
106
+ update('date', value === 0 ? undefined : value)
107
+ }
127
108
 
128
- data.year === undefined && data.month === undefined && data.date === undefined
129
- ? emit('input', null)
130
- : emit('input', data)
109
+ function update(type: ValueType, value?: number): void {
110
+ const data = { ...props.modelValue } as Value
131
111
 
132
- emitTouch(type)
133
- }
112
+ setValue(data, type, value)
134
113
 
135
- function setValue(data: Value, type: ValueType, value?: number): void {
136
- if (value === undefined) {
137
- delete data[type]
138
- return
139
- }
114
+ data.year === undefined && data.month === undefined && data.date === undefined
115
+ ? emit('update:modelValue', null)
116
+ : emit('update:modelValue', data)
140
117
 
141
- data[type] = value
142
- }
118
+ emitTouch(type)
119
+ }
143
120
 
144
- function emitTouch(type: ValueType): void {
145
- if (!props.validation || props.validation.$isDirty.value) {
146
- return
147
- }
121
+ function setValue(data: Value, type: ValueType, value?: number): void {
122
+ if (value === undefined) {
123
+ delete data[type]
124
+ return
125
+ }
148
126
 
149
- touched[type] = true
127
+ data[type] = value
128
+ }
150
129
 
151
- if (createRequiredTouched().every(v => v)) {
152
- props.validation.$touch()
153
- }
154
- }
130
+ function emitTouch(type: ValueType): void {
131
+ if (!props.validation || props.validation.$dirty) {
132
+ return
133
+ }
155
134
 
156
- function createRequiredTouched(): boolean[] {
157
- const requiredTouched = [] as boolean[]
135
+ touched[type] = true
158
136
 
159
- for (const key in touched) {
160
- if ((props as any)[key]) {
161
- requiredTouched.push((touched as any)[key])
162
- }
163
- }
137
+ if (createRequiredTouched().every(v => v)) {
138
+ props.validation.$touch()
139
+ }
140
+ }
164
141
 
165
- return requiredTouched
166
- }
142
+ function createRequiredTouched(): boolean[] {
143
+ const requiredTouched = [] as boolean[]
167
144
 
168
- return {
169
- updateYear,
170
- updateMonth,
171
- updateDate
145
+ for (const key in touched) {
146
+ if ((props as any)[key]) {
147
+ requiredTouched.push((touched as any)[key])
172
148
  }
173
149
  }
174
- })
150
+
151
+ return requiredTouched
152
+ }
175
153
  </script>
176
154
 
177
155
  <style lang="postcss" scoped>
178
- @import "@/assets/styles/variables";
179
-
180
156
  .SInputYMD.mini {
181
157
  .container {
182
158
  padding: 0 4px;
@@ -211,8 +187,8 @@ export default defineComponent({
211
187
  }
212
188
 
213
189
  .input.year { width: 56px; }
214
- .input.month { width: 32px; }
215
- .input.date { width: 32px; }
190
+ .input.month { width: 40px; }
191
+ .input.date { width: 40px; }
216
192
 
217
193
  .separator {
218
194
  padding: 7px 0;
@@ -233,8 +209,8 @@ export default defineComponent({
233
209
  }
234
210
 
235
211
  .input.year { width: 56px; }
236
- .input.month { width: 32px; }
237
- .input.date { width: 32px; }
212
+ .input.month { width: 40px; }
213
+ .input.date { width: 40px; }
238
214
 
239
215
  .separator {
240
216
  padding: 11px 0;
@@ -263,8 +239,14 @@ export default defineComponent({
263
239
  }
264
240
 
265
241
  .SInputYMD.disabled {
266
- .container { cursor: not-allowed; }
267
- .input { cursor: not-allowed; }
242
+ .container,
243
+ .input {
244
+ cursor: not-allowed;
245
+ }
246
+
247
+ .container {
248
+ background-color: var(--input-disabled-bg);
249
+ }
268
250
  }
269
251
 
270
252
  .SInputYMD.has-error {
@@ -274,7 +256,14 @@ export default defineComponent({
274
256
  }
275
257
 
276
258
  .container {
277
- display: flex;
259
+ display: inline-flex;
260
+ border: 1px solid var(--input-border);
261
+ border-radius: 4px;
262
+ transition: border-color .25s;
263
+
264
+ &:hover {
265
+ border-color: var(--input-focus-border);
266
+ }
278
267
  }
279
268
 
280
269
  .input {
@@ -8,65 +8,29 @@
8
8
  :target="target"
9
9
  :rel="rel"
10
10
  >
11
- <slot /><SIconExternalLink v-if="showExternal" class="SLink-icon" />
11
+ <slot />
12
12
  </component>
13
13
  </template>
14
14
 
15
- <script lang="ts">
16
- import { defineComponent, computed } from '@vue/composition-api'
17
- import SIconExternalLink from './icons/SIconExternalLink.vue'
15
+ <script setup lang="ts">
16
+ import { computed } from 'vue'
18
17
 
19
- const OUTBOUND_REGEX = /^[a-z]+:/i
20
-
21
- export default defineComponent({
22
- components: {
23
- SIconExternalLink
24
- },
25
-
26
- props: {
27
- href: { type: String, default: null },
28
- icon: { type: Boolean, default: false }
29
- },
30
-
31
- setup(props) {
32
- const isExternal = computed(() => OUTBOUND_REGEX.test(props.href))
33
-
34
- const component = computed(() => {
35
- if (!props.href) {
36
- return 'span'
37
- }
38
-
39
- return isExternal.value ? 'a' : 'nuxt-link'
40
- })
18
+ const props = defineProps({
19
+ href: { type: String, default: null }
20
+ })
41
21
 
42
- const target = computed(() => isExternal.value ? '_blank' : null)
43
- const rel = computed(() => isExternal.value ? 'noopener noreferrer' : null)
22
+ const OUTBOUND_REGEX = /^[a-z]+:/i
44
23
 
45
- const showExternal = computed(() => isExternal.value && props.icon)
24
+ const isExternal = computed(() => OUTBOUND_REGEX.test(props.href))
46
25
 
47
- return {
48
- component,
49
- target,
50
- rel,
51
- showExternal
52
- }
26
+ const component = computed(() => {
27
+ if (!props.href) {
28
+ return 'span'
53
29
  }
54
- })
55
- </script>
56
30
 
57
- <style lang="postcss" scoped>
58
- @import "@/assets/styles/variables";
59
-
60
- .SLink {
61
- display: inline-flex;
62
- align-items: center;
63
- }
31
+ return isExternal.value ? 'a' : 'router-link'
32
+ })
64
33
 
65
- .SLink-icon {
66
- display: inline-block;
67
- margin-left: .3em;
68
- width: 1em;
69
- height: 1em;
70
- fill: currentColor;
71
- }
72
- </style>
34
+ const target = computed(() => isExternal.value ? '_blank' : null)
35
+ const rel = computed(() => isExternal.value ? 'noopener noreferrer' : null)
36
+ </script>