@globalbrain/sefirot 0.70.1 → 2.0.0-draft.2

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 +4 -802
  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 +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 +1 -3
  38. package/lib/components/SSheetMedium.vue +13 -25
  39. package/lib/components/SSnackbar.vue +18 -28
  40. package/lib/components/icons/SIconSend.vue +5 -0
  41. package/lib/composables/Dialog.ts +9 -17
  42. package/lib/composables/Dropdown.ts +1 -1
  43. package/lib/composables/{Menu.ts → Flyout.ts} +11 -4
  44. package/lib/composables/Form.ts +42 -44
  45. package/lib/composables/Modal.ts +9 -9
  46. package/lib/composables/Snackbar.ts +18 -0
  47. package/lib/composables/Validation.ts +28 -0
  48. package/lib/mixins/Sheet.ts +3 -3
  49. package/lib/store/Sefirot.ts +8 -13
  50. package/lib/store/dialog/index.ts +20 -10
  51. package/lib/store/modal/index.ts +11 -13
  52. package/lib/store/snackbars/index.ts +3 -4
  53. package/lib/support/{Util.ts → Utils.ts} +0 -2
  54. package/lib/types/Utils.ts +0 -7
  55. package/lib/types/vue-shims.d.ts +7 -0
  56. package/lib/validation/rules/checked.ts +6 -10
  57. package/lib/validation/rules/fileExtension.ts +9 -9
  58. package/lib/validation/rules/hms.ts +9 -9
  59. package/lib/validation/rules/index.ts +10 -74
  60. package/lib/validation/rules/maxLength.ts +10 -9
  61. package/lib/validation/rules/minLength.ts +12 -0
  62. package/lib/validation/rules/required.ts +2 -10
  63. package/lib/validation/rules/requiredHms.ts +11 -0
  64. package/lib/validation/rules/requiredIf.ts +3 -11
  65. package/lib/validation/rules/requiredYmd.ts +11 -0
  66. package/lib/validation/rules/ymd.ts +11 -0
  67. package/lib/validation/validators/checked.ts +1 -1
  68. package/lib/validation/validators/fileExtension.ts +1 -1
  69. package/lib/validation/validators/hms.ts +5 -5
  70. package/lib/validation/validators/requiredHms.ts +17 -0
  71. package/lib/validation/validators/requiredYmd.ts +7 -0
  72. package/lib/validation/validators/ymd.ts +41 -0
  73. package/package.json +45 -50
  74. package/lib/components/SAction.vue +0 -37
  75. package/lib/components/SActionAvatar.vue +0 -25
  76. package/lib/components/SActionButton.vue +0 -40
  77. package/lib/components/SActionPill.vue +0 -35
  78. package/lib/components/SActionSwitch.vue +0 -37
  79. package/lib/components/SAlert.vue +0 -145
  80. package/lib/components/SButtonGroup.vue +0 -160
  81. package/lib/components/SCard.vue +0 -111
  82. package/lib/components/SCardFooter.vue +0 -74
  83. package/lib/components/SCardHeader.vue +0 -213
  84. package/lib/components/SGrid.vue +0 -237
  85. package/lib/components/SGridActionLink.vue +0 -53
  86. package/lib/components/SGridActionMulti.vue +0 -139
  87. package/lib/components/SGridActionSingle.vue +0 -64
  88. package/lib/components/SHeader.vue +0 -180
  89. package/lib/components/SInputCheckboxes.vue +0 -83
  90. package/lib/components/SInputDate.vue +0 -192
  91. package/lib/components/SInputDay.vue +0 -87
  92. package/lib/components/SInputMonth.vue +0 -86
  93. package/lib/components/SInputSelect.vue +0 -282
  94. package/lib/components/SInputSwitch.vue +0 -212
  95. package/lib/components/SInputSwitches.vue +0 -108
  96. package/lib/components/SInputTime.vue +0 -255
  97. package/lib/components/SInputYear.vue +0 -60
  98. package/lib/components/SMarkdown.vue +0 -56
  99. package/lib/components/SPlaceholderBlank.vue +0 -113
  100. package/lib/components/SPlaceholderImage.vue +0 -83
  101. package/lib/components/SPortalScreens.vue +0 -62
  102. package/lib/components/SProgressBar.vue +0 -89
  103. package/lib/components/SResponsive.vue +0 -46
  104. package/lib/components/SScreen.vue +0 -81
  105. package/lib/components/SStep.vue +0 -107
  106. package/lib/components/SSteps.vue +0 -75
  107. package/lib/components/STag.vue +0 -67
  108. package/lib/components/STooltip.vue +0 -134
  109. package/lib/components/SWindow.vue +0 -158
  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
