@mythpe/quasar-ui-qui 0.3.11 → 0.3.12

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mythpe/quasar-ui-qui",
3
- "version": "0.3.11",
3
+ "version": "0.3.12",
4
4
  "description": "MyTh Quasar UI Kit App Extension",
5
5
  "author": {
6
6
  "name": "MyTh Ahmed Faiz",
@@ -91,6 +91,7 @@ type Props = {
91
91
  descColumns?: MDatatableProps['descColumns'];
92
92
  help?: MDatatableProps['help'];
93
93
  noWrapBtn?: boolean;
94
+ lockValue?: MDatatableProps['lockValue'];
94
95
  }
95
96
 
96
97
  const props = withDefaults(defineProps<Props>(), {
@@ -160,7 +161,8 @@ const props = withDefaults(defineProps<Props>(), {
160
161
  copyColumns: undefined,
161
162
  descColumns: undefined,
162
163
  help: undefined,
163
- noWrapBtn: undefined
164
+ noWrapBtn: undefined,
165
+ lockValue: undefined
164
166
  })
165
167
 
166
168
  interface Emits {
@@ -419,6 +421,16 @@ const onSearchEnter = () => {
419
421
  }
420
422
  refreshNoUpdate()
421
423
  }
424
+ const lockValueProp = computed<string>(() => getProp.value('lockValue') || 'id')
425
+ const lockSearch = computed<boolean>(() => searchColumnsRef.value.length === 1 && searchColumnsRef.value[0] === lockValueProp.value)
426
+ const tempSearch = ref<string[]>([])
427
+ const onLockSearch = () => {
428
+ if (!lockSearch.value) {
429
+ tempSearch.value = toValue(searchColumnsRef)
430
+ }
431
+ searchColumnsRef.value = !lockSearch.value ? [lockValueProp.value] : tempSearch.value
432
+ // lockSearch.value = !lockSearch.value
433
+ }
422
434
  onMounted(() => {
423
435
  wrapCellsRef.value = getProp.value('wrapCells') ?? !1
424
436
  refresh()
@@ -551,6 +563,7 @@ defineExpose({
551
563
  :selection="getShowSelection ? (multiSelection ? 'multiple' : 'single') : 'none'"
552
564
  :visible-columns="visibleHeaders"
553
565
  card-container-class="m-datatable-container"
566
+ color="primary"
554
567
  table-class="m-datatable-container"
555
568
  v-bind="{
556
569
  virtualScroll: !0,
@@ -880,6 +893,16 @@ defineExpose({
880
893
  </MTooltip>
881
894
  </q-btn>
882
895
  </template>
896
+ <template #append>
897
+ <q-btn
898
+ :icon="`ion-ios-${lockSearch ? 'magnet' : 'lock'}`"
899
+ fab-mini
900
+ flat
901
+ @click="onLockSearch"
902
+ >
903
+ <q-tooltip>{{ __(`labels.${lockSearch ? 'unlock' : 'lock'}_search`, { name: __(lockValueProp) }) }}</q-tooltip>
904
+ </q-btn>
905
+ </template>
883
906
  </MInput>
884
907
  <slot
885
908
  :dt="datatableItemsScope"
@@ -332,6 +332,10 @@ export type MDatatableProps<I extends GenericFormValues = GenericFormValues> = O
332
332
  * Show, hide wrap the button in the table.
333
333
  */
334
334
  noWrapBtn?: boolean;
335
+ /**
336
+ * Column name to lock the value.
337
+ */
338
+ lockValue?: string;
335
339
  }
336
340
 
337
341
  export interface MDtAvatarProps extends QAvatarProps {