@shwfed/nuxt 0.8.3 → 0.9.0

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,7 +1,7 @@
1
1
  {
2
2
  "name": "@shwfed/nuxt",
3
3
  "configKey": "shwfed",
4
- "version": "0.8.3",
4
+ "version": "0.9.0",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "3.6.1"
@@ -1,174 +1,176 @@
1
1
  import { Effect } from 'effect';
2
- import type { Field } from './ui/fields/Fields.vue.js';
3
- export { CalendarFieldC, FieldC, NumberFieldC, SelectFieldC, StringFieldC, } from './ui/fields/Fields.vue.js';
4
- export type { Field } from './ui/fields/Fields.vue.js';
2
+ import type { FieldsConfig } from './ui/fields/Fields.vue.js';
3
+ export { CalendarFieldC, FieldC, FieldsConfigC, NumberFieldC, SelectFieldC, StringFieldC, } from './ui/fields/Fields.vue.js';
4
+ export type { Field, FieldsConfig } from './ui/fields/Fields.vue.js';
5
5
  declare const _default: typeof __VLS_export;
6
6
  export default _default;
7
7
  declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
8
- orientation?: "horizontal" | "vertical" | "floating";
9
- config?: Effect.Effect<ReadonlyArray<Field> | undefined>;
8
+ config?: Effect.Effect<FieldsConfig | undefined>;
10
9
  } & {
11
10
  modelValue?: Record<string, unknown>;
12
11
  }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
13
12
  "update:modelValue": (value: Record<string, unknown>) => any;
