@mixd-id/web-scaffold 0.1.240411052 → 0.1.240411054

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/log.txt ADDED
@@ -0,0 +1,7 @@
1
+ [2025-06-28 16:30:51]
2
+ POST https://198.168.4.239/ksapisvr
3
+ --
4
+ {"api_jsonkolnss":[{"Request":"HASIL","attempt":"0","noBukti":"KSSOE312506000008745","noHP":"085339156956","linkFoto":"https://www.kliknss.co.id/images/kols/097da1af5ef3f112e6ce0d771bdcbeda.jpg","lat":"-10.0409983","long":"124.5253983","jamFoto":"14:02:09","statusKunjungan":"3","lokasiKunjungan":"05","bertemuDengan":"org tua","hubDenganKonsumen":"KELUARGA","konsBayarTarik":"1","tanggalJanjiBayar":"","tanggalKunjunganUlang":"","penyebabKonsTidakBayar":"","historisKons":"","noHPKons":"08552364562","alamatRumahSkr":"desa takarii","keberadaanKonsumen":"01","pekerjaanSkr":"AG","subPekerjaan":"63","unitBisaDiFoto":"Y","keberadaanUnit":"11","klasifikasiKons":"999","layakTdkLayak":"","latMulai":"-10.0408867","lonMulai":"124.5252633","latSampai":"-10.0409114","lonSampai":"124.5252886","latSelesai":"-10.0409983","lonSelesai":"124.5253983","jamMulai":"13:58:54","jamSampai":"13:59:11","jamSelesai":"13:59:14","linkFotoBerkas":"https://www.kliknss.co.id/images/kols/9dbec61757412e358e9a68013aa80f25.jpg","jamKirim":"2025-06-28 16:51:04.695692","tempatDikunjungi":"rmh org tya","hariLuang":"Senin","jamLuang":"10:00 - 12:00","kodePelacakan":"","latFotoPelacakan":"","longFotoPelacakan":"","jamFotoPelacakan":"","provPelacakan":"","kotaPelacakan":"","kecPelacakan":"","kelPelacakan":"","kodePosPelacakan":"","alamatPelacakan":"","provPemegangUnit":"","kotaPemegangUnit":"","kecPemegangUnit":"","kelPemegangUnit":"","kodePosPemegangUnit":"","alamatPemegangUnit":"","hubPemegangUnit":"","hubPemegangUnitLainnya":"","namaPemegangUnit":"","ketTidakTerlacak":"","Suspect":"TIDAK","KetKunjKolvsAlmtagih":"TIDAK SESUAI","JrkKunjKolvsAlmtagih":"29652.31661401902","KetKunjKolvsResurvey":"TIDAK SESUAI","JrkKunjKolvsResurvey":"29652.31661401902","KetKunjKolvsSurvey":"TIDAK SESUAI","JrkKunjKolvsSurvey":"32674.530270079635","KetKunjKolvsTmptKerja":"TIDAK SESUAI","JrkKunjKolvsTmptKerja":"32674.530270079635","KetKunjKolvsKelSurvey":"TIDAK SESUAI","JrkKunjKolvsKelSurvey":"52918.18337137214"}]}
5
+
6
+ E================ t= 61ms
7
+ {"status":-1,"message":"ap_rdjsn gagal, response=master label di program tidak ditemukan/tidak urut di jawaban server","data":"ap_rdjsn gagal, response=master label di program tidak ditemukan/tidak urut di jawaban server "}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mixd-id/web-scaffold",
3
3
  "private": false,