@@ -2,536 +2,91 @@
2
2
  <SInputBase
3
3
  class="SInputText"
4
4
  :class="classes"
5
- :name="name"
6
5
  :label="label"
7
6
  :note="note"
8
7
  :help="help"
9
8
  :error-message="errorMessage"
10
9
  :validation="validation"
11
10
  >
12
- <div class="container">
13
- <div
14
- v-if="action"
15
- class="action"
16
- :class="{ clickable: !!action.clickable }"
17
- :role="action.clickable ? 'button' : null"
18
- @click="action.clickable && $emit('action')"
19
- >
20
- <component :is="action.icon" v-if="action.icon" class="action-icon" />
21
- <p v-if="action.text" class="action-text">{{ action.text }}</p>
22
- <div v-if="action.type === 'select'" class="action-select">
23
- <SIconChevronUp class="action-select-icon up" />
24
- <SIconChevronDown class="action-select-icon down" />
25
- </div>
26
- </div>
27
-
28
- <div class="box">
29
- <input
30
- :id="name"
31
- ref="inputEl"
32
- class="input-area"
33
- :class="inputAreaClasses"
34
- :style="inputStyles"
35
- :type="type"
36
- :step="step"
37
- :disabled="disabled"
38
- :value="value"
39
- :placeholder="placeholder"
40
- @input="emitInput"
41
- @blur="emitBlur"
42
- @keypress.enter="emitEnter"
43
- @keyup.down="$emit('down')"
44
- @keyup.escape="$emit('escape')"
45
- >
46
-
47
- <div
48
- class="input"
49
- :class="inputClasses"
50
- :style="inputStyles"
51
- >
52
- <span v-if="displayValue !== null || value !== null" class="value">
53
- {{ displayValue !== null ? displayValue : value }}
54
- </span>
55
- </div>
56
-
57
- <div v-if="icon" class="icon" role="button" @click="focus">
58
- <component :is="icon" class="icon-svg" />
59
- </div>
60
-
61
- <p v-if="text" ref="textEl" class="text" role="button" @click="focus">
62
- {{ text }}
63
- </p>
64
-
65
- <p v-if="textAfter" ref="textAfterEl" class="text-after" role="button" @click="focus">
66
- {{ textAfter }}
67
- </p>
68
-
69
- <button v-if="isClearable" class="clear" :class="{ show: showClearButton }" @click="emitClear">
70
- <SIconX class="clear-svg" />
71
- </button>
72
- </div>
73
- </div>
74
-
75
- <template #before-help>
76
- <slot name="before-help" />
77
- </template>
11
+ <input
12
+ class="input"
13
+ :type="type"
14
+ :placeholder="placeholder"
15
+ :disabled="disabled"
16
+ :value="modelValue"
17
+ @input="emitInput"
18
+ @blur="emitBlur"
19
+ >
78
20
  </SInputBase>
79
21
  </template>
80
22
 
81
- <script lang="ts">
82
- import {
83
- PropType,
84
- defineComponent,
85
- ref,
86
- reactive,
87
- computed,
88
- watch,
89
- onMounted
90
- } from '@vue/composition-api'
91
- import { Validation } from '../validation/Validation'
92
- import { SyntheticInputEvent } from '../types/Utils'
93
- import SIconChevronUp from './icons/SIconChevronUp.vue'
94
- import SIconChevronDown from './icons/SIconChevronDown.vue'
95
- import SIconX from './icons/SIconX.vue'
23
+ <script setup lang="ts">
24
+ import { PropType, computed } from 'vue'
25
+ import { Validation, Validatable } from '../composables/Validation'
96
26
  import SInputBase from './SInputBase.vue'
97
27
 