14
- "update:config": (args_0: readonly ({
15
- type: "string";
16
- path: string;
17
- title: readonly {
18
- locale: "zh" | "ja" | "en" | "ko";
19
- message: string;
20
- }[];
21
- icon?: string | undefined;
22
- style?: string | undefined;
23
- discardEmptyString?: boolean | undefined;
24
- maxLength?: string | undefined;
25
- hidden?: string | undefined;
26
- disabled?: string | undefined;
27
- validation?: readonly Readonly<{
28
- expression: string;
29
- message: string;
30
- }>[] | undefined;
31
- } | {
32
- type: "number";
33
- path: string;
34
- title: readonly {
35
- locale: "zh" | "ja" | "en" | "ko";
36
- message: string;
37
- }[];
38
- icon?: string | undefined;
39
- style?: string | undefined;
40
- min?: string | undefined;
41
- max?: string | undefined;
42
- step?: string | undefined;
43
- hidden?: string | undefined;
44
- disabled?: string | undefined;
45
- validation?: readonly Readonly<{
46
- expression: string;
47
- message: string;
48
- }>[] | undefined;
49
- } | {
50
- type: "select";
51
- path: string;
52
- title: readonly {
53
- locale: "zh" | "ja" | "en" | "ko";
54
- message: string;
55
- }[];
56
- options: string;
57
- label: string;
58
- value: string;
59
- key: string;
60
- icon?: string | undefined;
61
- style?: string | undefined;
62
- hidden?: string | undefined;
63
- disabled?: string | undefined;
64
- validation?: readonly Readonly<{
65
- expression: string;
66
- message: string;
67
- }>[] | undefined;
68
- } | {
69
- type: "calendar";
70
- path: string;
71
- title: readonly {
72
- locale: "zh" | "ja" | "en" | "ko";
73
- message: string;
74
- }[];
75
- mode: "date" | "month" | "year";
76
- value: string;
77
- icon?: string | undefined;
78
- style?: string | undefined;
79
- display?: string | undefined;
80
- disableDate?: string | undefined;
81
- hidden?: string | undefined;
82
- disabled?: string | undefined;
83
- validation?: readonly Readonly<{
84
- expression: string;
85
- message: string;
86
- }>[] | undefined;
87
- })[]) => any;
13
+ "update:config": (args_0: Readonly<{
14
+ orientation: "vertical" | "horizontal" | "floating";
15
+ fields: readonly ({
16
+ type: "string";
17
+ path: string;
18
+ title: readonly {
19
+ locale: "zh" | "ja" | "en" | "ko";
20
+ message: string;
21
+ }[];
22
+ icon?: string | undefined;
23
+ style?: string | undefined;
24
+ discardEmptyString?: boolean | undefined;
25
+ maxLength?: string | undefined;
26
+ hidden?: string | undefined;
27
+ disabled?: string | undefined;
28
+ validation?: readonly Readonly<{
29
+ expression: string;
30
+ message: string;
31
+ }>[] | undefined;
32
+ } | {
33
+ type: "number";
34
+ path: string;
35
+ title: readonly {
36
+ locale: "zh" | "ja" | "en" | "ko";
37
+ message: string;
38
+ }[];
39
+ icon?: string | undefined;
40
+ style?: string | undefined;
41
+ min?: string | undefined;
42
+ max?: string | undefined;
43
+ step?: string | undefined;
44
+ hidden?: string | undefined;
45
+ disabled?: string | undefined;
46
+ validation?: readonly Readonly<{
47
+ expression: string;
48
+ message: string;
49
+ }>[] | undefined;
50
+ } | {
51
+ type: "select";
52
+ path: string;
53
+ title: readonly {
54
+ locale: "zh" | "ja" | "en" | "ko";
55
+ message: string;
56
+ }[];
57
+ options: string;
58
+ label: string;
59
+ value: string;
60
+ key: string;
61
+ icon?: string | undefined;
62
+ style?: string | undefined;
63
+ hidden?: string | undefined;
64
+ disabled?: string | undefined;
65
+ validation?: readonly Readonly<{
66
+ expression: string;
67
+ message: string;
68
+ }>[] | undefined;
69
+ } | {
70
+ type: "calendar";
71
+ path: string;
72
+ title: readonly {
73
+ locale: "zh" | "ja" | "en" | "ko";
74
+ message: string;
75
+ }[];
76
+ mode: "date" | "month" | "year";
77
+ value: string;
78
+ icon?: string | undefined;
79
+ style?: string | undefined;
80
+ display?: string | undefined;
81
+ disableDate?: string | undefined;
82
+ hidden?: string | undefined;
83
+ disabled?: string | undefined;
84
+ validation?: readonly Readonly<{
85
+ expression: string;
86
+ message: string;
87
+ }>[] | undefined;
88
+ })[];
89
+ }>) => any;
88
90
  }, string, import("vue").PublicProps, Readonly<{
89
- orientation?: "horizontal" | "vertical" | "floating";
90
- config?: Effect.Effect<ReadonlyArray<Field> | undefined>;
91
+ config?: Effect.Effect<FieldsConfig | undefined>;
91
92
  } & {
92
93
  modelValue?: Record<string, unknown>;
93
94
  }> & Readonly<{
94
95
  "onUpdate:modelValue"?: ((value: Record<string, unknown>) => any) | undefined;
95
- "onUpdate:config"?: ((args_0: readonly ({
96
- type: "string";
97
- path: string;
98
- title: readonly {
99
- locale: "zh" | "ja" | "en" | "ko";
100
- message: string;
101
- }[];
102
- icon?: string | undefined;
103
- style?: string | undefined;
104
- discardEmptyString?: boolean | undefined;
105
- maxLength?: string | undefined;
106
- hidden?: string | undefined;
107
- disabled?: string | undefined;
108
- validation?: readonly Readonly<{
109
- expression: string;
110
- message: string;
111
- }>[] | undefined;
112
- } | {
113
- type: "number";
114
- path: string;
115
- title: readonly {
116
- locale: "zh" | "ja" | "en" | "ko";
117
- message: string;
118
- }[];
119
- icon?: string | undefined;
120
- style?: string | undefined;
121
- min?: string | undefined;
122
- max?: string | undefined;
123
- step?: string | undefined;
124
- hidden?: string | undefined;
125
- disabled?: string | undefined;
126
- validation?: readonly Readonly<{
127
- expression: string;
128
- message: string;
129
- }>[] | undefined;
130
- } | {
131
- type: "select";
132
- path: string;
133
- title: readonly {
134
- locale: "zh" | "ja" | "en" | "ko";
135
- message: string;
136
- }[];
137
- options: string;
138
- label: string;
139
- value: string;
140
- key: string;
141
- icon?: string | undefined;
142
- style?: string | undefined;
143
- hidden?: string | undefined;
144
- disabled?: string | undefined;
145
- validation?: readonly Readonly<{
146
- expression: string;
147
- message: string;
148
- }>[] | undefined;
149
- } | {
150
- type: "calendar";
151
- path: string;
152
- title: readonly {
153
- locale: "zh" | "ja" | "en" | "ko";
154
- message: string;
155
- }[];
156
- mode: "date" | "month" | "year";
157
- value: string;
158
- icon?: string | undefined;
159
- style?: string | undefined;
160
- display?: string | undefined;
161
- disableDate?: string | undefined;
162
- hidden?: string | undefined;
163
- disabled?: string | undefined;
164
- validation?: readonly Readonly<{
165
- expression: string;
166
- message: string;
167
- }>[] | undefined;
168
- })[]) => any) | undefined;
169
- }>, {
170
- orientation: "horizontal" | "vertical" | "floating";
171
- }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
96
+ "onUpdate:config"?: ((args_0: Readonly<{
97
+ orientation: "vertical" | "horizontal" | "floating";
98
+ fields: readonly ({
99
+ type: "string";
100
+ path: string;
101
+ title: readonly {
102
+ locale: "zh" | "ja" | "en" | "ko";
103
+ message: string;
104
+ }[];
105
+ icon?: string | undefined;
106
+ style?: string | undefined;
107
+ discardEmptyString?: boolean | undefined;
108
+ maxLength?: string | undefined;
109
+ hidden?: string | undefined;
110
+ disabled?: string | undefined;
111
+ validation?: readonly Readonly<{
112
+ expression: string;
113
+ message: string;
114
+ }>[] | undefined;
115
+ } | {
116
+ type: "number";
117
+ path: string;
118
+ title: readonly {
119
+ locale: "zh" | "ja" | "en" | "ko";
120
+ message: string;
121
+ }[];
122
+ icon?: string | undefined;
123
+ style?: string | undefined;
124
+ min?: string | undefined;
125
+ max?: string | undefined;
126
+ step?: string | undefined;
127
+ hidden?: string | undefined;
128
+ disabled?: string | undefined;
129
+ validation?: readonly Readonly<{
130
+ expression: string;
131
+ message: string;
132
+ }>[] | undefined;
133
+ } | {
134
+ type: "select";
135
+ path: string;
136
+ title: readonly {
137
+ locale: "zh" | "ja" | "en" | "ko";
138
+ message: string;
139
+ }[];
140
+ options: string;
141
+ label: string;
142
+ value: string;
143
+ key: string;
144
+ icon?: string | undefined;
145
+ style?: string | undefined;
146
+ hidden?: string | undefined;
147
+ disabled?: string | undefined;
148
+ validation?: readonly Readonly<{
149
+ expression: string;
150
+ message: string;
151
+ }>[] | undefined;
152
+ } | {
153
+ type: "calendar";
154
+ path: string;
155
+ title: readonly {
156
+ locale: "zh" | "ja" | "en" | "ko";
157
+ message: string;
158
+ }[];
159
+ mode: "date" | "month" | "year";
160
+ value: string;
161
+ icon?: string | undefined;
162
+ style?: string | undefined;
163
+ display?: string | undefined;
164
+ disableDate?: string | undefined;
165
+ hidden?: string | undefined;
166
+ disabled?: string | undefined;
167
+ validation?: readonly Readonly<{
168
+ expression: string;
169
+ message: string;
170
+ }>[] | undefined;
171
+ })[];
172
+ }>) => any) | undefined;
173
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
172
174
  [x: string]: ((props: any) => any) | undefined;
