quasar-factory-lib 0.0.8 → 0.0.10

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.
Files changed (68) hide show
  1. package/dist/components/{K-Table/K-Table.vue.d.ts → Table/Table.vue.d.ts} +11 -8
  2. package/dist/components/{K-Table → Table}/components/TableFilter.vue.d.ts +0 -1
  3. package/dist/components/{K-Table → Table}/components/TableSlotBody.vue.d.ts +3 -2
  4. package/dist/components/{K-Table → Table}/components/TableSlotGrid.vue.d.ts +3 -2
  5. package/dist/components/{K-Table → Table}/index.d.ts +1 -1
  6. package/dist/components/index.d.ts +1 -1
  7. package/dist/components/plugins.d.ts +1 -1
  8. package/dist/i18n/en/index.d.ts +14 -2
  9. package/dist/i18n/es/index.d.ts +14 -2
  10. package/dist/i18n/index.d.ts +30 -1
  11. package/dist/pages/TablePage.vue.d.ts +1125 -0
  12. package/dist/quasar-factory-lib.js +9555 -5524
  13. package/dist/quasar-factory-lib.umd.cjs +15 -9
  14. package/dist/store/table.d.ts +9 -0
  15. package/dist/style.css +1 -1
  16. package/package.json +4 -8
  17. package/src/assets/fonts/Beatrice Regular.ttf +0 -0
  18. package/src/assets/fonts/Beatrice-Medium.otf +0 -0
  19. package/src/assets/fonts/Beatrice-Regular.woff2 +0 -0
  20. package/src/assets/fonts/SangBleuKingdom-Light.otf +0 -0
  21. package/src/components/{K-Table/K-Table.vue → Table/Table.vue} +12 -6
  22. package/src/components/{K-Table → Table}/components/CustomizedIcon.vue +2 -2
  23. package/src/components/{K-Table → Table}/components/TableColumnsSelector.vue +1 -1
  24. package/src/components/{K-Table → Table}/components/TableFilter.vue +9 -10
  25. package/src/components/{K-Table → Table}/components/TableSlotBody.vue +7 -6
  26. package/src/components/{K-Table → Table}/components/TableSlotGrid.vue +6 -5
  27. package/src/components/{K-Table → Table}/css/columnsSelector.css +2 -2
  28. package/src/components/{K-Table → Table}/css/table.css +24 -25
  29. package/src/components/{K-Table → Table}/css/tableFilter.css +2 -3
  30. package/src/components/{K-Table → Table}/css/tableSlotHeader.css +2 -3
  31. package/src/components/{K-Table → Table}/index.ts +1 -1
  32. package/src/components/{K-Table → Table}/utils/infiniteScroll.ts +1 -1
  33. package/src/components/index.ts +1 -1
  34. package/src/components/plugins.ts +1 -1
  35. package/src/css/app.css +26 -1
  36. package/src/css/fonts.css +15 -0
  37. package/src/i18n/en/index.ts +14 -2
  38. package/src/i18n/es/index.ts +15 -3
  39. package/src/index.ts +3 -1
  40. package/src/layouts/MenuLayout.vue +2 -2
  41. package/src/main.ts +3 -1
  42. package/src/pages/TablePage.vue +316 -0
  43. package/src/router/routes.ts +6 -2
  44. package/src/store/index.js +9 -0
  45. package/src/store/table.js +22 -0
  46. /package/dist/components/{K-Table → Table}/components/BasicCheckBox.vue.d.ts +0 -0
  47. /package/dist/components/{K-Table → Table}/components/CardListSkeleton.vue.d.ts +0 -0
  48. /package/dist/components/{K-Table → Table}/components/CustomizedButton.vue.d.ts +0 -0
  49. /package/dist/components/{K-Table → Table}/components/CustomizedCheckBox.vue.d.ts +0 -0
  50. /package/dist/components/{K-Table → Table}/components/CustomizedIcon.vue.d.ts +0 -0
  51. /package/dist/components/{K-Table → Table}/components/TableColumnsSelector.vue.d.ts +0 -0
  52. /package/dist/components/{K-Table → Table}/components/TablePopupEdit.vue.d.ts +0 -0
  53. /package/dist/components/{K-Table → Table}/components/TableSkeleton.vue.d.ts +0 -0
  54. /package/dist/components/{K-Table → Table}/components/TableSlotHeader.vue.d.ts +0 -0
  55. /package/dist/components/{K-Table → Table}/utils/filterMethod.d.ts +0 -0
  56. /package/dist/components/{K-Table → Table}/utils/infiniteScroll.d.ts +0 -0
  57. /package/dist/components/{K-Table → Table}/utils/setTableHeight.d.ts +0 -0
  58. /package/dist/components/{K-Table → Table}/utils/sort.d.ts +0 -0
  59. /package/src/components/{K-Table → Table}/components/BasicCheckBox.vue +0 -0
  60. /package/src/components/{K-Table → Table}/components/CardListSkeleton.vue +0 -0
  61. /package/src/components/{K-Table → Table}/components/CustomizedButton.vue +0 -0
  62. /package/src/components/{K-Table → Table}/components/CustomizedCheckBox.vue +0 -0
  63. /package/src/components/{K-Table → Table}/components/TablePopupEdit.vue +0 -0
  64. /package/src/components/{K-Table → Table}/components/TableSkeleton.vue +0 -0
  65. /package/src/components/{K-Table → Table}/components/TableSlotHeader.vue +0 -0
  66. /package/src/components/{K-Table → Table}/utils/filterMethod.ts +0 -0
  67. /package/src/components/{K-Table → Table}/utils/setTableHeight.ts +0 -0
  68. /package/src/components/{K-Table → Table}/utils/sort.js +0 -0
