@hostlink/nuxt-light 0.0.112 → 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.112"
4
+ "version": "0.0.114"
5
5
  }
@@ -1,17 +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
- }
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", false),
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", false),
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", false)
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
  }
@@ -29,7 +29,7 @@ function getTo(field) {
29
29
 
30
30
  </script>
31
31
  <template>
32
- <q-list bordered separator>
32
+ <q-list bordered separator dense >
33
33
  <template v-if="fields">
34
34
  <l-item v-for="field in fields" :label="field.getRaw().label" :to="getTo(field)">
35
35
  {{ field.getFormattedValue(props.modelValue) }}
@@ -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", false),
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,7 +524,6 @@ const getCellClass = (col: any, row: any) => {
523
524
  rows:{{ props.rows }}
524
525
  </template>
525
526
 
526
-
527
527
  <q-table v-bind="attrs" :row-key="rowKey" :loading="loading" :rows="rows" ref="table" @request="onRequest"
528
528
  :rows-per-page-label="$t(props.rowsPerPageLabel)" :columns="columns" :rows-per-page-options="rowsPerPageOptions"
529
529
  :selection="selection" v-model:pagination="pagination" :filter="filter" :no-data-label="$t('No data available')"
@@ -630,7 +630,7 @@ const getCellClass = (col: any, row: any) => {
630
630
  </template>
631
631
 
632
632
  <template v-if="col.searchType == 'date'">
633
- <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
634
634
  @update:model-value="onFilters" clearable range @clear="onFilters" />
635
635
  </template>
636
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
  },
@@ -73,6 +83,7 @@ const app = reactive({
73
83
  init(styles2) {
74
84
  app.color = styles2.color || "primary";
75
85
  app.theme = styles2.theme || "semi-dark";
86
+ app.setStyles(styles2);
76
87
  watch(() => app.color, async () => {
77
88
  await app.setStyle("color", app.color);
78
89
  });
@@ -5,7 +5,7 @@ let my = await q("my", ["styles"]);
5
5
 
6
6
  const styles = reactive({
7
7
 
8
- tableDense: my.styles.tableDense === undefined ? false : my.styles.tableDense,
8
+ tableDense: my.styles.tableDense === undefined ? true : my.styles.tableDense,
9
9
  tableFlat: my.styles.tableFlat === undefined ? true : my.styles.tableFlat,
10
10
  tableBorder: my.styles.tableBorder === undefined ? true : my.styles.tableBorder,
11
11
 
@@ -19,10 +19,10 @@ const styles = reactive({
19
19
  buttonDense: my.styles.buttonDense === undefined ? false : my.styles.buttonDense,
20
20
 
21
21
  inputFilled: my.styles.inputFilled === undefined ? false : my.styles.inputFilled,
22
- inputOutlined: my.styles.inputOutlined === undefined ? false : my.styles.inputOutlined,
22
+ inputOutlined: my.styles.inputOutlined === undefined ? true : my.styles.inputOutlined,
23
23
  inputStandout: my.styles.inputStandout === undefined ? false : my.styles.inputStandout,
24
24
  inputRounded: my.styles.inputRounded === undefined ? false : my.styles.inputRounded,
25
- inputDense: my.styles.inputDense === undefined ? false : my.styles.inputDense,
25
+ inputDense: my.styles.inputDense === undefined ? true : my.styles.inputDense,
26
26
  inputSquare: my.styles.inputSquare === undefined ? false : my.styles.inputSquare,
27
27
  inputStackLabel: my.styles.inputStackLabel === undefined ? false : my.styles.inputStackLabel,
28
28
 
@@ -39,7 +39,7 @@ const onSave = async () => {
39
39
 
40
40
  const setDefault = async () => {
41
41
 
42
- styles.tableDense = false;
42
+ styles.tableDense = true;
43
43
  styles.tableFlat = true;
44
44
  styles.tableBorder = true;
45
45
 
@@ -53,12 +53,12 @@ const setDefault = async () => {
53
53
  styles.buttonDense = false;
54
54
 
55
55
  styles.inputFilled = false;
56
- styles.inputOutlined = false;
56
+ styles.inputOutlined = true;
57
57
  styles.inputStandout = false;
58
58
  styles.inputRounded = false;
59
59
  styles.inputDense = false;
60
60
  styles.inputSquare = false;
61
- styles.inputStackLabel = false;
61
+ styles.inputStackLabel = true;
62
62
 
63
63
 
64
64
 
@@ -71,6 +71,13 @@ const setDefault = async () => {
71
71
  <q-checkbox v-model="styles.tableFlat" label="Table flat" />
72
72
  <q-checkbox v-model="styles.tableBorder" label="Table bordered" />
73
73
 
74
+ <q-option-group v-model="styles.tableSeparator" inline class="q-mb-md" :options="[
75
+ { label: 'Horizontal', value: 'horizontal' },
76
+ { label: 'Vertical', value: 'vertical' },
77
+ { label: 'Cell', value: 'cell' },
78
+ { label: 'None', value: 'none' },
79
+ ]" />
80
+
74
81
  </div>
75
82
 
76
83
  <div>
@@ -119,6 +126,13 @@ const setDefault = async () => {
119
126
  ></q-input>
120
127
 
121
128
 
129
+ <q-table :rows="[
130
+ { name: 'A', phone: '123' },
131
+ { name: 'B', phone: '456' },
132
+ { name: 'C', phone: '789' },
133
+ ]" :flat="styles.tableFlat" :bordered="styles.tableBorder" :dense="styles.tableDense"
134
+ :separator="styles.tableSeparator"></q-table>
135
+
122
136
  </div>
123
137
 
124
138
 
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.112",
3
+ "version": "0.0.114",
4
4
  "description": "HostLink Nuxt Light Framework",
5
5
  "repository": "@hostlink/nuxt-light",
6
6
  "license": "MIT",