pukaad-ui-lib 1.345.0 → 1.346.0

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.
package/dist/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pukaad-ui-lib",
3
3
  "configKey": "pukaadUI",
4
- "version": "1.345.0",
4
+ "version": "1.346.0",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "3.6.1"
@@ -34,7 +34,11 @@ declare var __VLS_13: {
34
34
  index: number;
35
35
  }, __VLS_106: `item-${string}`, __VLS_107: {
36
36
  item: Record<string, any>;
37
- }, __VLS_109: {}, __VLS_117: {};
37
+ }, __VLS_109: {
38
+ item: Record<string, any>;
39
+ index: number;
40
+ colspan: number;
41
+ }, __VLS_111: {}, __VLS_119: {};
38
42
  type __VLS_Slots = {} & {
39
43
  [K in NonNullable<typeof __VLS_41>]?: (props: typeof __VLS_42) => any;
40
44
  } & {
@@ -46,9 +50,11 @@ type __VLS_Slots = {} & {
46
50
  } & {
47
51
  item?: (props: typeof __VLS_97) => any;
48
52
  } & {
49
- empty?: (props: typeof __VLS_109) => any;
53
+ 'row-banner'?: (props: typeof __VLS_109) => any;
54
+ } & {
55
+ empty?: (props: typeof __VLS_111) => any;
50
56
  } & {
51
- 'empty-content'?: (props: typeof __VLS_117) => any;
57
+ 'empty-content'?: (props: typeof __VLS_119) => any;
52
58
  };
53
59
  declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
54
60
  "update:page": (value: number) => any;
@@ -76,6 +76,9 @@ const itemHeaders = computed(() => {
76
76
  );
77
77
  return header;
78
78
  });
79
+ const totalColumns = computed(
80
+ () => itemHeaders.value.length + (props.selectable ? 1 : 0)
81
+ );
79
82
  const sortedItems = computed(() => {
80
83
  return props.items.slice().sort((a, b) => {
81
84
  if (!sortkey.value) return 0;
@@ -197,49 +200,58 @@ const getJustifyClass = (alignment = "start") => {
197
200
 
198
201
  <!-- Data Rows -->
199
202
  <template v-else-if="sortedItems.length > 0">
200
- <ShadTableRow
201
- v-for="(item, i_body) in sortedItems"
202
- :key="i_body"
203
- class="cursor-pointer"
204
- :data-state="
203
+ <template v-for="(item, i_body) in sortedItems" :key="i_body">
204
+ <ShadTableRow
205
+ class="cursor-pointer"
206
+ :data-state="
205
207
  props.selectable && isSelected(item) ? 'selected' : void 0
206
208
  "
207
- @click="emit('click-row', item, i_body)"
208
- >
209
- <!-- Checkbox per row -->
210
- <ShadTableCell v-if="props.selectable" @click.stop>
211
- <div class="flex items-center justify-center">
212
- <InputCheckbox
213
- :model-value="isSelected(item)"
214
- @update:model-value="() => toggleRow(item)"
215
- />
216
- </div>
217
- </ShadTableCell>
218
-
219
- <slot
220
- name="item"
221
- :item="item"
222
- :header="itemHeaders"
223
- :index="i_body"
209
+ @click="emit('click-row', item, i_body)"
224
210
  >
225
- <ShadTableCell
226
- v-for="(header, i_header) in itemHeaders"
227
- :key="i_header"
228
- :class="
211
+ <!-- Checkbox per row -->
212
+ <ShadTableCell v-if="props.selectable" @click.stop>
213
+ <div class="flex items-center justify-center">
214
+ <InputCheckbox
215
+ :model-value="isSelected(item)"
216
+ @update:model-value="() => toggleRow(item)"
217
+ />
218
+ </div>
219
+ </ShadTableCell>
220
+
221
+ <slot
222
+ name="item"
223
+ :item="item"
224
+ :header="itemHeaders"
225
+ :index="i_body"
226
+ >
227
+ <ShadTableCell
228
+ v-for="(header, i_header) in itemHeaders"
229
+ :key="i_header"
230
+ :class="
229
231
  getAlignmentClass(header.alignment || props.cellAlignment)
230
232
  "
231
- :style="{
233
+ :style="{
232
234
  width: header.width ? typeof header.width === 'number' ? `${header.width}px` : header.width : void 0,
233
235
  minWidth: header.minWidth ? typeof header.minWidth === 'number' ? `${header.minWidth}px` : header.minWidth : void 0,
234
236
  maxWidth: header.maxWidth ? typeof header.maxWidth === 'number' ? `${header.maxWidth}px` : header.maxWidth : header.width ? typeof header.width === 'number' ? `${header.width}px` : header.width : header.minWidth ? typeof header.minWidth === 'number' ? `${header.minWidth}px` : header.minWidth : void 0
235
237
  }"
236
- >
237
- <slot :name="`item-${header.key}`" :item="item">
238
- {{ item[header.key] }}
239
- </slot>
240
- </ShadTableCell>
241
- </slot>
242
- </ShadTableRow>
238
+ >
239
+ <slot :name="`item-${header.key}`" :item="item">
240
+ {{ item[header.key] }}
241
+ </slot>
242
+ </ShadTableCell>
243
+ </slot>
244
+ </ShadTableRow>
245
+
246
+ <!-- แถวเสริมเต็มความกว้าง แทรกใต้แถวนี้ — ใช้กับกรณีเช่น banner "กำลังโอนสิทธิ์" (Figma 2779-278256) -->
247
+ <!-- ไม่ระบุ slot นี้ = ไม่มีอะไร render เพิ่ม, consumer เป็นคนคุม v-if ว่าจะโชว์กับ item ไหน -->
248
+ <slot
249
+ name="row-banner"
250
+ :item="item"
251
+ :index="i_body"
252
+ :colspan="totalColumns"
253
+ />
254
+ </template>
243
255
  </template>
244
256
 
245
257
  <!-- Empty State -->
@@ -34,7 +34,11 @@ declare var __VLS_13: {
34
34
  index: number;
35
35
  }, __VLS_106: `item-${string}`, __VLS_107: {
36
36
  item: Record<string, any>;
37
- }, __VLS_109: {}, __VLS_117: {};
37
+ }, __VLS_109: {
38
+ item: Record<string, any>;
39
+ index: number;
40
+ colspan: number;
41
+ }, __VLS_111: {}, __VLS_119: {};
38
42
  type __VLS_Slots = {} & {
39
43
  [K in NonNullable<typeof __VLS_41>]?: (props: typeof __VLS_42) => any;
40
44
  } & {
@@ -46,9 +50,11 @@ type __VLS_Slots = {} & {
46
50
  } & {
47
51
  item?: (props: typeof __VLS_97) => any;
48
52
  } & {
49
- empty?: (props: typeof __VLS_109) => any;
53
+ 'row-banner'?: (props: typeof __VLS_109) => any;
54
+ } & {
55
+ empty?: (props: typeof __VLS_111) => any;
50
56
  } & {
51
- 'empty-content'?: (props: typeof __VLS_117) => any;
57
+ 'empty-content'?: (props: typeof __VLS_119) => any;
52
58
  };
53
59
  declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
54
60
  "update:page": (value: number) => any;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pukaad-ui-lib",
3
- "version": "1.345.0",
3
+ "version": "1.346.0",
4
4
  "description": "pukaad-ui for MeMSG",
5
5
  "repository": {
6
6
  "type": "git",