@tekkare/auriga 0.1.5 → 0.1.7

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.
@@ -3,174 +3,190 @@
3
3
  <arg-search-input
4
4
  v-if="search"
5
5
  v-model:Value="searchKey"
6
- :placeHolderValue="getPlaceHolder"
7
6
  :value="searchKey"
7
+ :placeHolderValue="getPlaceHolder"
8
8
  class="table_input"
9
9
  @submitSearch="searchSubmit = true"
10
10
  />
11
- <div class="rcd_scrollTable">
12
- <table id="rcd_table">
13
- <thead>
14
- <tr>
15
- <th
16
- v-for="(head, keyIndex) in heads"
17
- :key="keyIndex"
18
- :class="[
19
- columnStyle.size && columnStyle.size[keyIndex]
20
- ? `oip_column is-${columnStyle.size[keyIndex]}`
21
- : 'oip_column',
22
- columnStyle.align && columnStyle.align[keyIndex]
23
- ? `column_align ${columnStyle.align[keyIndex]}`
24
- : '',
25
- ]"
26
- >
27
- <div
28
- class="rcd-table-header oip_row gap-8"
29
- :class="
11
+ <div :class="fullTableScroll ? 'full scroll_table' : 'full'">
12
+ <div
13
+ class="rcd_scrollTable"
14
+ :style="fullTableScroll ? `max-height: ${getHeight}` : ''"
15
+ >
16
+ <table id="rcd_table">
17
+ <thead>
18
+ <tr>
19
+ <th
20
+ v-for="(head, keyIndex) in heads"
21
+ :key="keyIndex"
22
+ :class="[
23
+ columnStyle.size && columnStyle.size[keyIndex]
24
+ ? `oip_column is-${columnStyle.size[keyIndex]}`
25
+ : 'oip_column',
30
26
  columnStyle.align && columnStyle.align[keyIndex]
31
27
  ? `column_align ${columnStyle.align[keyIndex]}`
32
- : ''
33
- "
28
+ : '',
29
+ ]"
34
30
  >
35
- <div class="rcd-col-title">
36
- <p>{{ head }}</p>
37
- </div>
38
31
  <div
39
- v-if="head !== 'More'"
40
- class="rcd-table-sort"
41
- @click="sortDatas(keyIndex)"
42
- v-show="sort"
32
+ class="rcd-table-header oip_row gap-8"
33
+ :class="
34
+ columnStyle.align && columnStyle.align[keyIndex]
35
+ ? `column_align ${columnStyle.align[keyIndex]}`
36
+ : ''
37
+ "
43
38
  >
44
- <arg-icon
45
- name="CaretUp"
46
- :color="changeColorAsc(keyIndex)"
47
- size="12"
48
- class="sort_up_icon"
49
- thickness="36"
50
- ></arg-icon>
51
- <arg-icon
52
- name="CaretDown"
53
- :color="changeColorDesc(keyIndex)"
54
- size="12"
55
- class="sort_down_icon"
56
- thickness="36"
57
- ></arg-icon>
39
+ <div class="rcd-col-title">
40
+ <!--<arg-icon :name="searchBox(keyIndex)" :color="setSearchBox(keyIndex)" size="12" @click="setSearchColumn(keyIndex)" /> -->
41
+ <p>{{ head }}</p>
42
+ </div>
43
+ <div
44
+ v-if="head !== 'More'"
45
+ class="rcd-table-sort"
46
+ @click="sortDatas(keyIndex)"
47
+ v-show="sort"
48
+ >
49
+ <arg-icon
50
+ name="CaretUp"
51
+ :color="changeColorAsc(keyIndex)"
52
+ size="12"
53
+ class="sort_up_icon"
54
+ thickness="36"
55
+ ></arg-icon>
56
+ <arg-icon
57
+ name="CaretDown"
58
+ :color="changeColorDesc(keyIndex)"
59
+ size="12"
60
+ class="sort_down_icon"
61
+ thickness="36"
62
+ ></arg-icon>
63
+ </div>
64
+ <arg-tooltip
65
+ v-if="tooltipHeader[keyIndex]"
66
+ :tooltip-text="tooltipHeader[keyIndex]"
67
+ dir="bottom"
68
+ class="filter_tooltip"
69
+ :sideLimit="keyIndex === heads.length - 1"
70
+ >
71
+ <arg-icon name="Info" size="16" color="var(--primary)" />
72
+ </arg-tooltip>
58
73
  </div>