98
- export type Size = 'mini' | 'small' | 'medium'
99
- export type Mode = 'outlined' | 'filled'
100
- export type Align = 'left' | 'center' | 'right'
101
- export type Color = 'neutral' | 'info' | 'success' | 'warning' | 'danger'
102
- export type ColorCallback = (value: string | number) => Color
103
-
104
- export interface Action {
105
- type?: 'button' | 'select'
106
- icon?: any
107
- text?: string
108
- clickable?: boolean
109
- }
110
-
111
- export default defineComponent({
112
- components: {
113
- SIconChevronUp,
114
- SIconChevronDown,
115
- SIconX,
116
- SInputBase
117
- },
118
-
119
- props: {
120
- size: { type: String as PropType<Size>, default: 'small' },
121
- mode: { type: String as PropType<Mode>, default: 'outlined' },
122
- name: { type: String, default: null },
123
- label: { type: String, default: null },
124
- note: { type: String, default: null },
125
- help: { type: String, default: null },
126
- type: { type: String, default: 'text' },
127
- placeholder: { type: String, default: null },
128
- action: { type: Object as PropType<Action>, default: null },
129
- icon: { type: Object, default: null },
130
- align: { type: String as PropType<Align>, default: null },
131
- text: { type: String, default: null },
132
- textAfter: { type: String, default: null },
133
- color: { type: Function as PropType<ColorCallback>, default: null },
134
- step: { type: Number, default: 1 },
135
- clearable: { type: Boolean, default: false },
136
- disabled: { type: Boolean, default: false },
137
- errorMessage: { type: Boolean, default: true },
138
- displayValue: { type: String, default: null },
139
- value: { type: [String, Number], default: null },
140
- validation: { type: Object as PropType<Validation>, default: null }
141
- },
142
-
143
- setup(props, { emit }) {
144
- const inputEl = ref<HTMLElement | null>(null)
145
- const textEl = ref<HTMLElement | null>(null)
146
- const textAfterEl = ref<HTMLElement | null>(null)
147
- const color = computed(() => {
148
- return (props.value !== null && props.color) && props.color(props.value)
149
- })
150
-
151
- const classes = computed(() => [
152
- props.size,
153
- props.mode,
154
- { disabled: props.disabled }
155
- ])
156
-
157
- const inputStyles = reactive({
158
- textAlign: props.align,
159
- paddingRight: '',
160
- paddingLeft: ''
161
- })
162
-
163
- const isClearable = computed(() => props.clearable && !props.disabled)
164
-
165
- const inputClasses = computed(() => [
166
- color.value,
167
- { 'has-icon': props.icon },
168
- { 'is-clearable': isClearable.value }
169
- ])
170
-
171
- const inputAreaClasses = computed(() => ({
172
- 'has-icon': props.icon,
173
- 'is-clearable': isClearable.value
174
- }))
175
-
176
- const showClearButton = computed(() => {
177
- return props.value !== null && props.value !== ''
178
- })
179
-
180
- onMounted(() => {
181
- setTextPadding()
182
- watch(() => props.text, () => setTextPadding())
183
- watch(() => props.textAfter, () => setTextPadding())
184
- })
185
-
186
- function focus() {
187
- inputEl.value && inputEl.value.focus()
188
- }
189
-
190
- function blur() {
191
- inputEl.value && inputEl.value.blur()
192
- }
193
-
194
- function emitInput(e: SyntheticInputEvent) {
195
- emit('input', getValue(e.target.value))
196
- }
197
-
198
- function emitBlur(e: SyntheticInputEvent) {
199
- props.validation && props.validation.$touch()
200
- emit('blur', getValue(e.target.value))
201
- }
202
-
203
- function emitEnter(e: SyntheticInputEvent) {
204
- blur()
205
- emit('enter', getValue(e.target.value))
206
- }
28
+ type Size = 'mini' | 'small' | 'medium'
29
+
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
+ type: { type: String, default: 'text' },
36
+ placeholder: { type: String, default: null },
37
+ disabled: { type: Boolean, default: false },
38
+ errorMessage: { type: Boolean, default: true },
39
+ modelValue: { type: [String, Number] as PropType<string | number | null>, default: null },
40
+ validation: { type: Object as PropType<Validatable>, default: null }
41
+ })
207
42
 
208
- function getValue(value: string): string | number | null {
209
- if (props.type !== 'number') {
210
- return value
211
- }
43
+ const emit = defineEmits(['update:modelValue'])
212
44
 
213
- return value === '' ? null : Number(value)
214
- }
45
+ const classes = computed(() => [
46
+ props.size,
47
+ { disabled: props.disabled }
48
+ ])
215
49
 
216
- function emitClear() {
217
- emit('clear')
218
- }
219
-
220
- function setTextPadding(): void {
221
- textEl.value && setLeadingTextPadding()
222
- textAfterEl.value && setTrailingTextPadding()
223
- }
50
+ function emitInput(e: Event): void {
51
+ emit('update:modelValue', getValue(e))
52
+ }
224
53
 
225
- function setLeadingTextPadding(): void {
226
- inputStyles.paddingLeft = `${textEl.value!.offsetWidth}px`
227
- }
54
+ function emitBlur(e: FocusEvent): void {
55
+ props.validation?.$touch()
56
+ emit('update:modelValue', getValue(e))
57
+ }
228
58
 
229
- function setTrailingTextPadding(): void {
230
- inputStyles.paddingRight = `${textAfterEl.value!.offsetWidth}px`
231
- }
59
+ function getValue(e: Event | FocusEvent): string | null {
60
+ const value = (e.target as HTMLInputElement).value
232
61
 
233
- return {
234
- inputEl,
235
- textEl,
236
- textAfterEl,
237
- classes,
238
- inputStyles,
239
- inputClasses,
240
- inputAreaClasses,
241
- isClearable,
242
- showClearButton,
243
- focus,
244
- blur,
245
- emitInput,
246
- emitBlur,
247
- emitEnter,
248
- emitClear
249
- }
250
- }
251
- })
62
+ return value === '' ? null : value
63
+ }
252
64
  </script>
