@hostlink/nuxt-light 0.0.113 → 0.0.114

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/dist/module.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "light",
3
3
  "configKey": "light",
4
- "version": "0.0.113"
4
+ "version": "0.0.114"
5
5
  }
@@ -1,30 +1 @@
1
- body {
2
- font-family: Noto Sans, Noto Sans HK, Noto Sans TC, -apple-system, Helvetica Neue, Helvetica, Arial, sans-serif;
3
- }
4
-
5
- /* :root {
6
- --color-primary: 115 103 240;
7
- --color-secondary: 40 199 111;
8
- --color-warning: 255 159 67;
9
- --color-danger: 234 85 85;
10
- --color-error: 245 108 108;
11
- --color-info: 0 207 232;
12
- }
13
- */
14
-
15
- .q-card__actions .q-btn--rectangle {
16
- padding: 4px 16px;
17
- }
18
-
19
-
20
- .q-table--dense .q-table td, .q-table--dense .q-table th{
21
- padding: 2px 4px;
22
- }
23
-
24
- .q-table--dense .q-table td:first-child, .q-table--dense .q-table th:first-child{
25
- padding: 2px 4px;
26
- }
27
-
28
- .q-tab-panel{
29
- padding: 8px;
30
- }
1
+ body{font-family:Noto Sans,Noto Sans HK,Noto Sans TC,-apple-system,Helvetica Neue,Helvetica,Arial,sans-serif}.q-card__actions .q-btn--rectangle{padding:4px 16px}.q-table--dense .q-table td,.q-table--dense .q-table td:first-child,.q-table--dense .q-table th,.q-table--dense .q-table th:first-child{padding:2px 4px}.q-tab-panel{padding:8px}
@@ -66,13 +66,13 @@ if (!props.range) {
66
66
 
67
67
  const attrs = {
68
68
  ...{
69
- filled: light.getStyle("inputFilled", false),
70
- outlined: light.getStyle("inputOutlined", true),
71
- standout: light.getStyle("inputStandout", false),
72
- rounded: light.getStyle("inputRounded", false),
73
- dense: light.getStyle("inputDense", false),
74
- square: light.getStyle("inputSquare", false),
75
- stackLabel: light.getStyle("inputStackLabel", false)
69
+ filled: light.getStyle("inputFilled"),
70
+ outlined: light.getStyle("inputOutlined"),
71
+ standout: light.getStyle("inputStandout"),
72
+ rounded: light.getStyle("inputRounded"),
73
+ dense: light.getStyle("inputDense"),
74
+ square: light.getStyle("inputSquare"),
75
+ stackLabel: light.getStyle("inputStackLabel")
76
76
  },
77
77
  ...useAttrs(),
78
78
  }
@@ -1,8 +1,17 @@
1
1
  <script setup>
2
+ import { useLight, useAttrs } from '#imports';
2
3
  const props = defineProps(['label']);
4
+ const light = useLight();
5
+
6
+ const attrs = {
7
+ ...{
8
+ outlined: light.getStyle("inputOutlined"),
9
+ },
10
+ ...useAttrs()
11
+ }
3
12
  </script>
4
13
  <template>
5
- <q-field :label="$t(props.label ?? '')">
14
+ <q-field v-bind="attrs" :label="$t(props.label ?? '')">
6
15
  <slot></slot>
7
16
  </q-field>
8
17
  </template>
@@ -673,8 +673,6 @@ const isDark = computed(() => light.isDarkMode());
673
673
  </q-layout>
674
674
  </template>
675
675
 
676
- <style>
677
- .q-item--active {
678
- background-color: #e0e0e0;
679
- }
676
+ <style>
677
+ .q-item--active{background-color:#e0e0e0}
680
678
  </style>
@@ -154,13 +154,13 @@ const onClickTc2Sc = () => {
154
154
 
155
155
  const attrs = {
156
156
  ...{
157
- filled: light.getStyle("inputFilled", false),
158
- outlined: light.getStyle("inputOutlined", true),
159
- standout: light.getStyle("inputStandout", false),
160
- rounded: light.getStyle("inputRounded", false),
161
- dense: light.getStyle("inputDense", false),
162
- square: light.getStyle("inputSquare", false),
163
- stackLabel: light.getStyle("inputStackLabel", true)
157
+ filled: light.getStyle("inputFilled"),
158
+ outlined: light.getStyle("inputOutlined"),
159
+ standout: light.getStyle("inputStandout"),
160
+ rounded: light.getStyle("inputRounded"),
161
+ dense: light.getStyle("inputDense"),
162
+ square: light.getStyle("inputSquare"),
163
+ stackLabel: light.getStyle("inputStackLabel")
164
164
  },
165
165
  ...useAttrs(),
166
166
  }
@@ -186,9 +186,9 @@ onMounted(() => {
186
186
  <q-form ref="form1">
187
187
  <div class="q-gutter-sm">
188
188
  <l-input v-model.trim="data.username" label="Username" :rules="[v => !!v || $t('Username is required')]"
189
- clearable />
189
+ clearable :outlined="false" />
190
190
  <l-input v-model="data.password" label="Password" type="password" clearable show-password
191
- :rules="[v => !!v || $t('Password is required')]" @keydown.enter.prevent="submit" />
191
+ :rules="[v => !!v || $t('Password is required')]" @keydown.enter.prevent="submit" :outlined="false" />
192
192
  <l-input v-if="twoFactorAuthentication" v-model="data.code" label="2FA code" required type="text" clearable>
193
193
  </l-input>
194
194
  </div>
@@ -27,17 +27,8 @@ defineExpose({
27
27
 
28
28
  </script>
29
29
 
30
- <style scoped>
31
- .menu-list .q-item {
32
- border-radius: 24px 24px 24px 24px;
33
- }
34
-
35
- .menu-list .q-router-link--exact-active {
36
- background: linear-gradient(118deg,
37
- var(--q-primary),
38
- rgba(115, 103, 240, 0.7));
39
- color: #fff;
40
- }
30
+ <style scoped>
31
+ .menu-list .q-item{border-radius:24px 24px 24px 24px}.menu-list .q-router-link--exact-active{background:linear-gradient(118deg,var(--q-primary),rgba(115,103,240,.7));color:#fff}
41
32
  </style>
42
33
  <template>
43
34
  <q-expansion-item v-if="value.children?.length > 0" :label="$t(value.label)" :icon="value.icon" :dense="dense"
@@ -61,13 +61,13 @@ const clearable = computed(() => {
61
61
 
62
62
  const attrs = {
63
63
  ...{
64
- filled: light.getStyle("inputFilled", false),
65
- outlined: light.getStyle("inputOutlined", true),
66
- standout: light.getStyle("inputStandout", false),
67
- rounded: light.getStyle("inputRounded", false),
68
- dense: light.getStyle("inputDense", false),
69
- square: light.getStyle("inputSquare", false),
70
- stackLabel: light.getStyle("inputStackLabel", false)
64
+ filled: light.getStyle("inputFilled"),
65
+ outlined: light.getStyle("inputOutlined"),
66
+ standout: light.getStyle("inputStandout"),
67
+ rounded: light.getStyle("inputRounded"),
68
+ dense: light.getStyle("inputDense"),
69
+ square: light.getStyle("inputSquare"),
70
+ stackLabel: light.getStyle("inputStackLabel")
71
71
  },
72
72
  ...useAttrs(),
73
73
  }
@@ -434,9 +434,10 @@ const onDelete = async (id: any) => {
434
434
 
435
435
  const attrs = {
436
436
  ...{
437
- dense: light.getStyle("tableDense", false),
438
- flat: light.getStyle("tableFlat", true),
439
- bordered: light.getStyle("tableBorder", true),
437
+ dense: light.getStyle("tableDense"),
438
+ flat: light.getStyle("tableFlat"),
439
+ bordered: light.getStyle("tableBorder"),
440
+ separator: light.getStyle("tableSeparator"),
440
441
  },
441
442
  ...useAttrs()
442
443
  }
@@ -523,13 +524,10 @@ const getCellClass = (col: any, row: any) => {
523
524
  rows:{{ props.rows }}
524
525
  </template>
525
526
 
526
- <q-table
527
-
528
-
529
- v-bind="attrs" :row-key="rowKey" :loading="loading" :rows="rows" ref="table" @request="onRequest"
530
- separator="cell" :rows-per-page-label="$t(props.rowsPerPageLabel)" :columns="columns"
531
- :rows-per-page-options="rowsPerPageOptions" :selection="selection" v-model:pagination="pagination" :filter="filter"
532
- :no-data-label="$t('No data available')" :loading-label="$t('Loading...')">
527
+ <q-table v-bind="attrs" :row-key="rowKey" :loading="loading" :rows="rows" ref="table" @request="onRequest"
528
+ :rows-per-page-label="$t(props.rowsPerPageLabel)" :columns="columns" :rows-per-page-options="rowsPerPageOptions"
529
+ :selection="selection" v-model:pagination="pagination" :filter="filter" :no-data-label="$t('No data available')"
530
+ :loading-label="$t('Loading...')">
533
531
 
534
532
 
535
533
  <!-- template v-for="s in ss" v-slot:[s]="props">
@@ -632,7 +630,7 @@ const getCellClass = (col: any, row: any) => {
632
630
  </template>
633
631
 
634
632
  <template v-if="col.searchType == 'date'">
635
- <l-date-picker hide-bottom-space v-model="filters[col.name]" dense
633
+ <l-date-picker :outlined="false" hide-bottom-space v-model="filters[col.name]" dense
636
634
  @update:model-value="onFilters" clearable range @clear="onFilters" />
637
635
  </template>
638
636
 
@@ -12,7 +12,7 @@ export declare const useLight: () => {
12
12
  addError: (error: String) => void;
13
13
  getErrors: () => String[];
14
14
  removeError: (error: String) => void;
15
- getStyle: (name: String, defaultdefaultValue: any) => any;
15
+ getStyle: (name: String) => any;
16
16
  setStyles: (s: Object) => void;
17
17
  getStyles: () => {
18
18
  theme?: String | undefined;
@@ -3,6 +3,13 @@ import { watch, reactive } from "vue";
3
3
  import { m } from "./lib/index.mjs";
4
4
  const errors = [];
5
5
  let styles = {};
6
+ let defaultStyle = {
7
+ inputOutlined: true,
8
+ inputStackLabel: true,
9
+ tableFlat: true,
10
+ tableBorder: true,
11
+ tableSeparator: "cell"
12
+ };
6
13
  const app = reactive({
7
14
  company: "",
8
15
  companyLogo: "",
@@ -38,9 +45,12 @@ const app = reactive({
38
45
  errors.splice(index, 1);
39
46
  }
40
47
  },
41
- getStyle(name, defaultdefaultValue) {
48
+ getStyle(name) {
42
49
  if (styles[name] === void 0) {
43
- return defaultdefaultValue;
50
+ if (defaultStyle[name] !== void 0) {
51
+ return defaultStyle[name];
52
+ }
53
+ return false;
44
54
  }
45
55
  return styles[name];
46
56
  },
package/dist/types.d.mts CHANGED
@@ -1,5 +1,6 @@
1
1
 
2
- import { ModuleOptions } from './module'
2
+ import type { ModuleOptions } from './module'
3
+
3
4
 
4
5
  declare module '@nuxt/schema' {
5
6
  interface NuxtConfig { ['light']?: Partial<ModuleOptions> }
@@ -12,4 +13,4 @@ declare module 'nuxt/schema' {
12
13
  }
13
14
 
14
15
 
15
- export { ModuleOptions, default } from './module'
16
+ export type { ModuleOptions, default } from './module'
package/dist/types.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
 
2
- import { ModuleOptions } from './module'
2
+ import type { ModuleOptions } from './module'
3
+
3
4
 
4
5
  declare module '@nuxt/schema' {
5
6
  interface NuxtConfig { ['light']?: Partial<ModuleOptions> }
@@ -12,4 +13,4 @@ declare module 'nuxt/schema' {
12
13
  }
13
14
 
14
15
 
15
- export { ModuleOptions, default } from './module'
16
+ export type { ModuleOptions, default } from './module'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hostlink/nuxt-light",
3
- "version": "0.0.113",
3
+ "version": "0.0.114",
4
4
  "description": "HostLink Nuxt Light Framework",
5
5
  "repository": "@hostlink/nuxt-light",
6
6
  "license": "MIT",