@flux-ui/components 3.0.0 → 3.1.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.
- package/dist/component/FluxBreadcrumb.vue.d.ts +15 -0
- package/dist/component/FluxBreadcrumbItem.vue.d.ts +23 -0
- package/dist/component/{FluxCheckbox.vue.d.ts → FluxFormCheckbox.vue.d.ts} +3 -0
- package/dist/component/FluxFormCheckboxGroup.vue.d.ts +26 -0
- package/dist/component/FluxFormField.vue.d.ts +1 -0
- package/dist/component/FluxFormNumberInput.vue.d.ts +26 -0
- package/dist/component/FluxFormRadio.vue.d.ts +18 -0
- package/dist/component/FluxFormRadioGroup.vue.d.ts +27 -0
- package/dist/component/FluxSkeleton.vue.d.ts +9 -0
- package/dist/component/index.d.ts +8 -1
- package/dist/composable/index.d.ts +2 -0
- package/dist/composable/useFormCheckboxGroupInjection.d.ts +2 -0
- package/dist/composable/useFormFieldInjection.d.ts +3 -2
- package/dist/composable/useFormRadioGroupInjection.d.ts +2 -0
- package/dist/data/di.d.ts +23 -0
- package/dist/index.css +1374 -1012
- package/dist/index.js +893 -399
- package/dist/index.js.map +1 -1
- package/package.json +9 -9
- package/src/component/FluxBreadcrumb.vue +24 -0
- package/src/component/FluxBreadcrumbItem.vue +72 -0
- package/src/component/FluxDataTable.vue +3 -3
- package/src/component/FluxFormCheckbox.vue +123 -0
- package/src/component/FluxFormCheckboxGroup.vue +57 -0
- package/src/component/FluxFormField.vue +23 -7
- package/src/component/FluxFormNumberInput.vue +180 -0
- package/src/component/FluxFormPinInput.vue +2 -2
- package/src/component/FluxFormRadio.vue +76 -0
- package/src/component/FluxFormRadioGroup.vue +53 -0
- package/src/component/FluxQuantitySelector.vue +4 -4
- package/src/component/FluxSkeleton.vue +46 -0
- package/src/component/FluxToggle.vue +4 -4
- package/src/component/index.ts +8 -1
- package/src/composable/index.ts +2 -0
- package/src/composable/useFormCheckboxGroupInjection.ts +6 -0
- package/src/composable/useFormFieldInjection.ts +7 -3
- package/src/composable/useFormRadioGroupInjection.ts +13 -0
- package/src/css/component/BorderBeam.module.scss +51 -22
- package/src/css/component/Breadcrumb.module.scss +86 -0
- package/src/css/component/Divider.module.scss +1 -0
- package/src/css/component/Form.module.scss +251 -45
- package/src/css/component/SegmentedControl.module.scss +18 -18
- package/src/css/component/Skeleton.module.scss +67 -0
- package/src/data/di.ts +30 -0
- package/src/component/FluxCheckbox.vue +0 -87
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<label
|
|
3
|
-
:class="clsx(
|
|
4
|
-
$style.checkbox,
|
|
5
|
-
disabled && $style.isDisabled,
|
|
6
|
-
isReadonly && $style.isReadonly,
|
|
7
|
-
error && $style.isInvalid
|
|
8
|
-
)"
|
|
9
|
-
:for="id">
|
|
10
|
-
<input
|
|
11
|
-
v-model="modelValue"
|
|
12
|
-
ref="input"
|
|
13
|
-
type="checkbox"
|
|
14
|
-
:class="$style.checkboxNative"
|
|
15
|
-
:id="id"
|
|
16
|
-
:disabled="disabled"
|
|
17
|
-
:aria-disabled="disabled ? true : undefined"
|
|
18
|
-
:aria-readonly="isReadonly ? true : undefined"
|
|
19
|
-
:aria-invalid="error ? true : undefined"
|
|
20
|
-
@click="onClick"/>
|
|
21
|
-
|
|
22
|
-
<button
|
|
23
|
-
aria-hidden="true"
|
|
24
|
-
:class="$style.checkboxElement"
|
|
25
|
-
tabindex="-1">
|
|
26
|
-
<FluxIcon
|
|
27
|
-
v-if="isIndeterminate"
|
|
28
|
-
name="minus"
|
|
29
|
-
:size="12"/>
|
|
30
|
-
|
|
31
|
-
<FluxIcon
|
|
32
|
-
v-else
|
|
33
|
-
name="check"
|
|
34
|
-
:size="12"/>
|
|
35
|
-
</button>
|
|
36
|
-
|
|
37
|
-
<span
|
|
38
|
-
v-if="label"
|
|
39
|
-
:class="$style.checkboxLabel">
|
|
40
|
-
{{ label }}
|
|
41
|
-
</span>
|
|
42
|
-
</label>
|
|
43
|
-
</template>
|
|
44
|
-
|
|
45
|
-
<script
|
|
46
|
-
lang="ts"
|
|
47
|
-
setup>
|
|
48
|
-
import type { FluxFormInputBaseProps } from '@flux-ui/types';
|
|
49
|
-
import { clsx } from 'clsx';
|
|
50
|
-
import { computed, toRef, unref, useTemplateRef, watchEffect } from 'vue';
|
|
51
|
-
import { useDisabled, useFormFieldInjection } from '~flux/components/composable';
|
|
52
|
-
import FluxIcon from './FluxIcon.vue';
|
|
53
|
-
import $style from '~flux/components/css/component/Form.module.scss';
|
|
54
|
-
|
|
55
|
-
const modelValue = defineModel<boolean | null>({
|
|
56
|
-
default: false
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
const {
|
|
60
|
-
disabled: componentDisabled,
|
|
61
|
-
isReadonly
|
|
62
|
-
} = defineProps<Pick<FluxFormInputBaseProps, 'disabled' | 'error' | 'isReadonly'> & {
|
|
63
|
-
readonly label?: string;
|
|
64
|
-
}>();
|
|
65
|
-
|
|
66
|
-
const inputRef = useTemplateRef('input');
|
|
67
|
-
const {id} = useFormFieldInjection();
|
|
68
|
-
|
|
69
|
-
const disabled = useDisabled(toRef(() => componentDisabled));
|
|
70
|
-
const isIndeterminate = computed(() => unref(modelValue) === null);
|
|
71
|
-
|
|
72
|
-
function onClick(evt: MouseEvent): void {
|
|
73
|
-
if (isReadonly) {
|
|
74
|
-
evt.preventDefault();
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
watchEffect(() => {
|
|
79
|
-
const input = unref(inputRef);
|
|
80
|
-
|
|
81
|
-
if (!input) {
|
|
82
|
-
return;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
input.indeterminate = unref(isIndeterminate);
|
|
86
|
-
});
|
|
87
|
-
</script>
|