4
- "version": "0.1.240411052",
4
+ "version": "0.1.240411054",
5
5
  "scripts": {
6
6
  "dev": "vite serve",
7
7
  "build": "vite build",
@@ -11,12 +11,23 @@
11
11
  </div>
12
12
  </div>
13
13
 
14
- <div v-if="items && items.length > 1" :class="$style.carouselNext" @click="next(true)">
15
- <slot name="next"></slot>
14
+ <div v-if="useNextPrev && items && items.length > 1" :class="$style.carouselNext" @click="next(true)">
15
+ <slot name="next">
16
+ <div class="p-3">
17
+ <button :class="$style.btn">
18
+ <svg :class="$style.btnSvg" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--! Font Awesome Pro 6.0.0-alpha3 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) --><path d="M438.6 278.6l-160 160C272.4 444.9 264.2 448 256 448s-16.38-3.125-22.62-9.375c-12.5-12.5-12.5-32.75 0-45.25L338.8 288H32C14.33 288 .0016 273.7 .0016 256S14.33 224 32 224h306.8l-105.4-105.4c-12.5-12.5-12.5-32.75 0-45.25s32.75-12.5 45.25 0l160 160C451.1 245.9 451.1 266.1 438.6 278.6z"/></svg>
19
+ </button>
20
+ </div>
21
+ </slot>
16
22
  </div>
17
23
 
18
- <div v-if="items && items.length > 1" :class="$style.carouselPrev" @click="prev">
24
+ <div v-if="useNextPrev && items && items.length > 1" :class="$style.carouselPrev" @click="prev">
19
25
  <slot name="prev">
26
+ <div class="p-3">
27
+ <button :class="$style.btn">
28
+ <svg :class="$style.btnSvg" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--! Font Awesome Pro 6.0.0-alpha3 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) --><path d="M447.1 256C447.1 273.7 433.7 288 416 288H109.3l105.4 105.4c12.5 12.5 12.5 32.75 0 45.25C208.4 444.9 200.2 448 192 448s-16.38-3.125-22.62-9.375l-160-160c-12.5-12.5-12.5-32.75 0-45.25l160-160c12.5-12.5 32.75-12.5 45.25 0s12.5 32.75 0 45.25L109.3 224H416C433.7 224 447.1 238.3 447.1 256z"/></svg>
29
+ </button>
30
+ </div>
20
31
  </slot>
21
32
  </div>
22
33
 
@@ -55,6 +66,8 @@ export default{
55
66
 
56
67
  useLegend: [ Boolean, Number ],
57
68
 
69
+ useNextPrev: [ Boolean, Number ],
70
+
58
71
  },
59
72
 
60
73
  emits: [ 'change' ],
