Skip to content

Commit d80773c

Browse files
committed
wip
1 parent c5a6c26 commit d80773c

17 files changed

Lines changed: 27 additions & 19 deletions

docs/components/control.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ A helper component that creates `<SInputText>` component with a magnifying glass
299299
```ts
300300
interface Props {
301301
placeholder?: string
302-
unitAfter?: any
302+
unitAfter?: Component | string
303303
textColor?: TextColor | ((value: string | null) => TextColor)
304304
align?: Align
305305
disabled?: boolean

eslint.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ export default defineConfig([
1212
rules: {
1313
'antfu/consistent-list-newline': 'off',
1414
'vue/no-template-shadow': 'off',
15+
'vue/no-unused-properties': 'warn',
1516
'no-console': 'warn',
1617
'no-new-wrappers': 'off', // unicorn/new-for-builtins already handles this
1718
'unused-imports/no-unused-imports': 'warn',

lib/components/SControlInputSearch.vue

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
<script setup lang="ts">
22
import IconMagnifyingGlass from '~icons/ph/magnifying-glass-bold'
3-
import { computed } from 'vue'
3+
import { type Component, computed } from 'vue'
44
import { useControlSize } from '../composables/Control'
55
import { useTrans } from '../composables/Lang'
66
import { type Validatable } from '../composables/Validation'
77
import SInputText, { type Align, type TextColor } from './SInputText.vue'
88
99
const props = defineProps<{
1010
placeholder?: string
11-
unitAfter?: any
11+
unitAfter?: Component | string
1212
textColor?: TextColor | ((value: string | null) => TextColor)
1313
align?: Align
1414
disabled?: boolean
@@ -52,7 +52,12 @@ const _value = computed(() => {
5252
type="search"
5353
:placeholder="placeholder ?? t.placeholder"
5454
:unit-before="IconMagnifyingGlass"
55+
:unit-after
56+
:text-color
57+
:align
58+
:disabled
5559
:model-value="_value"
60+
:display-value
5661
:validation
5762
hide-error
5863
@update:model-value="$emit('update:model-value', $event)"

lib/components/SInputAddon.vue

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const props = withDefaults(defineProps<{
1414
clickable?: boolean
1515
dropdown?: DropdownSection[]
1616
dropdownCaret?: boolean
17-
dropdowpPosition?: 'top' | 'bottom'
17+
dropdownPosition?: 'top' | 'bottom'
1818
disabled?: boolean
1919
}>(), {
2020
clickable: true,
@@ -41,7 +41,10 @@ const selectedOptionLabel = computed(() => {
4141
})
4242
4343
const { isOpen, open } = useFlyout(container)
44-
const { position, update: updatePosition } = useManualDropdownPosition(container)
44+
const { position, update: updatePosition } = useManualDropdownPosition(
45+
container,
46+
() => props.dropdownPosition
47+
)
4548
4649
function onFocus() {
4750
if (!props.disabled) {

lib/components/SInputCheckbox.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ function onClick() {
7070
:check-text
7171
:check-color
7272
:validation
73+
:hide-error
7374
>
7475
<div class="container">
7576
<div

lib/components/SInputCheckboxes.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,8 @@ function onChange(value: Value): void {
7979
:check-icon
8080
:check-text
8181
:check-color
82+
:validation
83+
:hide-error
8284
>
8385
<div class="container">
8486
<div class="row">

lib/components/SInputNumber.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<script setup lang="ts">
2-
import { computed } from 'vue'
2+
import { type Component, computed } from 'vue'
33
import { type Props as BaseProps } from './SInputBase.vue'
44
import SInputText from './SInputText.vue'
55
66
export interface Props extends BaseProps {
77
placeholder?: string
8-
unitBefore?: any
9-
unitAfter?: any
8+
unitBefore?: Component | string
9+
unitAfter?: Component | string
1010
textColor?: TextColor | ((value: number | null) => TextColor)
1111
separator?: boolean
1212
align?: Align

lib/components/SInputRadio.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ function onClick() {
4545
class="SInputRadio"
4646
:class="classes"
4747
:size
48+
:name
4849
:label
4950
:note
5051
:info

lib/components/SInputRadios.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ function onChange(value: ValueType) {
8888
class="SInputRadios"
8989
:class="[size ?? 'small']"
9090
:size
91+
:name
9192
:label
9293
:note
9394
:info

lib/components/SInputSegments.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ function onSelect(value: T) {
5858
class="SInputSegments"
5959
:class="[size ?? 'small', { block }]"
6060
:size
61+
:name
6162
:label
6263
:note
6364
:info
@@ -74,7 +75,6 @@ function onSelect(value: T) {
7475
:key="i"
7576
:size="size ?? 'small'"
7677
:label="option.label"
77-
:value="option.value"
7878
:mode="option.mode ?? 'default'"
7979
:active="_value === option.value"
8080
:disabled="disabled ? true : (option.disabled ?? false)"

0 commit comments

Comments
 (0)