@webilio-xyz/webilio-vue 1.0.21 → 1.0.22

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.
@@ -0,0 +1,12 @@
1
+ import globals from "globals";
2
+ import pluginJs from "@eslint/js";
3
+ import pluginVue from "eslint-plugin-vue";
4
+
5
+
6
+ /** @type {import('eslint').Linter.Config[]} */
7
+ export default [
8
+ {files: ["**/*.{js,mjs,cjs,vue}"]},
9
+ {languageOptions: { globals: globals.browser }},
10
+ pluginJs.configs.recommended,
11
+ ...pluginVue.configs["flat/essential"],
12
+ ];
package/package.json CHANGED
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "name": "@webilio-xyz/webilio-vue",
3
- "version": "1.0.21",
3
+ "version": "1.0.22",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "dev": "vite --host 0.0.0.0",
7
7
  "build": "vite build",
8
- "preview": "vite preview"
8
+ "preview": "vite preview",
9
+ "lint": "eslint \"src/**/*.{js,vue}\" --fix"
9
10
  },
10
11
  "private": false,
11
12
  "homepage": "https://webilio-xyz.github.io/webilio-vue/",
@@ -35,8 +36,12 @@
35
36
  "vue-select": "^4.0.0-beta.6"
36
37
  },
37
38
  "devDependencies": {
39
+ "@eslint/js": "^9.18.0",
38
40
  "autoprefixer": "^10.4.20",
41
+ "eslint": "^9.18.0",
42
+ "eslint-plugin-vue": "^9.32.0",
39
43
  "flat": "^6.0.1",
44
+ "globals": "^15.14.0",
40
45
  "postcss": "^8.4.41",
41
46
  "tailwindcss": "^3.4.10",
42
47
  "vite": "^5.4.1",
@@ -1,7 +1,7 @@
1
1
  <script setup>
2
2
  import {ref} from "vue";
3
3
 
4
- const props = defineProps({
4
+ defineProps({
5
5
  alertMessage: {
6
6
  type: String,
7
7
  default: 'Alert'
@@ -1,5 +1,4 @@
1
1
  <script setup>
2
- import {computed, useSlots} from "vue";
3
2
  </script>
4
3
 
5
4
  <template>
@@ -27,7 +27,7 @@ const locale = computed(() => {
27
27
  return getActiveLanguage();
28
28
  })
29
29
 
30
- const props = defineProps({
30
+ defineProps({
31
31
  modelValue: String,
32
32
  min: String,
33
33
  max: String,
@@ -1,8 +1,7 @@
1
- <script lang="ts">
1
+ <script>
2
2
  import {defineComponent} from "vue";
3
3
  export default defineComponent({
4
4
  name: "ErrorComponent",
5
- components: {Error},
6
5
  props: {
7
6
  message: String
8
7
  }
@@ -45,10 +45,14 @@ const props = defineProps({
45
45
  searchable: {
46
46
  type: Boolean,
47
47
  default: true
48
+ },
49
+ taggable: {
50
+ type: Boolean,
51
+ default: false
48
52
  }
49
53
  });
50
54
 
51
- const emit = defineEmits(['update:modelValue']);
55
+ const emit = defineEmits(['update:modelValue', 'tag']);
52
56
 
53
57
  const formGroupUniqueId = ref(null);
54
58
 
@@ -99,7 +103,9 @@ const maska = computed(() => {
99
103
  :disabled="disabled"
100
104
  :multiple="multiple"
101
105
  :searchable="searchable"
106
+ :taggable="taggable"
102
107
  @update:model-value="emit('update:modelValue', $event)"
108
+ @tag="emit('tag', $event)"
103
109
  />
104
110
  <Textarea
105
111
  v-else-if="type === 'textarea'"
@@ -50,12 +50,14 @@ const props = defineProps({
50
50
  required: {
51
51
  type: Boolean,
52
52
  default: false
53
+ },
54
+ taggable: {
55
+ type: Boolean,
56
+ default: false
53
57
  }
54
58
  });
55
59
 
56
- const emit = defineEmits(['update:modelValue']);
57
-
58
- const input = ref(null);
60
+ const emit = defineEmits(['update:modelValue', 'tag']);
59
61
 
60
62
  const formGroupUniqueId = ref(null);
61
63
 
@@ -96,7 +98,9 @@ const maska = computed(() => {
96
98
  :mask="maska"
97
99
  :searchable="searchable"
98
100
  :placeholder="placeholder"
101
+ :taggable="taggable"
99
102
  @update:model-value="emit('update:modelValue', $event)"
103
+ @tag="emit('tag', $event)"
100
104
  />
101
105
 
102
106
  <ErrorComponent
@@ -3,7 +3,7 @@ import {computed} from 'vue';
3
3
  import Multiselect from 'vue-multiselect';
4
4
  import {map} from "lodash-es";
5
5
 
6
- const emit = defineEmits(['update:modelValue'])
6
+ const emit = defineEmits(['update:modelValue', 'tag'])
7
7
 
8
8
  const props = defineProps({
9
9
  modelValue: {},
@@ -50,6 +50,10 @@ const props = defineProps({
50
50
  groupLabel: {
51
51
  type: String,
52
52
  default: 'label'
53
+ },
54
+ taggable: {
55
+ type: Boolean,
56
+ default: false
53
57
  }
54
58
  });
55
59
 
@@ -96,7 +100,10 @@ const remove = (option) => {
96
100
  });
97
101
  emit('update:modelValue', newValue);
98
102
  }
103
+ }
99
104
 
105
+ const addTag = (newTag) => {
106
+ emit('tag', newTag);
100
107
  }
101
108
 
102
109
  </script>
@@ -117,6 +124,8 @@ const remove = (option) => {
117
124
  :group-select="groupSelect"
118
125
  :group-values="groupValues"
119
126
  :group-label="groupLabel"
127
+ :taggable="taggable"
128
+ @tag="addTag"
120
129
  @remove="remove"
121
130
  >
122
131
  <template #maxElements>
@@ -1,6 +1,5 @@
1
1
  <script setup>
2
-
3
- const props = defineProps({
2
+ defineProps({
4
3
  options: {
5
4
  type: Array,
6
5
  required: true
@@ -1,6 +1,5 @@
1
1
  <script setup>
2
-
3
- const props = defineProps({
2
+ defineProps({
4
3
  option: {
5
4
  type: Object,
6
5
  required: true
@@ -3,7 +3,7 @@ import ModalComponent from "./ModalComponent.vue";
3
3
  import CardTitleComponent from "../Layout/CardTitleComponent.vue";
4
4
  import ButtonComponent from "../Component/ButtonComponent.vue";
5
5
 
6
- const props = defineProps({
6
+ defineProps({
7
7
  show: {
8
8
  type: Boolean,
9
9
  default: false,
@@ -1,6 +1,6 @@
1
1
  <script setup>
2
2
  import {router} from "@inertiajs/vue3";
3
- import {computed, ref, watch, toRaw} from "vue";
3
+ import {computed, ref, watch} from "vue";
4
4
  import { usePage } from '@inertiajs/vue3';
5
5
  import {debounce, findIndex, get, forEach} from "lodash-es";
6
6
  import Columns from "../../Models/Columns";
@@ -48,7 +48,7 @@ const props = defineProps({
48
48
  },
49
49
  sorting: {
50
50
  type: Array,
51
- default: []
51
+ default: () =>[]
52
52
  }
53
53
  })
54
54
 
@@ -3,7 +3,7 @@ import Columns from "../../Models/Columns.ts";
3
3
  import TableRowComponent from "./TableRowComponent.vue";
4
4
  import TableHeaderComponent from "./TableHeaderComponent.vue";
5
5
 
6
- const props = defineProps({
6
+ defineProps({
7
7
  columns: {
8
8
  type: Columns,
9
9
  default: () => new Columns()
@@ -26,7 +26,7 @@ const props = defineProps({
26
26
  },
27
27
  sorting: {
28
28
  type: Array,
29
- default: []
29
+ default: () => []
30
30
  }
31
31
  });
32
32
 
@@ -1,12 +1,12 @@
1
1
  <script setup>
2
2
  import {computed} from "vue";
3
3
  import Columns from "../../Models/Columns.ts";
4
- import {find, get} from "lodash-es";
4
+ import {find} from "lodash-es";
5
5
 
6
6
  const props = defineProps({
7
7
  columns: {
8
8
  type: Columns,
9
- default: []
9
+ default: () => []
10
10
  },
11
11
  trClass: {
12
12
  type: String,
@@ -18,7 +18,7 @@ const props = defineProps({
18
18
  },
19
19
  sorting: {
20
20
  type: Array,
21
- default: []
21
+ default: () =>[]
22
22
  }
23
23
  })
24
24
 
@@ -44,7 +44,6 @@ const getColumnSortingDirection = (column) => {
44
44
  default:
45
45
  return false;
46
46
  }
47
- return false;
48
47
  }
49
48
 
50
49
  const sort = (column, $event) => {
@@ -94,7 +94,7 @@ const changePage = (page) => {
94
94
  <template v-else-if="currentPage === lastPage">
95
95
  <slot name="previous">
96
96
  <template v-if="lastPage < 5">
97
- <ButtonComponent
97
+ <button
98
98
  :class="pageClassButtons"
99
99
  class="wv-pagination-button wv-pagination-previous"
100
100
  v-for="pageId in range(1, lastPage)"
@@ -102,27 +102,28 @@ const changePage = (page) => {
102
102
  @click="changePage(pageId)"
103
103
  >
104
104
  {{ pageId }}
105
- </ButtonComponent>
105
+ </button>
106
106
  </template>
107
107
  <template v-else>
108
- <ButtonComponent :class="pageClassButtons" class="wv-pagination-button wv-pagination-previous" @click="changePage(1)">
108
+ <button :class="pageClassButtons" class="wv-pagination-button wv-pagination-previous" @click="changePage(1)">
109
109
  1
110
- </ButtonComponent>
110
+ </button>
111
111
  <span class="wv-pagination-dot py-2">...</span>
112
- <ButtonComponent
112
+ <button
113
113
  :class="pageClassButtons"
114
+ class="wv-pagination-button wv-pagination-previous"
114
115
  v-for="pageId in range(currentPage - 2, currentPage)"
115
116
  :key="pageId"
116
117
  @click="changePage(pageId)"
117
118
  >
118
119
  {{ pageId }}
119
- </ButtonComponent>
120
+ </button>
120
121
  </template>
121
122
  </slot>
122
123
  <slot name="current">
123
- <ButtonComponent :class="pageClassButtons" disabled>
124
+ <button :class="pageClassButtons" class="wv-pagination-button wv-pagination-current" disabled>
124
125
  {{ currentPage }}
125
- </ButtonComponent>
126
+ </button>
126
127
  </slot>
127
128
  </template>
128
129
  <template v-else>
@@ -2,7 +2,7 @@
2
2
  import Columns from "../../Models/Columns";
3
3
  import TableCell from "./TableCellComponent.vue";
4
4
 
5
- const props = defineProps({
5
+ defineProps({
6
6
  columns: {
7
7
  type: Columns,
8
8
  default: () => new Columns()
@@ -1,13 +1,3 @@
1
- import {
2
- ErrorComponent,
3
- InputComponent,
4
- InputGroupComponent,
5
- LabelComponent,
6
- SelectComponent,
7
- TextareaComponent,
8
- TextInputComponent,
9
- ToggleComponent
10
- } from "../../Components/Input/index.js";
11
1
  import DateComponentDemo from "./DateComponentDemo.js";
12
2
  import CheckboxComponentDemo from "./CheckboxComponentDemo.js";
13
3
  import ErrorComponentDemo from "./ErrorComponentDemo.js";
@@ -1,4 +1,3 @@
1
- import ModalComponent from "../../Components/Modal/ModalComponent.vue";
2
1
  import {ref} from "vue";
3
2
  import ConfirmModalComponent from "../../Components/Modal/ConfirmModalComponent.vue";
4
3
 
@@ -1,7 +1,6 @@
1
1
 
2
2
  import Columns from "../../Models/Columns.ts";
3
3
  import ColumnDefinition from "../../Models/ColumnDefinition.js";
4
- import TableComponent from "../../Components/Table/TableComponent.vue";
5
4
  import TableHeaderComponent from "../../Components/Table/TableHeaderComponent.vue";
6
5
 
7
6
  export default {
@@ -1,6 +1,4 @@
1
1
 
2
- import Columns from "../../Models/Columns.ts";
3
- import ColumnDefinition from "../../Models/ColumnDefinition.js";
4
2
  import TablePaginationComponent from "../../Components/Table/TablePaginationComponent.vue";
5
3
 
6
4
  export default {
@@ -1,13 +1,11 @@
1
1
  <script setup>
2
-
3
- import {isArray} from "lodash-es";
4
2
  import logo from "../Assets/Logo_webilio.png";
5
3
  import {RouterLink} from "vue-router";
6
4
  import router from "../router/index.js";
7
5
  const props = defineProps({
8
6
  demos: {
9
7
  type: Array,
10
- default: []
8
+ default: () => []
11
9
  },
12
10
  modelValue: {
13
11
  type: String,
@@ -33,7 +31,7 @@ const isActive = function(key) {
33
31
  <div data-applied-style-tokens="sidebarLogo" data-style-tokens="sidebarLogo">
34
32
  <img :src="logo" />
35
33
  </div>
36
- <template v-for="(demo, index) in props.demos">
34
+ <template v-for="(demo, index) in props.demos" :key="index">
37
35
  <template v-if="!isComponent(demo)">
38
36
  <div data-applied-style-tokens="sidebarSection" data-style-tokens="sidebarSection">
39
37
  <div data-applied-style-tokens="sidebarSectionTitle" data-style-tokens="sidebarSectionTitle">
@@ -42,7 +40,6 @@ const isActive = function(key) {
42
40
  <a
43
41
  v-for="(subDemo, subIndex) in demo"
44
42
  :href="`#${index}.${subIndex}`"
45
-
46
43
  :key="'sidebar-link-' + subIndex"
47
44
  data-style-tokens="sidebarButton"
48
45
  :data-applied-style-tokens="isActive(`${index}.${subIndex}`) ? 'sidebarButtonSelected sidebarButton' : 'sidebarButton'"
@@ -65,5 +65,9 @@ export default class ColumnDefinition {
65
65
  if (typeof tdClassName === "string") {
66
66
  this.tdClassName = tdClassName;
67
67
  }
68
+
69
+ if (typeof trClassName === "string") {
70
+ this.trClassName = trClassName;
71
+ }
68
72
  }
69
73
  }
@@ -1,20 +1,6 @@
1
1
  import { createRouter, createWebHistory } from 'vue-router';
2
- import Components from "../Demo/index.js";
3
- import {flatten} from "flat";
4
- import {forEach} from "lodash-es";
5
2
  import VueDoxen from "../Doxen/VueDoxen.vue";
6
3
 
7
-
8
- const demos = {
9
- 'Inputs' : Components.Inputs,
10
- 'Tables' : Components.Tables,
11
- 'Layouts': Components.Layouts,
12
- 'Modals': Components.Modals,
13
- 'Components': Components.Components
14
- };
15
-
16
- const doxenFormattedDemos = flatten(demos, { maxDepth: 2 });
17
-
18
4
  const routes = [
19
5
  // ...other routes,
20
6
  {