package/package.json CHANGED
@@ -1,13 +1,11 @@
1
1
  {
2
2
  "dependencies": {
3
3
  "@quasar/extras": "^1.16.11",
4
- "file-saver": "^2.0.5",
5
4
  "global": "^4.4.0",
5
+ "pinia": "^3.0.1",
6
6
  "quasar": "^2.17.0",
7
- "sortablejs": "^1.15.3",
8
7
  "vue": "^3.5.11",
9
- "vue-i18n": "^10.0.4",
10
- "vue-pdf-embed": "^2.1.1"
8
+ "vue-i18n": "^10.0.4"
11
9
  },
12
10
  "description": "Quasar Library",
13
11
  "devDependencies": {
@@ -41,8 +39,6 @@
41
39
  "sass-embedded": "^1.79.4",
42
40
  "semver": "^7.6.3",
43
41
  "standard-version": "^9.5.0",
44
- "storybook": "^8.1.11",
45
- "storybook-addon-vue-slots": "^0.9.29",
46
42
  "typescript": "^5.6.0",
47
43
  "typescript-eslint": "^8.14.0",
48
44
  "vite": "^5.4.8",
@@ -93,7 +89,6 @@
93
89
  "preview": "vite preview",
94
90
  "publishPackage": "yarn dev & yarn build && yarn cy:run && yarn release && git push --follow-tags origin main && npm publish --access public && exit",
95
91
  "publishPackage:skipTests": "yarn build && yarn release && git push --follow-tags origin main && npm publish --access public",
96
- "storybook": "storybook dev -p 6006",
97
92
  "test": "",
98
93
  "types": "vue-tsc ",
99
94
  "docs:dev": "vitepress dev docs",
@@ -102,5 +97,6 @@
102
97
  "release": "standard-version"
103
98
  },
104
99
  "type": "module",
105
- "version": "0.0.8"
100
+ "version": "0.0.10",
101
+ "author": ""
106
102
  }
@@ -7,7 +7,7 @@
7
7
  v-if="!showSkeleton"
8
8
  ref="myTable"
9
9
  v-model:selected="selected"
10
- class="k-table"
10
+ class="my-table"
11
11
  :grid="smallDevice"
12
12
  :style="tableStyle"
13
13
  flat
@@ -61,7 +61,8 @@
61
61
  v-if="!showSkeleton"
62
62
  :table-props="props"
63
63
  :selection-type="selectionType"
64
- @on-update-checkbox-value="onUpdateCheckboxValue"
64
+ @on-update-basic-checkbox-value="onUpdateBasicCheckboxValue"
65
+ @on-update-customized-checkbox-value="onUpdateCustomizedCheckboxValue"
65
66
  @on-save-value-popup-edit="onSaveValuePopupEdit"
