-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add color picker and fix documents routes
- Loading branch information
Showing
9 changed files
with
113 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
--- | ||
prev: | ||
text: "ECheckbox" | ||
link: "/guide/components/echeckbox.md" | ||
next: | ||
text: "EDatePicker" | ||
link: "/guide/components/edatepicker.md" | ||
--- | ||
|
||
<script setup lang="ts"> | ||
import { EColorPicker } from "../../../src/index.ts"; | ||
import ExampleLayout from "../../utils/ExampleLayout.vue"; | ||
import { ref } from "vue"; | ||
|
||
const color = ref(); | ||
</script> | ||
|
||
# EColorPicker | ||
|
||
The `EColorPicker` component replaces the standard html input type color and encapsulates well-defined logic that can be reused throughout the app. | ||
|
||
## Basic Usage | ||
|
||
```vue-html | ||
<script setup> | ||
import { ref } from "vue"; | ||
import { EColorPicker } from "easy-kit-component"; | ||
const date = ref(); | ||
</script> | ||
<template> | ||
<EColorPicker v-model="color"/> | ||
</template> | ||
``` | ||
|
||
<ExampleLayout> | ||
<EColorPicker style="width: 40px !important" id="text" v-model="color"/> | ||
<br/> | ||
<h6>Color is : {{ color }}</h6> | ||
</ExampleLayout> | ||
|
||
|
||
## API Reference | ||
|
||
- **Props** | ||
|
||
```ts | ||
interface ColorPicker { | ||
disabled?: boolean; | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { shallowMount } from "@vue/test-utils"; | ||
import { describe, it, expect } from "vitest"; | ||
import EColorPicker from "./EColorPicker.vue"; | ||
|
||
describe("EColorPicker suite", () => { | ||
let wrapper = shallowMount(EColorPicker); | ||
|
||
it("render correctly", () => { | ||
expect(wrapper.html()).toMatchSnapshot(); | ||
}); | ||
|
||
it("render default disabled", () => { | ||
expect(wrapper.attributes("disabled")).toBeUndefined(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<script setup lang="ts"> | ||
import { useUpdateModelText } from "../../../composables/useUpdateModelValue"; | ||
interface ColorPicker { | ||
disabled?: boolean; | ||
} | ||
const props = defineProps<ColorPicker>(); | ||
const emit = defineEmits(); | ||
</script> | ||
|
||
<template> | ||
<input | ||
type="color" | ||
@input="useUpdateModelText($event, emit)" | ||
:disabled="props.disabled" | ||
/> | ||
</template> | ||
|
||
<script lang="ts"> | ||
export default { | ||
name: "EColorPicker", | ||
}; | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,19 @@ | ||
import EButton from "./components/button/EButton.vue"; | ||
import ECheckbox from "./components/input/checkbox/ECheckbox.vue"; | ||
import EColorPicker from "./components/input/colorpicker/EColorPicker.vue"; | ||
import EDatePicker from "./components/input/datepicker/EDatePicker.vue"; | ||
import EText from "./components/input/text/EText.vue"; | ||
import ETextArea from "./components/input/textarea/ETextArea.vue"; | ||
import ERadio from "./components/radio/ERadio.vue"; | ||
import ESelect from "./components/select/ESelect.vue"; | ||
|
||
export { EButton, ECheckbox, EDatePicker, EText, ETextArea, ERadio, ESelect }; | ||
export { | ||
EButton, | ||
ECheckbox, | ||
EColorPicker, | ||
EDatePicker, | ||
EText, | ||
ETextArea, | ||
ERadio, | ||
ESelect, | ||
}; |