@mythpe/quasar-ui-qui 0.3.17 → 0.3.19

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.17",
3
+ "version": "0.3.19",
4
4
  "description": "MyTh Quasar UI Kit App Extension",
5
5
  "author": {
6
6
  "name": "MyTh Ahmed Faiz",
@@ -813,8 +813,9 @@ defineExpose({
813
813
  :aria-label="__('menu')"
814
814
  :icon="pluginOptions.dt?.searchInput?.optionsIcon || 'ion-ios-options'"
815
815
  dense
816
+ fab-mini
816
817
  flat
817
- round
818
+ text-color="body"
818
819
  v-bind="pluginOptions.dt?.searchInput?.menuBtn as any"
819
820
  >
820
821
  <MModalMenu
@@ -969,7 +970,7 @@ defineExpose({
969
970
  <q-separator />
970
971
  <MRow class="items-center">
971
972
  <MCol col="12">
972
- <MContainer class="q-pa-lg">
973
+ <MContainer>
973
974
  <slot
974
975
  :dt="datatableItemsScope"
975
976
  :filter="tempFilterForm"
@@ -1150,6 +1151,7 @@ defineExpose({
1150
1151
  v-if="!noWrapBtnProp"
1151
1152
  :icon="`ion-ios-${!wrapCellsRef ? 'grid' : 'list'}`"
1152
1153
  flat
1154
+ tooltip="myth.datatable.wrapBtn"
1153
1155
  @click="wrapCellsRef = !wrapCellsRef"
1154
1156
  />
1155
1157
  </MRow>
@@ -1476,7 +1478,7 @@ defineExpose({
1476
1478
  >
1477
1479
  <q-card class="m-dialog-card">
1478
1480
  <q-card-section ref="formTitle">
1479
- <q-toolbar :class="{'q-pa-none': isSmall}">
1481
+ <q-toolbar :class="['m-container__fluid', {'q-pa-none': isSmall}]">
1480
1482
  <slot
1481
1483
  :dt="datatableItemsScope"
1482
1484
  :form="useFormContext"
@@ -1496,16 +1498,16 @@ defineExpose({
1496
1498
  <q-skeleton width="200px" />
1497
1499
  </template>
1498
1500
  <template v-else>
1499
- <MBtn
1501
+ <q-btn
1502
+ fab-mini
1500
1503
  flat
1501
1504
  icon="close"
1502
- text-color="none"
1503
1505
  @click="closeFormDialog"
1504
1506
  >
1505
1507
  <q-tooltip class="m-dt-btn-tooltip">
1506
1508
  {{ __('myth.titles.close') }}
1507
1509
  </q-tooltip>
1508
- </MBtn>
1510
+ </q-btn>
1509
1511
  {{ getFormTitle }}
1510
1512
  </template>
1511
1513
  </q-toolbar-title>
@@ -1559,7 +1561,7 @@ defineExpose({
1559
1561
  <q-card-actions
1560
1562
  ref="formActions"
1561
1563
  align="between"
1562
- class="m-datatable-form-actions print-hide"
1564
+ class="m-datatable-form-actions print-hide m-container__fluid"
1563
1565
  >
1564
1566
  <slot
1565
1567
  :dt="datatableItemsScope"
@@ -133,7 +133,8 @@ defineOptions({
133
133
  borderless: !0,
134
134
  outlined: !1,
135
135
  stackLabel: !0,
136
- hideBottomSpace: !0
136
+ hideBottomSpace: !0,
137
+ standout: undefined
137
138
  }"
138
139
  >
139
140
  <q-checkbox
@@ -13,7 +13,7 @@
13
13
 
14
14
  import { useField } from 'vee-validate'
15
15
  import type { MOptionsOptionContext, MOptionsProps as Props } from '../../types'
16
- import { onMounted, reactive, toValue, useTemplateRef } from 'vue'
16
+ import { computed, onMounted, reactive, toValue, useTemplateRef } from 'vue'
17
17
  import { QField, QOptionGroup, type QOptionGroupSlots } from 'quasar'
18
18
  import { useBindInput, useMyth } from '../../composable'
19
19
 
@@ -44,10 +44,17 @@ interface P {
44
44
  fullWidth?: Props['fullWidth'];
45
45
  fitWidth?: Props['fullWidth'];
46
46
  fieldOptions?: Props['fieldOptions'];
47
+ disable?: Props['disable'];
48
+ optionValue?: Props['optionValue'];
49
+ optionLabel?: Props['optionLabel'];
50
+ prependIcon?: Props['prependIcon'];
51
+ prependIconProps?: Props['prependIconProps'];
52
+ appendIcon?: Props['appendIcon'];
53
+ appendIconProps?: Props['appendIconProps'];
47
54
  }
48
55
 
49
56
  const props = withDefaults(defineProps<P>(), {
50
- name: () => '',
57
+ name: '',
51
58
  auto: undefined,
52
59
  col: undefined,
53
60
  xs: undefined,
@@ -62,7 +69,7 @@ const props = withDefaults(defineProps<P>(), {
62
69
  help: undefined,
63
70
  required: undefined,
64
71
  rules: undefined,
65
- viewMode: () => !1,
72
+ viewMode: !1,
66
73
  viewModeValue: undefined,
67
74
  topLabel: undefined,
68
75
  color: undefined,
@@ -70,9 +77,16 @@ const props = withDefaults(defineProps<P>(), {
70
77
  keepColor: undefined,
71
78
  guest: !1,
72
79
  service: undefined,
73
- fullWidth: () => !1,
74
- fitWidth: () => !1,
75
- fieldOptions: undefined
80
+ fullWidth: !1,
81
+ fitWidth: !1,
82
+ fieldOptions: undefined,
83
+ disable: undefined,
84
+ optionValue: undefined,
85
+ optionLabel: undefined,
86
+ prependIcon: undefined,
87
+ prependIconProps: undefined,
88
+ appendIcon: undefined,
89
+ appendIconProps: undefined
76
90
  })
77
91
  defineModel<Props['modelValue']>({ required: !1, default: undefined })
78
92
  const loading = defineModel<Props['loading']>('loading', { required: !1, default: !1 })
@@ -123,7 +137,26 @@ const fetchData = async () => {
123
137
  }
124
138
  }
125
139
  }
126
-
140
+ const customViewModeValue = computed(() => {
141
+ if (!props.viewMode) {
142
+ return undefined
143
+ }
144
+ if (props.viewModeValue !== undefined) {
145
+ return props.viewModeValue
146
+ }
147
+ if (loading.value) {
148
+ return '...'
149
+ }
150
+ const opt = options.value?.find((e) => {
151
+ const k = props.optionValue === undefined ? 'value' : (typeof props.optionValue === 'function' ? props.optionValue(e) : props.optionValue)
152
+ return e[k] === value.value
153
+ })
154
+ if (opt) {
155
+ const k = props.optionLabel === undefined ? 'label' : (typeof props.optionLabel === 'function' ? props.optionLabel(opt) : props.optionLabel)
156
+ return opt[k]
157
+ }
158
+ return undefined
159
+ })
127
160
  onMounted(() => {
128
161
  fetchData()
129
162
  })
@@ -196,13 +229,13 @@ defineOptions({
196
229
  <component
197
230
  :is="viewMode ? QField : QOptionGroup"
198
231
  ref="input"
199
- :class="{'m-options': !0, 'm-options__full_width': fullWidth, 'm-options__fit_width': fitWidth }"
232
+ :class="['m-options',{'m-options__full_width': fullWidth, 'm-options__fit_width': fitWidth }]"
200
233
  :error="viewMode ? !!errorMessage : undefined"
201
234
  :error-message="viewMode ? errorMessage : undefined"
202
235
  :hint="viewMode ? ( hint ? __(hint) : undefined ) : undefined"
203
236
  :keep-color="!!errorMessage ? !0 : getProp('keepColor')"
204
237
  :label="getLabel || undefined"
205
- :model-value="viewMode ? (viewModeValue || value) : value"
238
+ :model-value="viewMode ? (customViewModeValue || value) : value"
206
239
  :options="options"
207
240
  :type="viewMode ? undefined : type"
208
241
  v-bind="{
@@ -210,10 +243,39 @@ defineOptions({
210
243
  ...theme,
211
244
  ...( viewMode ? { ...pluginProps.field } : pluginProps.options as any ),
212
245
  stackLabel: !0,
213
- color:!!errorMessage ? 'negative' : getProp('color')
246
+ color:!!errorMessage ? 'negative' : getProp('color'),
247
+ disable: viewMode ? undefined : disable,
214
248
  }"
215
249
  v-on="listeners"
216
250
  >
251
+ <template
252
+ v-if="viewMode"
253
+ #control
254
+ >
255
+ <slot name="control">
256
+ <MInputFieldControl>
257
+ {{ customViewModeValue ?? value }}
258
+ </MInputFieldControl>
259
+ </slot>
260
+ </template>
261
+ <template
262
+ v-if="!!prependIcon"
263
+ #prepend
264
+ >
265
+ <q-icon
266
+ :name="prependIcon"
267
+ v-bind="prependIconProps"
268
+ />
269
+ </template>
270
+ <template
271
+ v-if="!!appendIcon"
272
+ #append
273
+ >
274
+ <q-icon
275
+ :name="appendIcon"
276
+ v-bind="appendIconProps"
277
+ />
278
+ </template>
217
279
  <template
218
280
  v-for="(_,slot) in $slots as Readonly<QOptionGroupSlots>"
219
281
  :key="slot"
@@ -224,16 +286,6 @@ defineOptions({
224
286
  v-bind="inputSlot || {}"
225
287
  />
226
288
  </template>
227
- <template
228
- v-if="viewMode"
229
- #control
230
- >
231
- <slot name="control">
232
- <MInputFieldControl>
233
- {{ viewModeValue ?? value }}
234
- </MInputFieldControl>
235
- </slot>
236
- </template>
237
289
  </component>
238
290
  <slot
239
291
  name="help"
@@ -129,9 +129,12 @@ defineOptions({
129
129
  ...pluginOptions.input as any,
130
130
  ...pluginOptions.field,
131
131
  ...$attrs,
132
+ dense: !0,
132
133
  borderless: !0,
133
134
  outlined: !1,
134
- stackLabel: !0
135
+ stackLabel: !0,
136
+ hideBottomSpace: !0,
137
+ standout: undefined
135
138
  }"
136
139
  >
137
140
  <template #control>
@@ -181,6 +181,9 @@ const listeners = {
181
181
  const input = useTemplateRef<InstanceType<typeof QSelect> | InstanceType<typeof QField>>('input')
182
182
  const scopes = reactive(inputScope)
183
183
  const getViewModeValue = computed(() => {
184
+ if (props.viewMode && props.loading) {
185
+ return '...'
186
+ }
184
187
  if (props.viewModeValue === undefined) {
185
188
  const i = getOptions.value.find((e) => {
186
189
  if (typeof props.optionValue === 'function') {
@@ -195,7 +198,7 @@ const getViewModeValue = computed(() => {
195
198
  return i[props.optionLabel]
196
199
  }
197
200
  }
198
- return props.viewModeValue || value.value
201
+ return '...'
199
202
  })
200
203
  defineExpose<typeof scopes & {
201
204
  input: typeof input,
@@ -265,13 +268,13 @@ defineOptions({
265
268
  useChips: getProp('useChips') === !0 && !multiple ? !1 : getProp('useChips'),
266
269
  multiple,
267
270
  mapOptions,
268
- loading,
271
+ loading: viewMode ? !1 : loading,
269
272
  useInput,
270
273
  autocomplete: getAutocompleteAttribute || undefined,
271
274
  clearable: viewMode ? !1 : clearable,
272
275
  hint: hint ? __(hint) : undefined,
273
276
  label: viewMode && hasTopLabel ? undefined : (getLabel || undefined),
274
- modelValue: value
277
+ modelValue: viewMode ? getViewModeValue : value
275
278
  }"
276
279
  v-on="listeners"
277
280
  >
@@ -379,7 +382,7 @@ defineOptions({
379
382
  >
380
383
  <slot name="control">
381
384
  <MInputFieldControl>
382
- {{ getViewModeValue ?? viewModeValue ?? value }}
385
+ {{ getViewModeValue }}
383
386
  </MInputFieldControl>
384
387
  </slot>
385
388
  </template>
@@ -49,6 +49,11 @@ interface P {
49
49
  viewMode?: Props['viewMode'];
50
50
  fieldOptions?: Props['fieldOptions'];
51
51
  hideBottomSpace?: boolean;
52
+ prependIcon?: Props['prependIcon'];
53
+ prependIconProps?: Props['prependIconProps'];
54
+ appendIcon?: Props['appendIcon'];
55
+ appendIconProps?: Props['appendIconProps'];
56
+ disable?: Props['disable'];
52
57
  }
53
58
 
54
59
  const props = withDefaults(defineProps<P>(), {
@@ -60,7 +65,7 @@ const props = withDefaults(defineProps<P>(), {
60
65
  lg: undefined,
61
66
  xl: undefined,
62
67
  val: undefined,
63
- name: () => '',
68
+ name: '',
64
69
  label: undefined,
65
70
  caption: undefined,
66
71
  hint: undefined,
@@ -83,7 +88,12 @@ const props = withDefaults(defineProps<P>(), {
83
88
  colProps: undefined,
84
89
  viewMode: !1,
85
90
  fieldOptions: undefined,
86
- hideBottomSpace: !0
91
+ hideBottomSpace: !0,
92
+ prependIcon: undefined,
93
+ prependIconProps: undefined,
94
+ appendIcon: undefined,
95
+ appendIconProps: undefined,
96
+ disable: undefined
87
97
  })
88
98
  defineModel<Props['modelValue']>({ required: !1, default: undefined })
89
99
  const helper = useBindInput<P>(() => props, 'toggle', () => ({ choose: !0 }))
@@ -110,7 +120,6 @@ const getLabel = computed<string | undefined>(() => {
110
120
  }
111
121
  return __('labels.none') as string || def
112
122
  })
113
-
114
123
  const input = useTemplateRef<InstanceType<typeof QToggle>>('input')
115
124
  const scopes = reactive(inputScope)
116
125
  defineExpose({ input, ...scopes })
@@ -121,7 +130,14 @@ defineOptions({
121
130
  </script>
122
131
 
123
132
  <template>
133
+ <MInput
134
+ v-if="viewMode"
135
+ :view-mode-value="getLabel"
136
+ v-bind="{...$props,...$attrs}"
137
+ view-mode
138
+ />
124
139
  <MCol
140
+ v-else
125
141
  :auto="auto"
126
142
  :class="[$attrs.class,{'m-input__required':inputRules?.required!==undefined,'m-input__error':!!errorMessage,'m-input__view':viewMode},'m-toggle__col']"
127
143
  :col="col"
@@ -162,7 +178,6 @@ defineOptions({
162
178
  />
163
179
  <MCol v-bind="colProps">
164
180
  <q-field
165
- :hide-bottom-space="hideBottomSpace"
166
181
  v-bind="{
167
182
  ...theme,
168
183
  error: !!errorMessage,
@@ -171,14 +186,16 @@ defineOptions({
171
186
  ...pluginOptions.input as any,
172
187
  ...pluginOptions.field,
173
188
  ...$attrs,
189
+ dense: !0,
174
190
  borderless: !0,
175
191
  outlined: !1,
176
- // dense2: theme.dense !== undefined ? theme.dense : getProp('dense')
177
- dense: !0
192
+ stackLabel: !0,
193
+ hideBottomSpace: !0,
194
+ standout: undefined
178
195
  }"
179
196
  >
180
197
  <q-toggle
181
- :disable="viewMode"
198
+ :disable="disable"
182
199
  :false-value="falseValue"
183
200
  :indeterminate-value="indeterminateValue"
184
201
  :model-value="value"
@@ -1,11 +1,7 @@
1
+
1
2
  $m-container-padding: $space-base !default
2
3
  $m-container-fluid-width: 1440px !default
3
4
 
4
- .m-form__container
5
- max-width: $m-container-fluid-width
6
- margin-left: auto
7
- margin-right: auto
8
-
9
5
  .m-container
10
6
  &__dense
11
7
  padding: 0