diff --git a/docs/pages/webitel-ui/components/wt-datepicker/Readme.md b/docs/pages/webitel-ui/components/wt-datepicker/Readme.md index 58c5e2363..234b92e7b 100644 --- a/docs/pages/webitel-ui/components/wt-datepicker/Readme.md +++ b/docs/pages/webitel-ui/components/wt-datepicker/Readme.md @@ -1,15 +1,17 @@ -# WtDatepicker +# `wt-datepicker.vue` -## Props -::: raw - -::: +## Specs + + + +## PLUS ALL VUE DATEPICKER NATIVE PROPS +All passed but not declared props are passed to `` component as attributes ## Example Datepicker ::: raw diff --git a/docs/pages/webitel-ui/components/wt-datepicker/component-specs.vue b/docs/pages/webitel-ui/components/wt-datepicker/component-specs.vue new file mode 100644 index 000000000..5830b4721 --- /dev/null +++ b/docs/pages/webitel-ui/components/wt-datepicker/component-specs.vue @@ -0,0 +1,11 @@ + + + + + diff --git a/docs/pages/webitel-ui/components/wt-datepicker/wt-datepicker-docs.vue b/docs/pages/webitel-ui/components/wt-datepicker/wt-datepicker-docs.vue deleted file mode 100644 index ae8422b6a..000000000 --- a/docs/pages/webitel-ui/components/wt-datepicker/wt-datepicker-docs.vue +++ /dev/null @@ -1,84 +0,0 @@ - - - - - diff --git a/docs/pages/webitel-ui/components/wt-timepicker/Readme.md b/docs/pages/webitel-ui/components/wt-timepicker/Readme.md index 0f44064b9..9b1221bce 100644 --- a/docs/pages/webitel-ui/components/wt-timepicker/Readme.md +++ b/docs/pages/webitel-ui/components/wt-timepicker/Readme.md @@ -18,6 +18,7 @@ import ExampleTimepickerDateMode from './examples/example-timepicker-date-mode.v | labelProps | Object | false | `` | Object with props, passed down to wt-label as props | | noLabel | Boolean | false | `` | Not displaying label | | dateMode | Boolean | false | `` | If date-mode is true, timepicker asserts value is timestamp and displays/changes timestamp value | +| required | Boolean | false | `` | Native input required attribute | ## Events diff --git a/package.json b/package.json index 9dbe7b498..7b550f0fb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@webitel/ui-sdk", - "version": "24.12.23", + "version": "24.12.24", "private": false, "scripts": { "dev": "vite", diff --git a/src/components/wt-datepicker/wt-datepicker.vue b/src/components/wt-datepicker/wt-datepicker.vue index 2848ff5b6..714c314ce 100644 --- a/src/components/wt-datepicker/wt-datepicker.vue +++ b/src/components/wt-datepicker/wt-datepicker.vue @@ -14,7 +14,7 @@ name="label" v-bind="{ label }" > - {{ label }} + {{ requiredLabel }} import VueDatepicker from '@vuepic/vue-datepicker'; import '@vuepic/vue-datepicker/dist/main.css'; -import { ref } from 'vue'; +import { computed, ref } from 'vue'; const props = defineProps({ + + /** + * [`'date'`, `'datetime'`] + * */ + mode: { type: String, default: 'date', @@ -114,9 +119,22 @@ const props = defineProps({ type: String, default: 'en', }, + + /** + * Object with props, passed down to wt-label as props + */ + labelProps: { type: Object, - description: 'Object with props, passed down to wt-label as props', + }, + + /** + * Native input required attribute + */ + + required: { + type: Boolean, + default: false, }, }); const emit = defineEmits(['input']); @@ -125,6 +143,10 @@ const isOpened = ref(false); const datepicker = ref(null); // template ref const isDateTime = props.mode === 'datetime'; + +const requiredLabel = computed(() => { + return props.required ? `${props.label}*` : props.label; +});