vueless 0.0.254 → 0.0.255

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": "vueless",
3
- "version": "0.0.254",
3
+ "version": "0.0.255",
4
4
  "license": "MIT",
5
5
  "description": "Vue Styleless Component Framework.",
6
6
  "homepage": "https://vueless.com",
@@ -44,10 +44,10 @@ const EnumVariantTemplate = (args, { argTypes } = {}) => ({
44
44
  <URow>
45
45
  <UButton
46
46
  v-for="(option, index) in options"
47
+ :key="index"
47
48
  v-bind="args"
48
49
  :[args.enum]="option"
49
50
  :label="option"
50
- :key="index"
51
51
  />
52
52
  </URow>
53
53
  </UCol>
@@ -53,10 +53,10 @@ const EnumVariantTemplate = (args, { argTypes } = {}) => ({
53
53
  <URow>
54
54
  <ULink
55
55
  v-for="(option, index) in options"
56
+ :key="index"
56
57
  v-bind="args"
57
58
  :[args.enum]="option"
58
59
  :label="prefixedOptions[index]"
59
- :key="index"
60
60
  />
61
61
  </URow>
62
62
  `,
@@ -37,8 +37,8 @@ const DefaultTemplate = (args) => ({
37
37
  },
38
38
  template: `
39
39
  <UToggle
40
- v-model="value"
41
40
  v-bind="args"
41
+ v-model="value"
42
42
  :options="OPTIONS"
43
43
  >
44
44
  ${args.slotTemplate || getSlotsFragment()}
@@ -62,8 +62,8 @@ const EnumVariantTemplate = (args, { argTypes } = {}) => ({
62
62
  <UToggle
63
63
  v-for="(option, index) in options"
64
64
  :key="index"
65
- v-model="value"
66
65
  v-bind="args"
66
+ v-model="value"
67
67
  :[args.enum]="option"
68
68
  :label="option"
69
69
  :options="[
@@ -28,8 +28,12 @@ const DefaultTemplate = (args) => ({
28
28
  return { args, slots };
29
29
  },
30
30
  template: `
31
- <UToggleItem v-bind="args" name="toggle" v-model="args.modelValue">
32
- ${args.slotTemplate || getSlotsFragment()}
31
+ <UToggleItem
32
+ v-bind="args"
33
+ v-model="args.modelValue"
34
+ name="toggle"
35
+ >
36
+ ${args.slotTemplate || getSlotsFragment()}
33
37
  </UToggleItem>
34
38
  `,
35
39
  });
@@ -61,9 +61,9 @@ const EnumVariantTemplate = (args, { argTypes } = {}) => ({
61
61
  <URow>
62
62
  <UCard
63
63
  v-for="(option, index) in options"
64
+ :key="index"
64
65
  v-bind="args"
65
66
  :[args.enum]="option"
66
- :key="index"
67
67
  >
68
68
  ${defaultTemplate}
69
69
  </UCard>
@@ -40,10 +40,7 @@ const DefaultTemplate = (args) => ({
40
40
  return { args, slots };
41
41
  },
42
42
  template: `
43
- <UDropdownButton
44
- v-bind="args"
45
- v-model="args.modelValue"
46
- >
43
+ <UDropdownButton v-bind="args">
47
44
  ${args.slotTemplate || getSlotsFragment()}
48
45
  </UDropdownButton>
49
46
  `,
@@ -83,12 +80,12 @@ const VariantColorsTemplate = (args, { argTypes } = {}) => ({
83
80
  <UCol>
84
81
  <URow v-for="(variant, index) in variants" :key="index">
85
82
  <UDropdownButton
86
- v-for="(color, idx) in colors"
83
+ v-for="(color, index) in colors"
84
+ :key="index"
87
85
  v-bind="args"
88
86
  :color="color"
89
87
  :variant="variant"
90
88
  :label="color"
91
- :key="idx"
92
89
  />
93
90
  </URow>
94
91
  </UCol>
@@ -1,4 +1,4 @@
1
- import { getArgTypes, getSlotNames, allSlotsFragment } from "../service.storybook";
1
+ import { getArgTypes, getSlotNames, getSlotsFragment } from "../service.storybook";
2
2
 
3
3
  import UCheckbox from "../ui.form-checkbox";
4
4
  import UCheckboxGroup from "../ui.form-checkbox-group";
@@ -14,23 +14,23 @@ export default {
14
14
  component: UCheckbox,
15
15
  args: {
16
16
  label: "Label",
17
- value: {},
18
17
  },
19
18
  argTypes: {
20
19
  ...getArgTypes(UCheckbox.name),
20
+ modelValue: { control: { type: "boolean" } },
21
21
  },
22
22
  };
23
23
 
24
24
  const DefaultTemplate = (args) => ({
25
- components: { UCheckbox },
25
+ components: { UCheckbox, UBadge },
26
26
  setup() {
27
27
  const slots = getSlotNames(UCheckbox.name);
28
28
 
29
29
  return { args, slots };
30
30
  },
31
31
  template: `
32
- <UCheckbox v-bind="args" v-model="args.value">
33
- ${allSlotsFragment}
32
+ <UCheckbox v-bind="args" v-model="args.modelValue">
33
+ ${args.slotTemplate || getSlotsFragment()}
34
34
  </UCheckbox>
35
35
  `,
36
36
  });
@@ -89,48 +89,35 @@ const ValueTypesTemplate = (args) => ({
89
89
  `,
90
90
  });
91
91
 
92
- const SizesTemplate = (args, { argTypes } = {}) => ({
92
+ const EnumVariantTemplate = (args, { argTypes } = {}) => ({
93
93
  components: { UCheckbox, UCol },
94
94
  setup() {
95
95
  return {
96
96
  args,
97
- sizes: argTypes.size.options,
97
+ options: argTypes[args.enum].options,
98
98
  };
99
99
  },
100
100
  template: `
101
101
  <UCol gap="xl">
102
102
  <UCheckbox
103
- v-for="(size, index) in sizes"
103
+ v-for="(option, index) in options"
104
104
  :key="index"
105
105
  v-bind="args"
106
- v-model="args.value[size]"
107
- :size="size"
108
- :label="size"
106
+ :[args.enum]="option"
107
+ :label="option"
109
108
  />
110
109
  </UCol>
111
110
  `,
112
111
  });
113
112
 
114
- const SlotTemplate = (args) => ({
115
- components: { UCheckbox, UBadge },
116
- setup() {
117
- return { args };
118
- },
119
- template: `
120
- <UCheckbox v-bind="args" v-model="args.value" description="hello">
121
- ${args.slotTemplate}
122
- </UCheckbox>
123
- `,
124
- });
125
-
126
113
  export const Default = DefaultTemplate.bind({});
127
114
  Default.args = {};
128
115
 
129
116
  export const CustomValues = ValueTypesTemplate.bind({});
130
117
  CustomValues.args = {};
131
118
 
132
- export const Sizes = SizesTemplate.bind({});
133
- Sizes.args = {};
119
+ export const Sizes = EnumVariantTemplate.bind({});
120
+ Sizes.args = { enum: "size" };
134
121
 
135
122
  export const Disabled = DefaultTemplate.bind({});
136
123
  Disabled.args = { disabled: true };
@@ -138,7 +125,7 @@ Disabled.args = { disabled: true };
138
125
  export const Description = DefaultTemplate.bind({});
139
126
  Description.args = { description: "Some description" };
140
127
 
141
- export const slotFooter = SlotTemplate.bind({});
128
+ export const slotFooter = DefaultTemplate.bind({});
142
129
  slotFooter.args = {
143
130
  slotTemplate: `
144
131
  <template #footer>
@@ -1,4 +1,4 @@
1
- import { getArgTypes } from "../service.storybook";
1
+ import { getArgTypes, getSlotNames, getSlotsFragment } from "../service.storybook";
2
2
 
3
3
  import UCheckboxGroup from "../ui.form-checkbox-group";
4
4
  import UCheckbox from "../ui.form-checkbox";
@@ -29,7 +29,9 @@ export default {
29
29
  const DefaultTemplate = (args) => ({
30
30
  components: { UCheckboxGroup, UCheckbox, UAlert, URow },
31
31
  setup() {
32
- return { args };
32
+ const slots = getSlotNames(UCheckboxGroup.name);
33
+
34
+ return { args, slots };
33
35
  },
34
36
  data() {
35
37
  return {
@@ -39,9 +41,7 @@ const DefaultTemplate = (args) => ({
39
41
  template: `
40
42
  <URow class="!flex-col">
41
43
  <UCheckboxGroup v-bind="args" v-model="value">
42
- <template v-for="(radio, index) in args.options" :key="index">
43
- <UCheckbox v-bind="radio"/>
44
- </template>
44
+ ${args.slotTemplate || getSlotsFragment()}
45
45
  </UCheckboxGroup>
46
46
 
47
47
  <URow>
@@ -53,25 +53,29 @@ const DefaultTemplate = (args) => ({
53
53
  `,
54
54
  });
55
55
 
56
- const OptionsTemplate = (args) => ({
57
- components: { UCheckboxGroup, UCheckbox, UAlert, URow },
56
+ const EnumVariantTemplate = (args, { argTypes } = {}) => ({
57
+ components: { UCheckboxGroup, URow },
58
58
  setup() {
59
59
  return { args };
60
60
  },
61
61
  data() {
62
62
  return {
63
63
  value: args.value,
64
+ options: argTypes[args.enum].options,
64
65
  };
65
66
  },
66
67
  template: `
67
68
  <URow class="!flex-col">
68
- <UCheckboxGroup v-bind="args" v-model="value" :options="args.options" />
69
-
70
- <URow>
71
- <UAlert color="blue">
72
- <p>Selected value: {{ value }}</p>
73
- </UAlert>
74
- </URow>
69
+ <UCheckboxGroup
70
+ v-for="(option, index) in options"
71
+ :key="option"
72
+ v-bind="args"
73
+ v-model="value"
74
+ :label="option"
75
+ :[args.enum]="option"
76
+ :options="args.options"
77
+ name="option"
78
+ />
75
79
  </URow>
76
80
  `,
77
81
  });
@@ -79,7 +83,11 @@ const OptionsTemplate = (args) => ({
79
83
  export const Default = DefaultTemplate.bind({});
80
84
  Default.args = {
81
85
  name: "Default",
82
- isDefaultStory: true,
86
+ slotTemplate: `
87
+ <template v-for="(radio, index) in args.options" :key="index">
88
+ <UCheckbox v-bind="radio"/>
89
+ </template>
90
+ `,
83
91
  options: [
84
92
  { name: "Default", label: "String", value: "One" },
85
93
  { name: "Default", label: "Boolean", value: false },
@@ -97,7 +105,7 @@ Default.args = {
97
105
  ],
98
106
  };
99
107
 
100
- export const Options = OptionsTemplate.bind({});
108
+ export const Options = DefaultTemplate.bind({});
101
109
  Options.args = {
102
110
  name: "Options",
103
111
  options: [
@@ -109,68 +117,14 @@ Options.args = {
109
117
  ],
110
118
  };
111
119
 
112
- const ColorsTemplate = (args, { argTypes } = {}) => ({
113
- components: { UCheckboxGroup, URow },
114
- setup() {
115
- return { args };
116
- },
117
- data() {
118
- return {
119
- value: args.value,
120
- colors: argTypes.color.options,
121
- };
122
- },
123
- template: `
124
- <URow class="!flex-col">
125
- <UCheckboxGroup
126
- v-bind="args"
127
- v-for="color in colors"
128
- :key="color"
129
- :label="color"
130
- :color="color"
131
- :options="args.options"
132
- name="color"
133
- v-model="value"
134
- />
135
- </URow>
136
- `,
137
- });
138
-
139
- const SizesTemplate = (args, { argTypes } = {}) => ({
140
- components: { UCheckboxGroup, URow },
141
- setup() {
142
- return { args };
143
- },
144
- data() {
145
- return {
146
- value: args.value,
147
- sizes: argTypes.size.options,
148
- };
149
- },
150
- template: `
151
- <URow class="!flex-col">
152
- <UCheckboxGroup
153
- v-bind="args"
154
- v-for="size in sizes"
155
- :key="size"
156
- :label="size"
157
- :size="size"
158
- :options="args.options"
159
- name="size"
160
- v-model="value"
161
- />
162
- </URow>
163
- `,
164
- });
165
-
166
120
  export const disabled = DefaultTemplate.bind({});
167
121
  disabled.args = { name: "Disabled", disabled: true };
168
122
 
169
123
  export const error = DefaultTemplate.bind({});
170
124
  error.args = { name: "Error", error: "some error" };
171
125
 
172
- export const Colors = ColorsTemplate.bind({});
173
- Colors.args = { name: "Colors" };
126
+ export const Colors = EnumVariantTemplate.bind({});
127
+ Colors.args = { enum: "color", name: "Colors" };
174
128
 
175
- export const Sizes = SizesTemplate.bind({});
176
- Sizes.args = { name: "Sizes" };
129
+ export const Sizes = EnumVariantTemplate.bind({});
130
+ Sizes.args = { enum: "size", name: "Sizes" };
@@ -1,4 +1,4 @@
1
- import { getArgTypes } from "../service.storybook";
1
+ import { getArgTypes, getSlotNames, getSlotsFragment } from "../service.storybook";
2
2
 
3
3
  import UCheckboxMultiState from "../ui.form-checkbox-multi-state";
4
4
  import URow from "../ui.container-row";
@@ -11,7 +11,6 @@ export default {
11
11
  title: "Form Inputs & Controls / Checkbox Multistate",
12
12
  component: UCheckboxMultiState,
13
13
  args: {
14
- modelValue: false,
15
14
  options: [
16
15
  { value: false, label: "empty", icon: "", description: "checkbox empty" },
17
16
  { value: true, label: "selected", icon: "check", description: "checkbox selected" },
@@ -20,36 +19,41 @@ export default {
20
19
  },
21
20
  argTypes: {
22
21
  ...getArgTypes(UCheckboxMultiState.name),
22
+ modelValue: { control: { type: "boolean" } },
23
23
  },
24
24
  };
25
25
 
26
26
  const DefaultTemplate = (args) => ({
27
27
  components: { UCheckboxMultiState },
28
28
  setup() {
29
- return { args };
29
+ const slots = getSlotNames(UCheckboxMultiState.name);
30
+
31
+ return { args, slots };
30
32
  },
31
33
  template: `
32
- <UCheckboxMultiState v-bind="args" v-model="args.value" />
34
+ <UCheckboxMultiState v-bind="args" v-model="args.modelValue">
35
+ ${args.slotTemplate || getSlotsFragment()}
36
+ </UCheckboxMultiState>
33
37
  `,
34
38
  });
35
39
 
36
- const SizesTemplate = (args, { argTypes } = {}) => ({
40
+ const EnumVariantTemplate = (args, { argTypes } = {}) => ({
37
41
  components: { UCheckboxMultiState, URow },
38
42
  setup() {
39
43
  return {
40
44
  args,
41
- sizes: argTypes.size.options,
45
+ options: argTypes[args.enum].options,
42
46
  };
43
47
  },
44
48
  template: `
45
49
  <URow>
46
50
  <UCheckboxMultiState
47
- v-for="(size, index) in sizes"
48
- v-bind="args"
49
- :size="size"
50
- v-model="args.value"
51
- :label="size"
51
+ v-for="(option, index) in options"
52
52
  :key="index"
53
+ v-bind="args"
54
+ v-model="args.modelValue"
55
+ :[args.enum]="option"
56
+ :label="option"
53
57
  />
54
58
  </URow>
55
59
  `,
@@ -58,5 +62,5 @@ const SizesTemplate = (args, { argTypes } = {}) => ({
58
62
  export const Default = DefaultTemplate.bind({});
59
63
  Default.args = {};
60
64
 
61
- export const sizes = SizesTemplate.bind({});
62
- sizes.args = {};
65
+ export const sizes = EnumVariantTemplate.bind({});
66
+ sizes.args = { enum: "size" };
@@ -11,7 +11,7 @@ export default {
11
11
  component: UColorPicker,
12
12
  args: {
13
13
  label: "Label",
14
- value: "",
14
+ modelValue: "",
15
15
  },
16
16
  argTypes: {
17
17
  ...getArgTypes(UColorPicker.name),
@@ -26,7 +26,7 @@ const DefaultTemplate = (args) => ({
26
26
  return { args, slots };
27
27
  },
28
28
  template: `
29
- <UColorPicker v-bind="args" v-model="args.value">
29
+ <UColorPicker v-bind="args" v-model="args.modelValue">
30
30
  ${args.slotTemplate || getSlotsFragment()}
31
31
  </UColorPicker>
32
32
  `,
@@ -46,7 +46,7 @@ const EnumVariantTemplate = (args, { argTypes } = {}) => ({
46
46
  v-for="(option, index) in options"
47
47
  :key="index"
48
48
  v-bind="args"
49
- v-model="args.value"
49
+ v-model="args.modelValue"
50
50
  :[args.enum]="option"
51
51
  :name="option"
52
52
  />
@@ -13,6 +13,7 @@ export default {
13
13
  component: UDatePicker,
14
14
  args: {
15
15
  label: "Label",
16
+ modelValue: null,
16
17
  },
17
18
  argTypes: {
18
19
  ...getArgTypes(UDatePicker.name),
@@ -33,18 +34,13 @@ const DefaultTemplate = (args) => ({
33
34
 
34
35
  return { args, slots };
35
36
  },
36
- data() {
37
- return {
38
- value: this.args.value,
39
- };
40
- },
41
37
  template: `
42
- <UDatePicker v-bind="args" v-model="value">
38
+ <UDatePicker v-bind="args" v-model="args.modelValue">
43
39
  ${args.slotTemplate || getSlotsFragment()}
44
40
  </UDatePicker>
45
41
 
46
42
  <div class="mt-4">
47
- {{ value }}
43
+ {{ args.modelValue }}
48
44
  </div>
49
45
  `,
50
46
  });
@@ -84,7 +80,7 @@ const OpenDirectionTemplate = (args) => ({
84
80
  open-direction-y="top"
85
81
  open-direction-x="left"
86
82
  v-bind="args"
87
- v-model="args.value"
83
+ v-model="args.modelValue"
88
84
  label="Top Left"
89
85
  />
90
86
  <UDatePicker
@@ -92,7 +88,7 @@ const OpenDirectionTemplate = (args) => ({
92
88
  open-direction-y="top"
93
89
  open-direction-x="right"
94
90
  v-bind="args"
95
- v-model="args.value"
91
+ v-model="args.modelValue"
96
92
  label="Top Right"
97
93
  />
98
94
  <UDatePicker
@@ -100,7 +96,7 @@ const OpenDirectionTemplate = (args) => ({
100
96
  open-direction-y="bottom"
101
97
  open-direction-x="left"
102
98
  v-bind="args"
103
- v-model="args.value"
99
+ v-model="args.modelValue"
104
100
  label="Bottom Left"
105
101
  />
106
102
  <UDatePicker
@@ -108,7 +104,7 @@ const OpenDirectionTemplate = (args) => ({
108
104
  open-direction-y="bottom"
109
105
  open-direction-x="right"
110
106
  v-bind="args"
111
- v-model="args.value"
107
+ v-model="args.modelValue"
112
108
  label="Bottom Right"
113
109
  />
114
110
  </URow>
@@ -116,7 +112,7 @@ const OpenDirectionTemplate = (args) => ({
116
112
  });
117
113
 
118
114
  export const Default = DefaultTemplate.bind({});
119
- Default.args = { value: new Date() };
115
+ Default.args = { modelValue: new Date() };
120
116
 
121
117
  export const sizes = EnumVariantTemplate.bind({});
122
118
  sizes.args = { enum: "size", label: "" };
@@ -137,16 +133,16 @@ export const placeholder = DefaultTemplate.bind({});
137
133
  placeholder.args = { placeholder: "some placeholder" };
138
134
 
139
135
  export const DateFormat = DefaultTemplate.bind({});
140
- DateFormat.args = { dateFormat: "d.m.Y", userFormat: "d.m.Y", value: "28.06.2024" };
136
+ DateFormat.args = { dateFormat: "d.m.Y", userFormat: "d.m.Y", modelValue: "28.06.2024" };
141
137
 
142
138
  export const Timepicker = DefaultTemplate.bind({});
143
- Timepicker.args = { timepicker: true, value: new Date(2024, 2, 14, 12, 24, 14) };
139
+ Timepicker.args = { timepicker: true, modelValue: new Date(2024, 2, 14, 12, 24, 14) };
144
140
 
145
141
  export const MinMax = DefaultTemplate.bind({});
146
142
  MinMax.args = {
147
143
  minDate: new Date(2022, 2, 22),
148
144
  maxDate: new Date(2022, 2, 26),
149
- value: new Date(2022, 2, 24),
145
+ modelValue: new Date(2022, 2, 24),
150
146
  };
151
147
 
152
148
  export const slotIcon = DefaultTemplate.bind({});
@@ -47,10 +47,10 @@ const EnumVariantTemplate = (args, { argTypes } = {}) => ({
47
47
  <UCol>
48
48
  <UInput
49
49
  v-for="(option, index) in options"
50
+ :key="index"
50
51
  v-bind="args"
51
52
  :[args.enum]="option"
52
53
  :label="option"
53
- :key="index"
54
54
  />
55
55
  </UCol>
56
56
  `,
@@ -54,8 +54,8 @@ const EnumVariantTemplate = (args, { argTypes } = {}) => ({
54
54
  <UCol gap="xl">
55
55
  <div v-for="(option, index) in options" :key="index">
56
56
  <UInputFile
57
- :[args.enum]="option"
58
57
  v-bind="args"
58
+ :[args.enum]="option"
59
59
  :label="option"
60
60
  />
61
61
  </div>
@@ -48,10 +48,10 @@ const EnumVariantTemplate = (args, { argTypes } = {}) => ({
48
48
  <UCol>
49
49
  <UInputMoney
50
50
  v-for="(option, index) in options"
51
+ :key="index"
51
52
  v-bind="args"
52
53
  :[args.enum]="option"
53
54
  :label="option"
54
- :key="index"
55
55
  />
56
56
  </UCol>
57
57
  `,
@@ -29,7 +29,7 @@ const DefaultTemplate = (args) => ({
29
29
  };
30
30
  },
31
31
  template: `
32
- <UInputNumber v-model="count" v-bind="args">
32
+ <UInputNumber v-bind="args" v-model="count">
33
33
  ${args.slotTemplate || getSlotsFragment()}
34
34
  </UInputNumber>
35
35
  `,
@@ -56,11 +56,11 @@ const EnumVariantTemplate = (args, { argTypes } = {}) => ({
56
56
  <UCol gap="xl">
57
57
  <UInputNumber
58
58
  v-for="(option, index) in options"
59
+ :key="index"
59
60
  v-bind="args"
61
+ v-model="sizeValues[index].count"
60
62
  :[args.enum]="option"
61
- :key="index"
62
63
  :label="sizeValues[index].label"
63
- v-model="sizeValues[index].count"
64
64
  />
65
65
  </UCol>
66
66
  `,
@@ -42,10 +42,10 @@ const EnumVariantTemplate = (args, { argTypes } = {}) => ({
42
42
  <URow>
43
43
  <UInputSearch
44
44
  v-for="(option, index) in options"
45
+ :key="index"
45
46
  v-bind="args"
46
47
  v-model="args.modelValue"
47
48
  :[args.enum]="option"
48
- :key="index"
49
49
  >
50
50
  </UInputSearch>
51
51
  </URow>