@mythpe/quasar-ui-qui 0.2.3 → 0.2.5

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.2.3",
3
+ "version": "0.2.5",
4
4
  "description": "MyTh Quasar UI Kit App Extension",
5
5
  "author": {
6
6
  "name": "MyTh Ahmed Faiz",
@@ -84,7 +84,7 @@ const props = withDefaults(defineProps<P>(), {
84
84
  rules: () => ({}),
85
85
  contentClass: 'items-center',
86
86
  emptyColor: 'grey-2',
87
- btnLabel: 'choose_file'
87
+ btnLabel: 'pick'
88
88
  })
89
89
  type Emits = {
90
90
  (e: 'click', evt?: Event): void;
@@ -67,22 +67,6 @@ const _toolbar = [
67
67
  'size-7'
68
68
  ]
69
69
  },
70
- {
71
- label: $q.lang.editor.fontSize,
72
- icon: $q.iconSet.editor.fontSize,
73
- fixedLabel: true,
74
- fixedIcon: true,
75
- list: 'no-icons',
76
- options: [
77
- 'size-1',
78
- 'size-2',
79
- 'size-3',
80
- 'size-4',
81
- 'size-5',
82
- 'size-6',
83
- 'size-7'
84
- ]
85
- },
86
70
  {
87
71
  label: $q.lang.editor.defaultFont,
88
72
  icon: $q.iconSet.editor.font,
@@ -78,25 +78,25 @@ const props = withDefaults(defineProps<P>(), {
78
78
  stackLabel: undefined,
79
79
  required: undefined,
80
80
  rules: undefined,
81
- viewMode: () => !1,
81
+ viewMode: !1,
82
82
  viewModeValue: undefined,
83
83
  autocomplete: undefined,
84
84
  topLabel: undefined,
85
85
  behavior: undefined,
86
- emitValue: () => !0,
87
- useInput: () => !0,
88
- mapOptions: () => !0,
86
+ emitValue: !0,
87
+ useInput: !0,
88
+ mapOptions: !0,
89
89
  loading: undefined,
90
90
  noLoading: !1,
91
91
  multiple: undefined,
92
92
  options: () => ([]),
93
- optionLabel: () => 'label',
94
- optionValue: () => 'value',
93
+ optionLabel: 'label',
94
+ optionValue: 'value',
95
95
  noFilter: undefined,
96
96
  hideEmptyList: undefined,
97
97
  readonly: undefined,
98
98
  useChips: undefined,
99
- searchLength: () => 1,
99
+ searchLength: 1,
100
100
  axiosMode: undefined,
101
101
  hideSelected: undefined,
102
102
  onFilter: undefined,
@@ -169,6 +169,23 @@ const listeners = {
169
169
  }
170
170
  const input = useTemplateRef<InstanceType<typeof QSelect> | InstanceType<typeof QField>>('input')
171
171
  const scopes = reactive(inputScope)
172
+ const getViewModeValue = computed(() => {
173
+ if (props.viewModeValue === undefined) {
174
+ const i = getOptions.value.find((e) => {
175
+ if (typeof props.optionValue === 'function') {
176
+ return e[props.optionValue(e)] === value.value
177
+ }
178
+ return e[props.optionValue] === value.value
179
+ })
180
+ if (i) {
181
+ if (typeof props.optionLabel === 'function') {
182
+ return props.optionLabel(i)
183
+ }
184
+ return i[props.optionLabel]
185
+ }
186
+ }
187
+ return props.viewModeValue || value.value
188
+ })
172
189
  defineExpose<typeof scopes & {
173
190
  input: typeof input,
174
191
  onDoneOptions: typeof onDoneOptions
@@ -334,7 +351,7 @@ defineOptions({
334
351
  >
335
352
  <slot name="control">
336
353
  <MInputFieldControl>
337
- {{ viewModeValue ?? value }}
354
+ {{ getViewModeValue ?? viewModeValue ?? value }}
338
355
  </MInputFieldControl>
339
356
  </slot>
340
357
  </template>