@mythpe/quasar-ui-qui 0.2.2 → 0.2.4

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.2",
3
+ "version": "0.2.4",
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;
@@ -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,18 @@ 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 => e.value === value.value)
175
+ if (i) {
176
+ if (typeof props.optionLabel === 'function') {
177
+ return props.optionLabel(i)
178
+ }
179
+ return i[props.optionLabel]
180
+ }
181
+ }
182
+ return props.viewModeValue || value.value
183
+ })
172
184
  defineExpose<typeof scopes & {
173
185
  input: typeof input,
174
186
  onDoneOptions: typeof onDoneOptions
@@ -334,7 +346,7 @@ defineOptions({
334
346
  >
335
347
  <slot name="control">
336
348
  <MInputFieldControl>
337
- {{ viewModeValue ?? value }}
349
+ {{ getViewModeValue ?? viewModeValue ?? value }}
338
350
  </MInputFieldControl>
339
351
  </slot>
340
352
  </template>
@@ -48,6 +48,7 @@ interface P {
48
48
  colProps?: Props['colProps'];
49
49
  viewMode?: Props['viewMode'];
50
50
  fieldOptions?: Props['fieldOptions'];
51
+ hideBottomSpace?: boolean;
51
52
  }
52
53
 
53
54
  const props = withDefaults(defineProps<P>(), {
@@ -80,8 +81,9 @@ const props = withDefaults(defineProps<P>(), {
80
81
  required: undefined,
81
82
  rowProps: undefined,
82
83
  colProps: undefined,
83
- viewMode: () => !1,
84
- fieldOptions: undefined
84
+ viewMode: !1,
85
+ fieldOptions: undefined,
86
+ hideBottomSpace: !0
85
87
  })
86
88
  defineModel<Props['modelValue']>({ required: !1, default: undefined })
87
89
  const helper = useBindInput<P>(() => props, 'toggle', () => ({ choose: !0 }))
@@ -160,6 +162,7 @@ defineOptions({
160
162
  />
161
163
  <MCol v-bind="colProps">
162
164
  <q-field
165
+ :hide-bottom-space="hideBottomSpace"
163
166
  v-bind="{
164
167
  error: !!errorMessage,
165
168
  errorMessage,
@@ -169,7 +172,8 @@ defineOptions({
169
172
  ...$attrs,
170
173
  borderless: !0,
171
174
  outlined: !1,
172
- dense: theme.dense !== undefined ? theme.dense : getProp('dense')
175
+ // dense2: theme.dense !== undefined ? theme.dense : getProp('dense')
176
+ dense: !0
173
177
  }"
174
178
  >
175
179
  <q-toggle
@@ -182,7 +186,8 @@ defineOptions({
182
186
  ...pluginOptions.toggle,
183
187
  ...theme,
184
188
  ...$attrs,
185
- dense: theme.dense !== undefined ? theme.dense : getProp('dense'),
189
+ // dense: theme.dense !== undefined ? theme.dense : getProp('dense'),
190
+ dense: !0,
186
191
  checkedIcon: getProp('checkedIcon'),
187
192
  uncheckedIcon: getProp('uncheckedIcon'),
188
193
  color: !!errorMessage ? 'negative' : getProp('color'),
@@ -1,26 +1,7 @@
1
- import type { ButtonLoadingOptions, Theme, ThemeBtn, ThemeContext, ThemeFluid, ThemeInput, ThemeRounded, ThemeShadow, ThemeSize } from './theme'
1
+ import type { ThemeContext } from './theme'
2
2
  import type { MythComponentsProps } from './plugin-props-option'
3
- import type { HelpersStubSchema } from './api-helpers'
4
- import type { AxiosInstance } from 'axios'
5
3
  import type { ApiContext, MythApi } from './myth-api'
6
4
 
7
- export interface InstallOptions2 {
8
- asyncComponents?: boolean | undefined;
9
- theme?: Theme;
10
- size?: ThemeSize;
11
- rounded?: ThemeRounded;
12
- shadow?: ThemeShadow;
13
- fluid?: ThemeFluid;
14
- rules?: string[];
15
- btnLoading?: ButtonLoadingOptions;
16
- props?: MythComponentsProps;
17
- themeInput?: ThemeInput;
18
- themeBtn?: ThemeBtn;
19
- baseUrl?: string;
20
- api?: HelpersStubSchema;
21
- mAxios?: AxiosInstance;
22
- }
23
-
24
5
  export interface InstallOptions extends MythApi {
25
6
  api: ApiContext;
26
7
  asyncComponents?: boolean;