59
- <arg-tooltip
60
- v-if="tooltipHeader[keyIndex]"
61
- :tooltip-text="tooltipHeader[keyIndex]"
62
- dir="bottom"
63
- class="filter_tooltip"
64
- :sideLimit="keyIndex === heads.length - 1"
65
- >
66
- <arg-icon name="Info" size="16" color="var(--primary)" />
67
- </arg-tooltip>
68
- </div>
69
- </th>
70
- </tr>
71
- </thead>
72
- <tbody v-if="finalTable.length > 0">
73
- <template
74
- v-for="(content, contIndex, rowIndex) in finalTable"
75
- :key="contIndex"
76
- >
77
- <tr
78
- :id="`${contIndex}-row`"
79
- :class="isOdd(contIndex) ? 'white_bg' : 'grey_bg'"
74
+ </th>
75
+ </tr>
76
+ </thead>
77
+ <tbody v-if="finalTable.length > 0 && !loadingData">
78
+ <template
79
+ v-for="(content, contIndex, rowIndex) in finalTable"
80
+ :key="contIndex"
80
81
  >
81
- <td
82
- v-for="(value, valIndex) in content"
83
- :key="valIndex"
84
- :class="[
85
- { 'rcd-NA': isNA(value) },
86
- columnStyle.align && columnStyle.align[valIndex]
87
- ? `column_align ${columnStyle.align[valIndex]}`
88
- : '',
89
- ]"
82
+ <tr
83
+ :id="`${contIndex}-row`"
84
+ :class="isOdd(contIndex) ? 'white_bg' : 'grey_bg'"
90
85
  >
91
- <arg-icon
92
- v-if="columnTypeNonProps[valIndex] === 'More'"
93
- name="CaretCircleRight"
94
- @click.native="openLine(contIndex)"
86
+ <td
87
+ v-for="(value, valIndex) in content"
88
+ :key="valIndex"
95
89
  :class="[
96
- 'icon-show-more',
97
- showLine === contIndex ? 'icon_rotate' : '',
90
+ { 'rcd-NA': isNA(value) },
91
+ columnStyle.align && columnStyle.align[valIndex]
92
+ ? `column_align ${columnStyle.align[valIndex]}`
93
+ : '',
98
94
  ]"
99
- />
100
- <slot
101
- v-if="columnTypeNonProps[valIndex] !== ''"
102
- :name="columnTypeNonProps[valIndex]"
103
- v-bind:value="value"
104
- ></slot>
105
- <p v-else>{{ value }}</p>
106
- </td>
107
- </tr>
108
- <tr
109
- v-if="showLine === contIndex"
110
- class="more_row"
111
- :key="rowIndex"
112
- :class="greyBG(contIndex) ? 'grey_bg' : 'white_bg'"
113
- >
114
- <td class="more_section" :colspan="heads.length.toString()">
115
- <slot name="showMore" v-bind:value="contIndex" />
116
- </td>
117
- </tr>
118
- </template>
119
- </tbody>
120
- </table>
121
- <div v-if="finalTable.length === 0" class="empty_table">
122
- <arg-no-data :text="noDataValues[0]" :sub-text="noDataValues[1]" />
123
- </div>
124
- <div v-else-if="loadingData" class="empty_table">
125
- <arg-tekkare-loader v-if="loaderType === 'tekkare'" />
126
- <arg-data-loader v-else />
127
- </div>
128
- <div
129
- v-if="saveTable.length > savePageSize && finalTable.length > 0"
130
- :class="`rcd-datas align-${pagesPosition}`"
131
- >
132
- <div @click="prevPage" class="rcd-pagination-navigate">
133
- <arg-icon
134
- name="CaretLeft"
135
- color="var(--independance)"
136
- size="20"
137
- ></arg-icon>
95
+ >
96
+ <arg-icon
97
+ v-if="columnTypeNonProps[valIndex] === 'More'"
98
+ name="CaretCircleRight"
99
+ @click="openLine(contIndex)"
100
+ :class="[
101
+ 'icon-show-more',
102
+ showLine === contIndex ? 'icon_rotate' : '',
103
+ ]"
104
+ />
105
+ <slot
106
+ v-if="columnTypeNonProps[valIndex] !== ''"
107
+ :name="columnTypeNonProps[valIndex]"
108
+ v-bind:value="value"
109
+ ></slot>
110
+ <p v-else>{{ value }}</p>
111
+ </td>
112
+ </tr>
113
+ <tr
114
+ v-if="showLine === contIndex"
115
+ class="more_row"
116
+ :key="rowIndex"
117
+ :class="greyBG(contIndex) ? 'grey_bg' : 'white_bg'"
118
+ >
119
+ <td class="more_section" :colspan="heads.length.toString()">
120
+ <slot name="showMore" v-bind:value="contIndex" />
121
+ </td>
122
+ </tr>
123
+ </template>
124
+ </tbody>
125
+ </table>
126
+ <div v-if="finalTable.length === 0" class="empty_table">
127
+ <arg-no-data :text="noDataValues[0]" :sub-text="noDataValues[1]" />
128
+ </div>
129
+ <div v-else-if="loadingData" class="empty_table">
130
+ <arg-tekkare-loader v-if="loaderType === 'tekkare'" />
131
+ <arg-data-loader v-else />
138
132
  </div>