173
175
  }>;
174
176
  type __VLS_WithSlots<T, S> = T & {
@@ -5,17 +5,19 @@ defineOptions({
5
5
  inheritAttrs: false
6
6
  });
7
7
  const props = defineProps({
8
- orientation: { type: String, required: false, default: "horizontal" },
9
8
  config: { type: null, required: false }
10
9
  });
11
10
  const emit = defineEmits(["update:config"]);
12
11
  const modelValue = defineModel("modelValue", { type: Object, ...{
13
12
  default: () => ({})
14
13
  } });
15
- const emptyFields = [];
16
- const fields = props.config ? props.config.pipe(Effect.map((config) => config ?? emptyFields)) : Effect.succeed(emptyFields);
17
- function handleConfigUpdate(config) {
18
- emit("update:config", config);
14
+ const defaultConfig = {
15
+ orientation: "horizontal",
16
+ fields: []
17
+ };
18
+ const config = props.config ? props.config.pipe(Effect.map((config2) => config2 ?? defaultConfig)) : Effect.succeed(defaultConfig);
19
+ function handleConfigUpdate(config2) {
20
+ emit("update:config", config2);
19
21
  }
20
22
  </script>
21
23
 
@@ -23,6 +25,7 @@ function handleConfigUpdate(config) {
23
25
  export {
24
26
  CalendarFieldC,
25
27
  FieldC,
28
+ FieldsConfigC,
26
29
  NumberFieldC,
27
30
  SelectFieldC,
28
31
  StringFieldC
@@ -33,9 +36,8 @@ export {
33
36
  <UiFields
34
37
  v-bind="$attrs"
35
38
  v-model="modelValue"
36
- :orientation="props.orientation"
37
- :fields="fields"
38
- @update:fields="handleConfigUpdate"
39
+ :config="config"
40
+ @update:config="handleConfigUpdate"
39
41
  >
40
42
  <template
41
43
  v-for="(_, slotName) in $slots"