253
65
 
254
66
  <style lang="postcss" scoped>
255
- @import "@/assets/styles/variables";
256
-
257
67
  .SInputText.mini {
258
- .action {
259
- padding: 3px 10px;
260
- line-height: 24px;
261
- }
262
-
263
- .action-icon {
264
- width: 14px;
265
- height: 14px;
266
- }
267
-
268
- .action-icon + .action-text,
269
- .action-icon + .action-select,
270
- .action-text + .action-select {
271
- margin-left: 6px;
272
- }
273
-
274
- .action-text {
275
- font-size: 14px;
276
- }
277
-
278
- .input,
279
- .input-area {
68
+ .input {
280
69
  padding: 3px 12px;
281
- width: 100%;
282
- line-height: 24px;
283
- min-height: 32px;
284
70
  font-size: 14px;
285
-
286
- &.has-icon {
287
- padding-left: 30px;
288
- }
289
-
290
- &.is-clearable {
291
- padding-right: 40px;
292
- }
293
- }
294
-
295
- .icon {
296
- top: 9px;
297
- left: 10px;
298
- }
299
-
300
- .icon-svg {
301
- width: 14px;
302
- height: 14px;
303
- }
304
-
305
- .text {
306
- padding: 0 8px 0 12px;
307
- line-height: 32px;
308
- font-size: 14px;
309
- }
310
-
311
- .text-after {
312
- padding: 0 12px 0 8px;
313
- line-height: 32px;
314
- font-size: 14px;
315
- }
316
-
317
- .clear {
318
- top: 0;
319
- right: 0;
320
- width: 32px;
321
- height: 32px;
322
- }
323
-
324
- .clear-svg {
325
- width: 16px;
326
- height: 16px;
327
71
  }
328
72
  }
329
73
 
330
74
  .SInputText.small {
331
- .action {
332
- padding: 3px 10px;
333
- line-height: 24px;
334
- }
335
-
336
- .action-icon {
337
- width: 14px;
338
- height: 14px;
339
- }
340
-
341
- .action-icon + .action-text,
342
- .action-icon + .action-select,
343
- .action-text + .action-select {
344
- margin-left: 6px;
345
- }
346
-
347
- .action-text {
348
- font-size: 14px;
349
- }
350
-
351
- .input,
352
- .input-area {
75
+ .input {
353
76
  padding: 7px 12px;
354
- width: 100%;
355
- line-height: 24px;
356
- min-height: 40px;
357
- font-size: 16px;
358
-
359
- &.has-icon {
360
- padding-left: 36px;
361
- }
362
-
363
- &.is-clearable {
364
- padding-right: 40px;
365
- }
366
- }
367
-
368
- .icon {
369
- top: 12px;
370
- left: 12px;
371
- }
372
-
373
- .icon-svg {
374
- width: 15px;
375
- height: 15px;
376
- }
377
-
378
- .text {
379
- padding: 0 8px 0 12px;
380
- line-height: 40px;
381
77
  font-size: 16px;
382
78
  }
383
-
384
- .text-after {
385
- padding: 0 12px 0 8px;
386
- line-height: 32px;
387
- font-size: 14px;
388
- }
389
-
390
- .clear {
391
- top: 0;
392
- right: 0;
393
- width: 40px;
394
- height: 40px;
395
- }
396
-
397
- .clear-svg {
398
- width: 16px;
399
- height: 16px;
400
- }
401
79
  }
402
80
 
403
81
  .SInputText.medium {
404
- .action {
405
- padding: 11px 12px;
406
- line-height: 24px;
407
- }
408
-
409
- .action-icon {
410
- width: 16px;
411
- height: 16px;
412
- }
413
-
414
- .action-icon + .action-text,
415
- .action-icon + .action-select,
416
- .action-text + .action-select {
417
- margin-left: 8px;
418
- }
419
-
420
- .action-text {
421
- font-size: 14px;
422
- }
423
-
424
- .input,
425
- .input-area {
82
+ .input {
426
83
  padding: 11px 16px;
427
- width: 100%;
428
- min-height: 48px;
429
- line-height: 24px;
430
84
  font-size: 16px;
431
-
432
- &.has-icon {
433
- padding-left: 36px;
434
- }
435
-
436
- &.is-clearable {
437
- padding-right: 40px;
438
- }
439
- }
440
-
441
- .icon {
442
- top: 16px;
443
- left: 12px;
444
- }
445
-
446
- .icon-svg {
447
- width: 16px;
448
- height: 16px;
449
- }
450
-
451
- .text {
452
- padding: 0 8px 0 16px;
453
- line-height: 48px;
454
- }
455
-
456
- .text-after {
457
- padding: 0 16px 0 8px;
458
- line-height: 48px;
459
- }
460
-
461
- .clear {
462
- top: 4px;
463
- right: 4px;
464
- width: 40px;
465
- height: 40px;
466
- }
467
-
468
- .clear-svg {
469
- width: 16px;
470
- height: 16px;
471
- }
472
- }
473
-
474
- .SInputText.filled {
475
- .action {
476
- background-color: var(--input-action-filled-bg);
477
-
478
- &.clickable:hover { background-color: var(--input-action-filled-bg-hover); }
479
- &.clickable:active { background-color: var(--input-action-filled-bg-focus); }
480
- }
481
-
482
- .input {
483
- background-color: var(--input-filled-bg);
484
-
485
- &:focus {
486
- border-color: var(--input-focus-border);
487
- background-color: var(--input-filled-bg-focus);
488
- }
489
- }
490
-
491
- .input-area:focus + .input {
492
- border-color: var(--input-focus-border);
493
- background-color: var(--input-filled-bg-focus);
494
- }
495
-
496
- &.disabled .input {
497
- background-color: var(--input-filled-bg-disabled);
498
- }
499
- }
500
-
501
- .SInputText.outlined {
502
- .action {
503
- border-color: var(--input-action-outlined-border);
504
- background-color: var(--input-action-outlined-bg);
505
-
506
- &.clickable:hover { background-color: var(--input-action-outlined-bg-hover); }
507
- &.clickable:active { background-color: var(--input-action-outlined-bg-focus); }
508
- }
509
-
510
- .input {
511
- border-color: var(--input-outlined-border);
512
-
513
- &:focus {
514
- border-color: var(--input-focus-border);
515
- background-color: var(--input-focus-bg);
516
- }
517
- }
518
-
519
- .input-area:focus + .input {
520
- border-color: var(--input-focus-border);
521
- background-color: var(--input-filled-bg-focus);
522
- }
523
-
524
- &.disabled .box:hover .input {
525
- border-color: var(--input-outlined-border);
526
- }
527
-
528
- &.disabled .input {
529
- background-color: var(--input-outlined-bg-disabled);
530
85
  }
531
86
  }
532
87
 
533
88
  .SInputText.disabled {
534
- .box:hover .input {
89
+ .input {
535
90
  cursor: not-allowed;
536
91
  border-color: transparent;
537
92
  }
@@ -548,157 +103,28 @@ export default defineComponent({
548
103
  }
549
104
  }
550
105
 
551
- .container {
552
- display: flex;
553
- }
554
-
555
- .action {
556
- display: flex;
557
- align-items: center;
558
- flex-shrink: 0;
559
- border: 1px solid transparent;
560
- border-right: 0;
561
- border-radius: 4px 0 0 4px;
562
- color: var(--c-text-2);
563
- transition: background-color .25s;
564
- }
565
-
566
- .action.clickable {
567
- color: var(--c-text-1);
568
- }
569
-
570
- .action.clickable:active {
571
- transition: background-color .1s;
572
- }
573
-
574
- .action + .box .input {
575
- border-radius: 0 4px 4px 0;
576
- border-left-color: var(--c-divider);
577
- }
578
-
579
- .action-icon {
580
- fill: currentColor;
581
- }
582
-
583
- .action-text {
584
- margin: 0;
585
- font-weight: 500;
586
- }
587
-
588
- .action-select-icon {
589
- width: 13px;
590
- height: 13px;
591
- fill: var(--input-placeholder);
592
- }
593
-
594
- .action-select-icon.up {
595
- margin-bottom: -4px;
596
- }
597
-
598
- .box {
599
- position: relative;
600
- display: flex;
601
- flex-grow: 1;
602
- max-width: 100%;
603
-
604
- &:hover .input {
605
- border-color: var(--input-focus-border);
606
- }
607
- }
608
-
609
106
  .input {
610
107
  display: block;
611
- border: 1px solid transparent;
108
+ flex-grow: 1;
109
+ border: 1px solid var(--input-border);
612
110
  border-radius: 4px;
613
- color: var(--input-text);
111
+ width: 100%;
112
+ font-weight: 400;
113
+ background-color: transparent;
614
114
  transition: border-color .25s, background-color .25s;
615
- opacity: 1;
616
-
617
- .value {
618
- display: block;
619
- line-height: 24px;
620
- white-space: nowrap;
621
- overflow: hidden;
622
- }
623
- }
624
115
 
625
- .input-area {
626
- position: absolute;
627
- top: 0;
628
- left: 0;
629
- letter-spacing: .4px;
630
- background: transparent;
631
- border: 1px solid transparent;
632
- color: transparent;
633
-
634
- &:focus {
635
- color: var(--c-text-1);
116
+ &::placeholder {
117
+ font-weight: 500;
118
+ color: var(--input-placeholder);
636
119
  }
637
120
 
638
- &:focus + .input .value {
639
- opacity: 0;
640
- }
641
- }
642
-
643
- .input,
644
- .input-area {
645
- &.neutral { color: var(--c-black); }
646
- &.info { color: var(--c-info); }
647
- &.success { color: var(--c-success); }
648
- &.warning { color: var(--c-warning); }
649
- &.danger { color: var(--c-danger); }
650
- }
651
-
652
- .icon {
653
- position: absolute;
654
- cursor: text;
655
- }
656
-
657
- .icon-svg {
658
- display: block;
659
- fill: var(--input-placeholder);
660
- }
661
-
662
- .text,
663
- .text-after {
664
- position: absolute;
665
- top: 0;
666
- margin: 0;
667
- color: var(--input-text);
668
- cursor: text;
669
- }
670
-
671
- .text {
672
- left: 0;
673
- color: var(--input-text);
674
- }
675
-
676
- .text-after {
677
- right: 0;
678
- color: var(--input-placeholder);
679
- }
680
-
681
- .clear {
682
- position: absolute;
683
- display: flex;
684
- justify-content: center;
685
- align-items: center;
686
- opacity: 0;
687
- cursor: pointer;
688
- transition: opacity .25s;
689
-
690
- &:hover .clear-svg {
691
- fill: var(--input-text);
121
+ &:hover {
122
+ border-color: var(--input-hover-border);
692
123
  }
693
124
 
694
- &.show {
695
- opacity: 1;
125
+ &:focus {
126
+ border-color: var(--input-focus-border);
127
+ background-color: transparent;
696
128
  }
697
129
  }
698
-
699
- .clear-svg {
700
- display: block;
701
- fill: var(--input-placeholder);
702
- transition: fill .25s;
703
- }
704
130
  </style>