66
67
  @on-click-button="onClickButton"
67
68
  @click="onRowClick(props.row)"
@@ -72,7 +73,8 @@
72
73
  :table-props="props"
73
74
  :selection-type="selectionType"
74
75
  :popup-edit-number-options="popupEditNumberOptions"
75
- @on-update-checkbox-value="onUpdateCheckboxValue"
76
+ @on-update-customized-checkbox-value="onUpdateCustomizedCheckboxValue"
77
+ @on-update-basic-checkbox-value="onUpdateBasicCheckboxValue"
76
78
  @on-save-value-popup-edit="onSaveValuePopupEdit"
77
79
  @on-click-button="onClickButton"
78
80
  @click="onRowClick(props.row)"
@@ -178,7 +180,8 @@ export default defineComponent({
178
180
  },
179
181
  emits: [
180
182
  'onSelectVisibleColumns',
181
- 'onUpdateCheckboxValue',
183
+ 'onUpdateBasicCheckboxValue',
184
+ 'onUpdateCustomizedCheckboxValue',
182
185
  'onSaveValuePopupEdit',
183
186
  'onClickButton',
184
187
  'storeUpdated',
@@ -240,8 +243,8 @@ export default defineComponent({
240
243
  onSaveValuePopupEdit (row: object) {
241
244
  this.$emit('onSaveValuePopupEdit', row)
242
245
  },
243
- onUpdateCheckboxValue (row: object) {
244
- this.$emit('onUpdateCheckboxValue', row)
246
+ onUpdateBasicCheckboxValue (row: object) {
247
+ this.$emit('onUpdateBasicCheckboxValue', row)
245
248
  },
246
249
  onClickButton (emit: 'onClickButton', row: object) {
247
250
  this.$emit(emit, row)
@@ -252,6 +255,9 @@ export default defineComponent({
252
255
  deleteItem (row: object) {
253
256
  this.$emit('deleteItem', row)
254
257
  },
258
+ onUpdateCustomizedCheckboxValue (row: object) {
259
+ this.$emit('onUpdateCustomizedCheckboxValue', row)
260
+ },
255
261
  clearTableSelection () {
256
262
  const table = this.$refs.myTable as QTable
257
263
  table.clearSelection()
@@ -2,8 +2,8 @@
2
2
  <q-icon
3
3
  :name="
4
4
  customizedIconName? customizedIconName : model
5
- ? 'fa-solid fa-circle-check'
6
- : 'fa-solid fa-circle-xmark'"
5
+ ? 'check_circle'
6
+ : 'cancel'"
7
7
  :color="
8
8
  customizedIconColor? customizedIconColor : model? 'green': 'red'"
9
9
  :size="customizedIconSize"
@@ -57,5 +57,5 @@ export default {
57
57
  }
58
58
  }
59
59
  </script>
60
- <style scoped>
60
+ <style>
61
61
  </style>
@@ -1,17 +1,20 @@
1
1
  <template>
2
2
  <q-input
3
3
  ref="filterRef"
4
- v-model="localStore.valueInputFilterTable"
4
+ v-model="localStore.filterValue"
5
5
  borderless
6
6
  dense
7
7
  debounce="300"
8
8
  class="table-filter auto-width"
9
9
  placeholder="Search"
10
10
  outlined
11
+ @update:model-value="((value: string)=> {
12
+ localStore.setFilterValue(value)
13
+ })"
11
14
  >
12
15
  <template #append>
13
16
  <q-icon
14
- v-if="localStore.valueInputFilterTable === ''"
17
+ v-if="localStore.filterValue === ''"
15
18
  name="search"
16
19
  color="black"
17
20
  />
@@ -19,7 +22,9 @@
19
22
  v-else
20
23
  name="clear"
21
24
  class="cursor-pointer"
22
- @click="cleanSearchValue"
25
+ @click="(()=> {
26
+ localStore.cleanTableFilter()
27
+ })"
23
28
  />
24
29
  </template>
25
30
  </q-input>
@@ -40,9 +45,7 @@ export default {
40
45
  }
41
46
  },
42
47
  beforeMount () {
43
- this.localStore.disableScannerButtons = false
44
- this.localStore.valueInputFilterTable = ''
45
- this.localStore.lastFilterValue = ''
48
+ this.localStore.cleanTableFilter()
46
49
  },
47
50
  mounted () {
48
51
  },
@@ -52,10 +55,6 @@ export default {
52
55
  const input = this.$refs.filterRef as QInput
53
56
  input.focus()
54
57
  }, 10)
55
- },
56
- cleanSearchValue () {
57
- this.localStore.valueInputFilterTable = ''
58
- this.localStore.lastFilterValue = ''
59
58
  }
60
59
  }
