Skip to content

Commit

Permalink
Merge pull request #29 from DanielTerletzkiy/VEZ-14
Browse files Browse the repository at this point in the history
Vez 14
  • Loading branch information
DanielTerletzkiy authored Sep 7, 2022
2 parents e5c41d5 + 1a84da2 commit 467c5bc
Show file tree
Hide file tree
Showing 13 changed files with 89 additions and 36 deletions.
61 changes: 45 additions & 16 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "vuelize",
"private": false,
"version": "0.1.13",
"version": "0.1.16",
"repository": {
"type": "git",
"url": "https://github.com/DanielTerletzkiy/vuelize"
Expand All @@ -23,6 +23,8 @@
],
"dependencies": {
"@types/estree": "^0.0.47",
"focus-trap": "^6.9.4",
"focus-trap-vue": "^3.3.1",
"lodash": "^4.17.21",
"pinia": "^2.0.14",
"rollup-plugin-typescript": "^1.0.1",
Expand Down
2 changes: 1 addition & 1 deletion src/components/DWrapper.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const props = defineProps({
})
const componentTag = computed(() => {
return props.link ? 'a' : props.rootTag ?? 'div'
return props.link ? 'router-link' : props.rootTag ?? 'div'
})
const globalClasses = computed(() => {
Expand Down
5 changes: 5 additions & 0 deletions src/components/HelloWorld.vue
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,11 @@
</DTooltip>
</DRow>
<DTextfield v-model="textfield" filled color="primary" label="Test"/>
<DTextfield v-model="textfield" filled color="primary" label="Test">
<template v-slot:prefix>
<d-icon name="clock"/>
</template>
</DTextfield>
<DCheckbox color="primary" off-icon="times" v-model="fill">
Check for filled List
</DCheckbox>
Expand Down
2 changes: 1 addition & 1 deletion src/components/button/DButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<DWrapper root-tag="button" :classes="['d-btn', {filled, block, glow, size}]"
v-bind="{...$props, ...$attrs}"
@click.capture="$emit('click')" :glow="false">
<span class="d-btn__content" :style="{color: filled ? $vuelize.getColorContrast(color,tint):''}" v-ripple>
<span class="d-btn__content" :style="{color: filled && color ? $vuelize.getColorContrast(color,tint):''}" v-ripple>
<span class="prefix" v-if="!!$slots.prefix">
<slot name="prefix"></slot>
</span>
Expand Down
18 changes: 14 additions & 4 deletions src/components/dialog/DDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@
<fade-transition :duration="{enter: 200, leave: 150}">
<DWrapper :classes="['d-dialog']" v-bind="{...$props, ...$attrs}" v-if="modelValue">
<div class="d-dialog__backdrop" @click.self="handleClick"/>
<div class="d-dialog__content">
<slot name="default">
</slot>
</div>
<focus-trap v-model:active="modelValue">
<div class="d-dialog__content" tabindex="-1">
<DWrapper class="d-dialog__content__focus" tabindex="0">
<slot name="default">
</slot>
</DWrapper>
</div>
</focus-trap>
</DWrapper>
</fade-transition>
</template>
Expand All @@ -19,6 +23,7 @@ export default {
<script setup lang="ts">
import DWrapper from "../DWrapper.vue";
import {FadeTransition} from "v3-transitions";
import {FocusTrap} from "focus-trap-vue";
const emit = defineEmits(['update:modelValue']);
const props = defineProps({
Expand Down Expand Up @@ -50,6 +55,7 @@ function close() {
align-items: center;
&__backdrop {
z-index: 1;
position: absolute;
width: 100%;
height: 100%;
Expand All @@ -60,6 +66,10 @@ function close() {
&__content {
z-index: 5;
&__focus {
outline: none;
}
}
}
</style>
3 changes: 2 additions & 1 deletion src/components/menu/DSelectMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<DList :modelValue="modelValue"
@update:modelValue="onInput" :multiple="multiple" :mandatory="mandatory"
:color="color" class="d-select-menu__dropdown__list pa-0" rounded="none">
<DListItem v-for="(item, index) in items" :key="index"
<DListItem v-for="(item, index) in items" :key="item[indexKey] || index"
:color="item.color || 'currentColor'"
:tabindex="0" ref="item">
<slot name="item" :item="item" :index="index">
Expand Down Expand Up @@ -40,6 +40,7 @@ const props = defineProps({
modelValue: [Number, String, Array],
open: {type: Boolean},
items: {type: Array},
indexKey: {type: String},
multiple: {type: Boolean},
mandatory: {type: Boolean},
...defaultProps
Expand Down
6 changes: 3 additions & 3 deletions src/components/table/DTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
<DDivider block width="100%"/>
</td>
</tr>
<tr v-for="(row, r) in visibleData" :key="r">
<td v-for="cell in row" :key="cell.value" :colspan="cell.colspan">
<tr v-for="(row, r) in visibleData" :key="r" @click="$emit(`rowClick`, r)">
<td v-for="(cell, c) in row" :key="r+c" :colspan="cell.colspan" @click="$emit(`cellClick`, c)">
<slot :name="`data(${cell.key})`" :value="cell.value" :key="cell.key" :type="cell.type"
:params="cell.params"
:row="r"
Expand All @@ -39,7 +39,7 @@
<DDivider v-if="paginationAvailable" block width="100%"/>
<DRow v-if="paginationAvailable" class="pa-2" block>
<DSpacer/>
<DPagination v-model="currentPage" color="primary" :size="24" rounded="md" :total="pages"/>
<DPagination v-model="currentPage" :color="color||'primary'" :size="24" rounded="md" :total="pages"/>
</DRow>
</DWrapper>
</template>
Expand Down
8 changes: 6 additions & 2 deletions src/components/textfield/DTextfield.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<DWrapper :classes="['d-text-field', classesObject]" v-bind="{...$props, ...$attrs}"
:style="textFieldStylesObject"
@mouseenter="hover = true" @mouseleave="hover = false">
<div class="d-text-field__prefix">
<div v-if="!!$slots.prefix" class="d-text-field__prefix">
<slot name="prefix"/>
</div>
<component v-if="componentType !== 'input'" :is="componentType" v-bind="{...$props, ...$attrs}" :id="instance.uid"
Expand All @@ -28,7 +28,7 @@
<label v-if="label && !solo" :for="instance.uid" class="d-text-field__label" :class="labelClassesObject">{{
label
}}</label>
<div class="d-text-field__suffix">
<div v-if="!!$slots.suffix" class="d-text-field__suffix">
<slot name="suffix"/>
</div>
</DWrapper>
Expand Down Expand Up @@ -175,6 +175,10 @@ function removeFocus() {
position: relative;
left: 0.7rem;
font-size: 20px;
& ~ .d-text-field__label {
left: 40px;
}
}
&__suffix {
Expand Down
3 changes: 2 additions & 1 deletion src/components/textfield/variant/DSelect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</SlideYDownTransition>
</DIconButton>
<DSelectMenu :items="items" :modelValue="modelValue" @update:modelValue="onInput"
v-model:open="dropdownOpen" :mandatory="mandatory" :multiple="false" :color="$props.color">
v-model:open="dropdownOpen" :mandatory="mandatory" :multiple="false" :index-key="indexKey" :color="$props.color">
<template v-slot:item="props">
<slot name="item" v-bind="props"></slot>
</template>
Expand All @@ -30,6 +30,7 @@ const emit = defineEmits(['update:modelValue', 'removeFocus'])
const props = defineProps({
modelValue: [Number, String],
items: Array,
indexKey: {type: String},
mandatory: {type: Boolean},
...defaultProps
})
Expand Down
9 changes: 5 additions & 4 deletions src/stories/DDialog.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ import {ref} from "vue";
export default {
title: 'DDialog',
component: DDialog,
argTypes: {
},
argTypes: {},
};

const Template = (args) => ({
Expand All @@ -17,10 +16,12 @@ const Template = (args) => ({
return {args, value};
},
template: `
<d-button @click="value=true">open</d-button>
<d-button @click="value = !value">open</d-button>
<d-dialog v-bind="args" v-model="value">
<d-card width="200px" height="200px">
<d-button>
Tab me!
</d-button>
</d-card>
</d-dialog>`,
});
Expand Down
2 changes: 1 addition & 1 deletion vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import rollup from "./rollup.config.js";
export default defineConfig({
plugins: [vue()],
resolve: { dedupe: ['vue'] },
server: { port: 5555 },
server: { port: 5656 },
build: {
// @ts-ignore
rollupOptions: rollup
Expand Down
2 changes: 1 addition & 1 deletion vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import rollup from "./rollup.config.js";
export default defineConfig({
plugins: [vue()],
resolve: {dedupe: ['vue']},
server: {port: 5555},
server: {port: 5656},
build: {
// @ts-ignore
rollupOptions: rollup
Expand Down

0 comments on commit 467c5bc

Please sign in to comment.