139
133
  <div
140
- v-for="(pageNumber, pageIndex) in totalPages"
141
- :key="pageIndex"
142
- class="rcd-rows"
134
+ v-if="
135
+ !fullTableScroll &&
136
+ saveTable.length > savePageSize &&
137
+ finalTable.length > 0
138
+ "
139
+ :class="`rcd-datas align-${pagesPosition}`"
143
140
  >
144
- <p v-show="!showPage(pageNumber) && limitB(pageNumber)">...</p>
145
- <p
146
- class="rcd-pagination"
147
- v-show="showPage(pageNumber)"
148
- @click="setPage(pageNumber)"
149
- :class="{ 'rcd-current': currentPage === pageNumber }"
141
+ <div @click="prevPage" class="rcd-pagination-navigate">
142
+ <arg-icon
143
+ name="CaretLeft"
144
+ color="var(--independance)"
145
+ size="20"
146
+ ></arg-icon>
147
+ </div>
148
+ <div
149
+ v-for="(pageNumber, pageIndex) in totalPages"
150
+ :key="pageIndex"
151
+ :class="
152
+ !showPage(pageNumber) &&
153
+ !limitB(pageNumber) &&
154
+ !limitA(pageNumber)
155
+ ? 'hidden rcd-rows'
156
+ : 'rcd-rows'
157
+ "
150
158
  >
151
- {{ pageNumber }}
152
- </p>
153
- <p v-show="!showPage(pageNumber) && limitA(pageNumber)">...</p>
154
- </div>
155
- <div @click="nextPage" class="rcd-pagination-navigate">
156
- <arg-icon
157
- name="CaretRight"
158
- color="var(--independance)"
159
- size="20"
160
- ></arg-icon>
159
+ <p v-show="!showPage(pageNumber) && limitB(pageNumber)">...</p>
160
+ <p
161
+ class="rcd-pagination"
162
+ v-show="showPage(pageNumber)"
163
+ @click="setPage(pageNumber)"
164
+ :class="{ 'rcd-current': currentPage === pageNumber }"
165
+ >
166
+ {{ pageNumber }}
167
+ </p>
168
+ <p v-show="!showPage(pageNumber) && limitA(pageNumber)">...</p>
169
+ </div>
170
+ <div @click="nextPage" class="rcd-pagination-navigate">
171
+ <arg-icon
172
+ name="CaretRight"
173
+ color="var(--independance)"
174
+ size="20"
175
+ ></arg-icon>
176
+ </div>
161
177
  </div>
162
178
  </div>
163
179
  </div>
164
180
  <div class="show_full_table">
165
181
  <arg-btn
166
182
  v-if="
167
- (saveTable.length > savePageSize || showFull) &&
183
+ (saveTable.length > savePageSize || this.showFull) &&
168
184
  finalTable.length > 0 &&
169
185
  showToggle
170
186
  "
171
187
  btn-style="skeleton"
172
188
  prefix-icon="Table"
173
- @click.native="showFull = !showFull"
189
+ @click="showFull = !showFull"
174
190
  >{{ showFull ? "Show with pagination" : "Show full table" }}</arg-btn
175
191
  >
176
192
  </div>