61
60
  }
@@ -21,12 +21,14 @@
21
21
  >
22
22
  <span
23
23
  v-if="getColumnValue(col)"
24
- v-text="tableProps.row[col.name]"
24
+ v-html="tableProps.row[col.name]"
25
25
  />
26
+ <!-- fa-solid fa-pen-to-square -->
26
27
  <q-icon
27
28
  v-if="col.editable"
28
- name="fa-solid fa-pen-to-square"
29
+ name="edit"
29
30
  color="primary"
31
+ size="sm"
30
32
  />
31
33
  <TablePopupEdit
32
34
  v-if="col.editable"
@@ -51,7 +53,7 @@
51
53
  :model="tablePropsData.row[col.name]"
52
54
  @check-box-emit="(val: object) => {
53
55
  tablePropsData.row[col.name] = val
54
- $emit(col.checkBoxEmit || 'onUpdateCheckboxValue', tablePropsData.row)
56
+ $emit(col.checkBoxEmit || 'onUpdateBasicCheckboxValue', tablePropsData.row)
55
57
  }"
56
58
  />
57
59
  <CustomizedCheckBox
@@ -65,10 +67,9 @@
65
67
  :unchecked-icon="col.uncheckedIcon"
66
68
  @check-box-emit="(val: object) => {
67
69
  tablePropsData.row[col.name] = val
68
- $emit(col.checkBoxEmit || 'onUpdateCheckboxValue', tablePropsData.row)
70
+ $emit(col.checkBoxEmit || 'onUpdateCustomizedCheckboxValue', tablePropsData.row)
69
71
  }"
70
72
  />
71
-
72
73
  <CustomizedIcon
73
74
  v-if="col.showCustomizedIcon"
74
75
  :model="tablePropsData.row[col.name]"
@@ -114,7 +115,7 @@ export default {
114
115
  default: 'none'
115
116
  }
116
117
  },
117
- emits: ['onSaveValuePopupEdit', 'onUpdateCheckboxValue', 'onClickButton'],
118
+ emits: ['onSaveValuePopupEdit', 'onUpdateBasicCheckboxValue', 'onClickButton', 'onUpdateCustomizedCheckboxValue'],
118
119
  data () {
119
120
  return {
120
121
  tablePropsData: this.tableProps
@@ -46,7 +46,7 @@
46
46
  color="primary"
47
47
  size="sm"
48
48
  />
49
- <span v-text="tableProps.row[col.name]" />
49
+ <span v-html="tableProps.row[col.name]" />
50
50
  <TablePopupEdit
51
51
  :model="tablePropsData.row[col.name] || ''"
52
52
  :label="col.label"
@@ -71,7 +71,7 @@
71
71
  :model="tablePropsData.row[col.name]"
72
72
  @check-box-emit="(val: object) => {
73
73
  tablePropsData.row[col.name] = val
74
- $emit(col.checkBoxEmit || 'onUpdateCheckboxValue', tablePropsData.row)
74
+ $emit(col.checkBoxEmit || 'onUpdateBasicCheckboxValue', tablePropsData.row)
75
75
  }"
76
76
  />
77
77
  <CustomizedCheckBox
@@ -85,7 +85,7 @@
85
85
  :unchecked-icon="col.uncheckedIcon"
86
86
  @check-box-emit="(val: object) => {
87
87
  tablePropsData.row[col.name] = val
88
- $emit(col.checkBoxEmit || 'onUpdateCheckboxValue', tablePropsData.row)
88
+ $emit(col.checkBoxEmit || 'onUpdateCustomizedCheckboxValue', tablePropsData.row)
89
89
  }"