@@ -301,6 +314,7 @@ export default{
301
314
  .comp{
302
315
  overflow: hidden;
303
316
  position: relative;
317
+ @apply flex flex-col;
304
318
  }
305
319
 
306
320
  .comp img{
@@ -308,11 +322,11 @@ export default{
308
322
  }
309
323
 
310
324
  .carouselNext{
311
- @apply absolute top-0 bottom-0 right-0 w-[20px];
325
+ @apply absolute top-0 bottom-0 right-0 flex items-center justify-center;
312
326
  }
313
327
 
314
328
  .carouselPrev{
315
- @apply absolute top-0 bottom-0 left-0 w-[20px];
329
+ @apply absolute top-0 bottom-0 left-0 flex items-center justify-center;
316
330
  }
317
331
 
318
332
  .inner{
@@ -338,5 +352,12 @@ export default{
338
352
  @apply bg-primary-500;
339
353
  }
340
354
 
355
+ .btn{
356
+ @apply w-[32px] h-[32px] md:w-[48px] md:h-[48px] rounded-full bg-black/50 flex items-center justify-center opacity-50 hover:opacity-70;
357
+ }
358
+ .btnSvg{
359
+ @apply w-[19px] h-[19px] md:w-[32px] md:h-[32px] fill-white/70 hover:fill-white/90;
360
+ }
361
+
341
362
 
342
363
  </style>
@@ -141,7 +141,7 @@ export default {
141
141
  }
142
142
 
143
143
  .comp label{
144
- @apply flex flex-row items-start gap-2;
144
+ @apply flex flex-row items-start;
145
145
  }
146
146
 
147
147
  .comp label *{
@@ -244,7 +244,7 @@ export default {
244
244
  .contextMenu{
245
245
  @apply fixed bg-base-300 min-w-[150px] overflow-y-auto rounded-xl;
246
246
  @apply whitespace-nowrap shadow-2xl border-[1px] border-text-100 mt-[1px];
247
- z-index: 150;
247
+ z-index: 180;
248
248
  }
249
249
 
250
250
  @media screen and (min-width: 640px){
@@ -128,13 +128,16 @@
128
128
  <svg class="animate-spin" width="36" height="36" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle><path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path></svg>
129
129
  </div>
130
130
 
131
- <div v-else-if="presetView === 'table' || pivotEnabled" class="flex-1 flex" :class="pivotEnabled ? 'p-3 panel-400 md:p-0' : ''">
131
+ <div v-else-if="presetView === 'table' || pivotEnabled" class="flex-1 flex flex-col" :class="pivotEnabled ? 'p-3 panel-400 md:p-0' : ''">
132
132
  <VirtualTable
133
133
  ref="table"
134
134
  :columns="columns"
135
135
  class="flex-1 bg-base-300"
136
136
  :items="dataItems"
137
137
  :enumCache="enumCache"
138
+ :freeze-left="freezeLeft"
139
+ @freeze="freeze"
140
+ @unfreeze="unfreeze"
138
141
  @scroll-end="loadNext"
139
142
  @item-click="onTableItemClick">
140
143
 
@@ -439,7 +442,7 @@ export default{
439
442
  }
440
443
  }
441
444
  else{
442
- const defaultConfig = setupConfig(await this.defaultConfig())
445
+ const defaultConfig = setupConfig(typeof this.defaultConfig === 'function' ? await this.defaultConfig() : {})
443
446
  Object.assign(this.cConfig, defaultConfig)
444
447
 
445
448
  return new Promise(resolve => resolve())
@@ -853,6 +856,26 @@ export default{
853
856
  }
854
857
 
855
858
  }
859
+ },
860
+
861
+ freeze(key){
862
+ const freezed = this.columns.find(_ => _.freeze)
863
+ if(freezed){
864
+ delete freezed.freeze
865
+ }
866
+
867
+ const column = this.columns.find(_ => _.key === key)
868
+ if(column){
869
+ column.freeze = true
870
+ }
871
+ },
872
+
873
+ unfreeze(key){
874
+
875
+ const column = this.columns.find(_ => _.key === key)
876
+ if(column){
877
+ delete column.freeze
878
+ }
856
879
  }
857
880
 
858
881
  },
@@ -1079,6 +1102,10 @@ export default{
1079
1102
 
1080
1103
  computedSrc(){
1081
1104
  return this.src ?? `${this.controller}.load`
1105
+ },
1106
+
1107
+ freezeLeft(){
1108
+ return (this.preset?.columns).findIndex(_ => _.freeze) + 1
1082
1109
  }
1083
1110
 
1084
1111
  },
@@ -5,11 +5,15 @@
5
5
  <table :class="$style.table">
6
6
  <thead>
7
7
  <tr>
8
- <th v-for="column in freezeLeftColumns" :style="thStyle(column)" :class="thClass(column)"
8
+ <th v-for="column in freezeLeftColumns"
9
+ :ref="`column${column.key}`"
10
+ :style="thStyle(column)"
11
+ :class="`${$style.freezed} ${thClass(column)}`"
9
12
  v-tooltip="column.tooltip">
10
- <slot v-if="$slots['col-' + column.key]" :name="'col-' + column.key" :column="column"></slot>
11
- <div v-else :class="headerColumnClass(column)">
12
- <span>{{ column.label2 ? column.label2 : (column.label ?? column.key) }}</span>
13
+ <div :class="headerColumnClass(column)"
14
+ @click="$refs.columnMenu.open($refs[`column${column.key}`][0], { key:column.key, freeze:column.freeze })">
15
+ <slot v-if="$slots['col-' + column.key]" :name="'col-' + column.key" :column="column"></slot>
16
+ <span v-else>{{ column.label2 ? column.label2 : (column.label ?? column.key) }}</span>
13
17
  </div>
14
18
  <div :class="$style.separator" @mousedown="startResize($event, column)"></div>
15
19
  </th>
@@ -21,11 +25,15 @@
21
25
  <table :class="$style.table" ref="tableHead" :style="tableHeadStyle">
22
26
  <thead>
23
27
  <tr>
24
- <th v-for="column in unfreezedColumns" :style="thStyle(column)" :class="thClass(column)"
28
+ <th v-for="column in unfreezedColumns"
29
+ :ref="`column${column.key}`"
30
+ :style="thStyle(column)"
31
+ :class="thClass(column)"
25
32
  v-tooltip="column.tooltip">
26
- <slot v-if="$slots['col-' + column.key]" :name="'col-' + column.key" :column="column"></slot>
27
- <div v-else :class="headerColumnClass(column)">
28
- <span>{{ column.label2 ? column.label2 : (column.label ?? column.key) }}</span>
33
+ <div :class="headerColumnClass(column)"
34
+ @click="$refs.columnMenu.open($refs[`column${column.key}`][0], { key:column.key, freeze:column.freeze })">
35
+ <slot v-if="$slots['col-' + column.key]" :name="'col-' + column.key" :column="column"></slot>
36
+ <span v-else>{{ column.label2 ? column.label2 : (column.label ?? column.key) }}</span>
29
37
  </div>
30
38
  <div :class="$style.separator" @mousedown="startResize($event, column)"></div>
31
39
  </th>
@@ -34,6 +42,32 @@
34
42
  </thead>
35
43
  </table>
36
44
  </div>
45
+
46
+ <ContextMenu ref="columnMenu" position="bottom-left" class="mt-2 rounded-md">
47
+ <template #default="{ context }">
48
+ <div class="flex flex-col min-w-[200px] min-h-[160px]">
49
+
50
+ <br />
51
+
52
+ <button v-if="!context?.freeze" class="w-full p-2 border-y-[1px] border-text-50 text-left flex flex-row px-3 items-center menu-item"
53
+ @click="freeze(context.key)">
54
+ <div class="w-[24px]">
55
+ <svg width="14" height="14" class="fill-text" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--! Font Awesome Pro 6.0.0-alpha3 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) --><path d="M105.4 182.6c12.5 12.49 32.76 12.5 45.25 .001L224 109.3V352c0 17.67 14.33 32 32 32c17.67 0 32-14.33 32-32V109.3l73.38 73.38c12.49 12.49 32.75 12.49 45.25-.001c12.49-12.49 12.49-32.75 0-45.25l-128-128C272.4 3.125 264.2 0 256 0S239.6 3.125 233.4 9.375L105.4 137.4C92.88 149.9 92.88 170.1 105.4 182.6zM480 352h-160c0 35.35-28.65 64-64 64s-64-28.65-64-64H32c-17.67 0-32 14.33-32 32v96c0 17.67 14.33 32 32 32h448c17.67 0 32-14.33 32-32v-96C512 366.3 497.7 352 480 352zM432 456c-13.2 0-24-10.8-24-24c0-13.2 10.8-24 24-24s24 10.8 24 24C456 445.2 445.2 456 432 456z"/></svg>
56
+ </div>
57
+ Freeze
58
+ </button>
59
+
60
+ <button v-else class="w-full p-2 border-y-[1px] border-text-50 text-left flex flex-row px-3 items-center menu-item"
61
+ @click="unfreeze(context.key)">
62
+ <div class="w-[24px]">
63
+ <svg width="14" height="14" class="fill-text" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--! Font Awesome Pro 6.0.0-alpha3 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) --><path d="M105.4 182.6c12.5 12.49 32.76 12.5 45.25 .001L224 109.3V352c0 17.67 14.33 32 32 32c17.67 0 32-14.33 32-32V109.3l73.38 73.38c12.49 12.49 32.75 12.49 45.25-.001c12.49-12.49 12.49-32.75 0-45.25l-128-128C272.4 3.125 264.2 0 256 0S239.6 3.125 233.4 9.375L105.4 137.4C92.88 149.9 92.88 170.1 105.4 182.6zM480 352h-160c0 35.35-28.65 64-64 64s-64-28.65-64-64H32c-17.67 0-32 14.33-32 32v96c0 17.67 14.33 32 32 32h448c17.67 0 32-14.33 32-32v-96C512 366.3 497.7 352 480 352zM432 456c-13.2 0-24-10.8-24-24c0-13.2 10.8-24 24-24s24 10.8 24 24C456 445.2 445.2 456 432 456z"/></svg>
64
+ </div>
65
+ Unfreeze
66
+ </button>
67
+
68
+ </div>
69
+ </template>
70
+ </ContextMenu>
37
71
  </div>
38
72
 
39
73
  <div ref="cont" class="flex-1 overflow-y-auto" @scroll.passive="handleScroll">
@@ -136,11 +170,12 @@
136
170
  <div v-else-if="Array.isArray(cItems) && cItems.length <= 0" class="text-center p-3 flex-1 min-h-[100%] flex items-center justify-center">
137
171
  <h5 class="text-text-300">No data available</h5>
138
172
  </div>
139
- <slot name="end"></slot>
140
173
  </div>
141
174
 
142
175
  </div>
143
176
 
177
+ <slot name="end"></slot>
178
+
144
179
  <div :class="$style.calc" v-if="visibleColumns.length > 0 && cItems && cItems.length > 0" ref="calc">
145
180
  <table :class="$style.table">
146
181
  <tbody>
@@ -172,7 +207,7 @@ export default{
172
207
 
173
208
  inject: [ 'emitRoot', 'listStyle' ],
174
209
 
175
- emits: [ 'scroll-end', 'item-click' ],
210
+ emits: [ 'freeze', 'unfreeze', 'scroll-end', 'item-click' ],
176
211
 
177
212
  props:{
178
213
 
@@ -405,9 +440,24 @@ export default{
405
440
  thClass(column){
406
441
  let classNames = []
407
442
 
443
+ let align
408
444
  if(column.align){
409
- classNames.push(`text-${column.align}`)
445
+ align = column.align
446
+ }
447
+ else{
448
+ switch(column.type){
449
+ case 'currency':
450
+ case 'number':
451
+ align = 'right'
452
+ break
453
+
454
+ default:
455
+ if(column.key.startsWith('_'))
456
+ align = 'center'
457
+ break
458
+ }
410
459
  }
460
+ classNames.push(`text-${align}`)
411
461
 
412
462
  return classNames.join(' ')
413
463
  },
@@ -691,11 +741,18 @@ export default{
691
741
  switch(column.type){
692
742
 
693
743
  case 'date':
744
+ case 'datetime':
694
745
  dateFormat = column.format ?? 'D MMM YY HH:mm:ss'
695
746
  val = dayjs(value)
696
747
  text = val.isValid() ? val.format(dateFormat) : value
697
748
  break
698
749
 
750
+ case 'time':
751
+ dateFormat = column.format ?? ' HH:mm:ss'
752
+ val = dayjs(value)
753
+ text = val.isValid() ? val.format(dateFormat) : value
754
+ break
755
+
699
756
  case 'currency':
700
757
  const num = parseInt(value)
701
758
  text = !isNaN(num) ? num.toLocaleString() : ''
@@ -729,7 +786,15 @@ export default{
729
786
 
730
787
  setState(state){
731
788
  this.state = state
732
- }
789
+ },
790
+
791
+ freeze(key){
792
+ this.$emit('freeze', key)
793
+ },
794
+
795
+ unfreeze(key){
796
+ this.$emit('unfreeze', key)
797
+ }
733
798
 
734
799
  },
735
800
 
@@ -882,4 +947,8 @@ export default{
882
947
  @apply px-3 uppercase font-bold;
883
948
  }
884
949
 
950
+ .freezed{
951
+ @apply bg-base-500;
952
+ }
953
+
885
954
  </style>
@@ -40,6 +40,12 @@
40
40
  <Checkbox v-model="item.props.useLegend" @change="apply"/>
41
41
  </div>
42
42
  </div>
43
+ <div>
44
+ <label class="text-text-400">Prev/Next</label>
45
+ <div class="mt-1">
46
+ <Checkbox v-model="item.props.useNextPrev" @change="apply"/>
47
+ </div>
48
+ </div>
43
49
  <div>
44
50
  <label class="text-text-400">Infinite</label>
45
51
  <div class="mt-1">
@@ -1,11 +1,13 @@
1
1
  <template>
2
2
  <div :class="$style.comp">
3
3
 
4
- <div>
5
- <label class="text-text-400">Video URL</label>
6
- <Textbox v-model="item.props.videoUrl"
7
- @keyup.enter="$emit('change')" />
8
- </div>
4
+ <div class="p-6 py-4 flex flex-col gap-4">
5
+ <div>
6
+ <label class="text-text-400">Video URL</label>
7
+ <Textbox v-model="item.props.videoUrl"
8
+ @keyup.enter="$emit('change')" />
9
+ </div>
10
+ </div>
9
11
 
10
12
  <ComponentSetting2 :item="item"
11
13
  :view-type="viewType"
@@ -400,10 +400,14 @@ export default{
400
400
  ['Montserrat', 'Montserrat, sans-serif'],
401
401
  ['Noto Sans', '"Noto Sans", sans-serif'],
402
402
  ['Oswald', 'Oswald, sans-serif'],
403
+ ['Oxygen', 'Oxygen, sans-serif'],
403
404
  ['Poppins', 'Poppins, sans-serif'],
405
+ ['Quantico', 'Quantico, sans-serif'],
404
406
  ['Raleway', 'Raleway, sans-serif'],
407
+ ['Reddit Sans', '"Reddit Sans", sans-serif'],
405
408
  ['Roboto', '"Roboto", sans-serif'],
406
409
  ['Roboto Slab', '"Roboto Slab", serif'],
410
+ ['Volkhov', 'Volkhov, serif'],
407
411
  ['Work Sans', '"Work Sans", serif'],
408
412
  ],
409
413
 
@@ -754,10 +754,14 @@ export default{
754
754
  'Montserrat, sans-serif': `@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;700&display=swap');`,
755
755
  '"Noto Sans", sans-serif': `@import url('https://fonts.googleapis.com/css2?family=Noto+Sans:wght@400;800&display=swap');`,
756
756
  'Oswald, sans-serif': `@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@400;700&display=swap');`,
757
+ 'Oxygen, sans-serif': `@import url('https://fonts.googleapis.com/css2?family=Oxygen:wght@400;700&display=swap');`,
757
758
  'Poppins, sans-serif': `@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;700&display=swap');`,
759
+ 'Quantico, sans-serif': `@import url('https://fonts.googleapis.com/css2?family=Quantico:wght@400;700&display=swap"');`,
758
760
  'Raleway, sans-serif': `@import url('https://fonts.googleapis.com/css2?family=Raleway:wght@400;700&display=swap');`,
761
+ '"Reddit Sans", sans-serif': `@import url('https://fonts.googleapis.com/css2?family=Reddit+Sans:wght@400;700&display=swap');`,
759
762
  '"Roboto", sans-serif': `@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap');`,
760
763
  '"Roboto Slab", serif': `@import url('https://fonts.googleapis.com/css2?family=Roboto+Slab:wght@400;800&display=swap');`,
764
+ 'Volkhov, serif': `@import url('https://fonts.googleapis.com/css2?family=Volkhov:wght@400;700&display=swap');`,
761
765
  '"Work Sans", serif': `@import url('https://fonts.googleapis.com/css2?family=Work+Sans:wght@400;700&display=swap');`,
762
766
  }
763
767