@@ -252,6 +268,14 @@ export default defineComponent({
252
268
  loaderType: {
253
269
  type: String,
254
270
  default: "data"
271
+ },
272
+ fullTableScroll: {
273
+ type: Boolean,
274
+ default: true
275
+ },
276
+ maxHeight: {
277
+ type: [String, Number],
278
+ default: "300"
255
279
  }
256
280
  },
257
281
  setup(props) {
@@ -440,6 +464,12 @@ export default defineComponent({
440
464
  }
441
465
  return result;
442
466
  });
467
+ const getHeight = computed(() => {
468
+ if (typeof props.maxHeight === "string" && props.maxHeight.includes("px")) {
469
+ return props.maxHeight;
470
+ } else
471
+ return `${props.maxHeight.toString()}px`;
472
+ });
443
473
  const filteredTable = computed(() => {
444
474
  if (props.searchFullWord && searchSubmit.value === false || !props.searchFullWord && searchKey.value.length === 0) {
445
475
  return dataValues.value;
@@ -545,6 +575,12 @@ export default defineComponent({
545
575
  searchIndex.value = null;
546
576
  savePageSize.value = props.pageSize;
547
577
  showToggle.value = props.toggleDisplay;
578
+ if (props.fullTableScroll) {
579
+ savePageSize.value = saveTable.value.length;
580
+ } else {
581
+ savePageSize.value = props.pageSize;
582
+ showToggle.value = props.toggleDisplay;
583
+ }
548
584
  return {
549
585
  sortCol,
550
586
  sortDir,
@@ -581,7 +617,8 @@ export default defineComponent({
581
617
  finalTable,
582
618
  resultCount,
583
619
  totalPages,
584
- getPlaceHolder
620
+ getPlaceHolder,
621
+ getHeight
585
622
  };
586
623
  }
587
624
  });
@@ -835,7 +872,7 @@ th:last-child div.show .rcd-searchInput {
835
872
  background: var(--demi-fond) !important;
836
873
  }
837
874
  .white_bg,
838
- .white_bg td {
875
+ .white_bg > td {
839
876
  background: var(--pure-white) !important;
840
877
  }
841
878
  .icon-show-more {
@@ -849,4 +886,27 @@ th:last-child div.show .rcd-searchInput {
849
886
  transform: rotate(90deg);
850
887
  color: var(--primary) !important;
851
888
  }
889
+ .scroll_table .rcd_scrollTable table thead,
890
+ .scroll_table .rcd_scrollTable table thead tr,
891
+ .scroll_table .rcd_scrollTable table thead tr th {
892
+ position: sticky !important;
893
+ top: 0 !important;
894
+ }
895
+
896
+ .scroll_table .rcd_scrollTable thead {
897
+ background: var(--pure-white) !important;
898
+ z-index: 98;
899
+ }
900
+
901
+ .scroll_table .rcd_scrollTable {
902
+ overflow-y: scroll;
903
+ padding-top: 0px !important;
904
+ }
905
+
906
+ .full {
907
+ width: 100%;
908
+ }
909
+ .hidden {
910
+ display: none !important;
911
+ }
852
912
  </style>
@@ -140,6 +140,14 @@ declare const _default: import("vue").DefineComponent<{
140
140
  type: StringConstructor;
141
141
  default: string;
142
142
  };
143
+ fullTableScroll: {
144
+ type: BooleanConstructor;
145
+ default: boolean;
146
+ };
147
+ maxHeight: {
148
+ type: (StringConstructor | NumberConstructor)[];
149
+ default: string;
150
+ };
143
151
  }, {
144
152
  sortCol: import("vue").Ref<any>;
145
153
  sortDir: import("vue").Ref<any>;
@@ -177,6 +185,7 @@ declare const _default: import("vue").DefineComponent<{
177
185
  resultCount: import("vue").ComputedRef<any>;
178
186
  totalPages: import("vue").ComputedRef<number>;
179
187
  getPlaceHolder: import("vue").ComputedRef<string>;
188
+ getHeight: import("vue").ComputedRef<string>;
180
189
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
181
190
  heads: {
182
191
  type: {
@@ -319,6 +328,14 @@ declare const _default: import("vue").DefineComponent<{
319
328
  type: StringConstructor;
320
329
  default: string;
321
330
  };
331
+ fullTableScroll: {
332
+ type: BooleanConstructor;
333
+ default: boolean;
334
+ };
335
+ maxHeight: {
336
+ type: (StringConstructor | NumberConstructor)[];
337
+ default: string;
338
+ };
322
339
  }>>, {
323
340
  sort: boolean;
324
341
  search: boolean;
@@ -334,5 +351,7 @@ declare const _default: import("vue").DefineComponent<{
334
351
  noDataValues: unknown[];
335
352
  loadingData: boolean;
336
353
  loaderType: string;
354
+ fullTableScroll: boolean;
355
+ maxHeight: string | number;
337
356
  }, {}>;
338
357
  export default _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tekkare/auriga",
3
- "version": "0.1.5",
3
+ "version": "0.1.7",
4
4
  "description": "Aurgia is a UI kit developped by Tekkare",
5
5
  "license": "MIT",
6
6
  "type": "module",