90
90
  />
91
91
  </q-item-section>
@@ -149,8 +149,9 @@ export default {
149
149
  },
150
150
  emits: [
151
151
  'onSaveValuePopupEdit',
152
- 'onUpdateCheckboxValue',
153
- 'onClickButton'
152
+ 'onUpdateBasicCheckboxValue',
153
+ 'onClickButton',
154
+ 'onUpdateCustomizedCheckboxValue'
154
155
  ],
155
156
  data () {
156
157
  return {
@@ -1,10 +1,10 @@
1
- .columns-selector .q-select {
1
+ .columns-selector {
2
2
  width: 250px;
3
3
  min-width: 150px;
4
4
  flex: 1;
5
5
  }
6
6
  @media only screen and (max-width: 1100px) {
7
- .columns-selector .q-select {
7
+ .columns-selector {
8
8
  padding-top: 5px;
9
9
  }
10
10
  }
@@ -2,83 +2,82 @@
2
2
  @import url('./tableFilter.css');
3
3
  @import url('./tableSlotHeader.css');
4
4
  /* bg color is important; just specify one */
5
- .k-table tr th,
6
- .k-table td:first-child,
7
- .k-table .q-table__top,
8
- .k-table .q-table__bottom,
9
- .k-table .q-table__middle
5
+ .my-table tr th,
6
+ .my-table td:first-child,
7
+ .my-table .q-table__top,
8
+ .my-table .q-table__bottom,
9
+ .my-table .q-table__middle
10
10
  {
11
- background-color: var(--k__main-color);
11
+ background-color: var(--main-color);
12
12
  }
13
-
14
- .k-table tr th {
13
+ .my-table tr th {
15
14
  position: sticky;
16
15
  /* higher than z-index for td below */
17
16
  z-index: 2;
18
17
  }
19
- .k-table thead tr:last-child th {
18
+ .my-table thead tr:last-child th {
20
19
  /* height of all previous header rows */
21
20
  top: 48px;
22
21
  /* highest z-index */
23
22
  z-index: 3;
24
23
  }
25
- .k-table thead tr:first-child th {
24
+ .my-table thead tr:first-child th {
26
25
  top: 0;
27
26
  z-index: 1;
28
27
  }
29
28
 
30
- .k-table tr:first-child th:first-child {
29
+ .my-table tr:first-child th:first-child {
31
30
  /* highest z-index */
32
31
  z-index: 3;
33
32
  }
34
- .k-table td:first-child {
33
+ .my-table td:first-child {
35
34
  z-index: 1;
36
35
  }
37
- .k-table td:first-child,
38
- .k-table th:first-child {
36
+ .my-table td:first-child,
37
+ .my-table th:first-child {
39
38
  position: sticky;
40
39
  left: 0;
41
40
  }
42
- .k-table tbody {
41
+ .my-table tbody {
43
42
  /* height of all previous header rows */
44
43
  scroll-margin-top: 48px;
45
44
  }
46
45
 
47
- .k-table .q-table__control {
46
+ .my-table .q-table__control {
48
47
  width: unset;
49
48
  }
50
- .k-table .q-table th {
49
+ .my-table .q-table th {
51
50
  font-weight: bold;
52
- color: var(--k__black);
51
+ color: var(--black);
53
52
  }
54
53
  @media only screen and (max-width: 1100px) {
55
- .k-table .q-table__grid-content {
54
+ .my-table .q-table__grid-content {
56
55
  overflow: auto;
57
56
  height: 400px;
58
57
  }
59
- .k-table .q-table__top {
58
+ .my-table .q-table__top {
60
59
  padding: 4px 16px;
61
60
  display: flex;
62
61
  width: 100%;
63
62
  }
64
- .k-table .q-table__top:only-child .q-field {
63
+ .my-table .q-table__top:only-child .q-field {
65
64
  flex: 1 0 100%;
66
65
  }
67
66
 
68
- .k-table .q-table__control {
67
+ .my-table .q-table__control {
69
68
  width: 100%;
70
69
  padding: 0;
71
70
  }
72
71
  .q-table--grid .q-table__middle {
73
72
  margin-bottom: 0;
74
73
  }
75
- .k-table .q-table__bottom{
74
+ .my-table .q-table__bottom{
76
75
  border-top: 1px solid rgba(0, 0, 0, 0.12);
77
76
  }
78
- .k-table .q-list--dense > .q-item {
77
+ .my-table .q-list--dense > .q-item {
79
78
  padding: 2px 8px;
80
79
  }
81
- .k-table .q-table__top {
80
+ .my-table .q-table__top {
82
81
  padding: 0 4px;
83
82
  }
84
83
  }
@@ -1,10 +1,9 @@
1
- .table-filter .q-input {
1
+ .table-filter {
2
2
  width: 250px;
3
3
  flex: 1;
4
-
5
4
  }
6
5
  @media only screen and (max-width: 1100px) {
7
- .table-filter .q-input {
6
+ .table-filter {
8
7
  padding-top: 5px;
9
8
  }
10
9
  }
@@ -1,11 +1,10 @@
1
-
2
1
  @media only screen and (max-width: 1100px) {
3
- .table-header .k-table tr:first-child th:first-child {
2
+ .table-header .my-tabletr:first-child th:first-child {
4
3
  padding-left: 5px !important;
5
4
  border-bottom: 1px solid rgba(0, 0, 0, 0.12) !important;
6
5
  }
7
6
 
8
- .table-header .k-table .q-checkbox{
7
+ .table-header .my-table .q-checkbox{
9
8
  float: left;
10
9
  }
11
10
  }
@@ -1,6 +1,6 @@
1
1
  import type { App, Plugin } from 'vue'
2
2
 
3
- import MyTable from './K-Table.vue'
3
+ import MyTable from './Table.vue'
4
4
 
5
5
  import { registerComponent } from '@/utils/plugins'
6
6
 
@@ -12,7 +12,7 @@ const infinitScroll = {
12
12
  const fnAddScroll = (event: Event) => {
13
13
  const { scrollHeight, scrollTop, clientHeight } = event.target as HTMLElement
14
14
  if (Math.abs(scrollHeight - clientHeight - scrollTop) < 1) {
15
- console.log(`[${tableType}] You are at the bottom!`)
15
+ console.log(`[${tableType}] You are at the bottom!`, self.totalPage)
16
16
  self.totalPage++
17
17
  }
18
18
  }
@@ -1,2 +1,2 @@
1
1
  export * from './KMyButton'
2
- export * from './K-Table'
2
+ export * from './Table'
@@ -1,4 +1,4 @@
1
1
  import KMyButton from './KMyButton'
2
- import MyTable from './K-Table'
2
+ import MyTable from './Table'
3
3
  export { KMyButton, MyTable }
4
4
 
package/src/css/app.css CHANGED
@@ -1 +1,26 @@
1
- @import url('../components/K-Table/css/table.css');
1
+ @import url('../components/Table/css/table.css');
2
+ @import url('./fonts.css');
3
+ :root {
4
+ --main-color: #FFF8F2;
5
+ --light-beige: #E3DDD6;
6
+ --light-gray: #727170;
7
+ --dark-gray: #797675;
8
+ --almost-black: #212427;
9
+ --black: #000000;
10
+ --light-peach: #E7C8BE;
11
+ --light-blue: #C7DBF4;
12
+ --light-cream: #FAEBDA;
13
+ --sage-green: #719E8B;
14
+ --light-green:#C3DBBC;
15
+ --positive: #597765;
16
+ --negative: #6F1A07;
17
+ --dusty-rose: #AE928C;
18
+ --main-font-family: 'Beatrice-Regular';
19
+ --secondary-font-family: 'SangBleuKingdom-Light, sans-serif';
20
+ }
21
+ .required-table-columns {
22
+ background-color: var(--light-green);
23
+ }
24
+ .addicional-visible-columns {
25
+ background-color: var(--light-blue);
26
+ }
@@ -0,0 +1,15 @@
1
+ @font-face {
2
+ font-family: 'Beatrice-Regular';
3
+ src: url(./../assets/fonts/Beatrice-Regular.woff2);
4
+ font-display: swap;
5
+ }
6
+ @font-face {
7
+ font-family: 'Beatrice-Medium';
8
+ src: url(./../assets/fonts/Beatrice-Medium.otf);
9
+ font-display: swap;
10
+ }
11
+ @font-face {
12
+ font-family: 'SangBleuKingdom-Light, sans-serif';
13
+ src: url(./../assets/fonts/SangBleuKingdom-Light.otf);
14
+ font-display: swap;
15
+ }
@@ -1,6 +1,18 @@
1
- import translateKeys from '../translateKeys'
1
+ // import translateKeys from '../translateKeys'
2
2
 
3
- const en: translateKeys = {
3
+ // const en: translateKeys = {
4
+ const en = {
4
5
  test: 'Test',
6
+ table: {
7
+ search: 'Search',
8
+ cancel: 'Cancel',
9
+ confirm: 'Save'
10
+ },
11
+ form: {
12
+ rules: {
13
+ emptyField: 'The field cannot be empty',
14
+ exceedCharactersTypeList: 'Field must not exceed {0} characters'
15
+ }
16
+ }
5
17
  }
6
18
  export default en
@@ -1,6 +1,18 @@
1
- import translateKeys from "../translateKeys"
1
+ // import translateKeys from "../translateKeys"
2
2
 
3
- const es: translateKeys = {
4
- test: 'Test'
3
+ // const es: translateKeys = {
4
+ const es = {
5
+ test: 'Test',
6
+ table: {
7
+ search: 'Buscar',
8
+ cancel: 'Cancelar',
9
+ confirm: 'Guardar'
10
+ },
11
+ form: {
12
+ rules: {
13
+ emptyField: 'El campo no puede estar vacío',
14
+ exceedCharactersTypeList: 'El campo no debe exceder más de {0} caracteres'
15
+ }
16
+ }
5
17
  }
6
18
  export default es
package/src/index.ts CHANGED
@@ -4,7 +4,7 @@ import { App, Plugin } from 'vue'
4
4
  import { KMyButton, MyTable } from './components/plugins.ts'
5
5
  import { registerPlugin, setVueInstance } from './utils/plugins.ts'
6
6
  import TranslateKeys from './i18n/translateKeys.ts'
7
-
7
+ import { createPinia } from 'pinia'
8
8
  export { KMyButton, MyTable } from './components/index.ts'
9
9
 
10
10
  export type { TranslateKeys }
@@ -13,6 +13,7 @@ export * from './i18n/messages.js'
13
13
  // Import Quasar css
14
14
  import './css/app.css'
15
15
  import i18n from './i18n'
16
+ const pinia = createPinia()
16
17
 
17
18
  const plugin: Plugin = {
18
19
  install(app: App) {
@@ -21,6 +22,7 @@ const plugin: Plugin = {
21
22
  registerPlugin(app, KMyButton)
22
23
  registerPlugin(app, MyTable)
23
24
  app.use(i18n)
25
+ app.use(pinia)
24
26
  i18n.global.locale = 'en'
25
27
  app.use(Quasar, {
26
28
  plugins: {} // import Quasar plugins and add here
@@ -1,9 +1,9 @@
1
1
  <template>
2
2
  <div class="column full-height justify-center">
3
3
  <q-btn
4
- label="myButton"
4
+ label="myTable"
5
5
  @click="() => {
6
- router.push('')
6
+ router.push('tablePage')
7
7
  }"
8
8
  />
9
9
  </div>
package/src/main.ts CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
  import { Quasar } from 'quasar'
4
4
  import { createApp } from 'vue'
5
+ import { createPinia } from 'pinia'
5
6
  import { createRouter, createWebHashHistory } from 'vue-router'
6
7
  // Import icon libraries
7
8
  import '@quasar/extras/material-icons/material-icons.css'
@@ -18,11 +19,12 @@ import './css/app.css'
18
19
  import i18n from './i18n'
19
20
 
20
21
  const myApp = createApp(App)
21
-
22
+ const pinia = createPinia()
22
23
  myApp.use(Quasar, {
23
24
  plugins: {} // import Quasar plugins and add here
24
25
  })
25
26
  myApp.use(i18n)
27
+ myApp.use(pinia)
26
28
  i18n.global.locale = 'en'
27
29
  function updateLanguage (lang: 'es' | 'en') {
28
30
  i18n.global.locale = lang