vueless 0.0.571 → 0.0.573

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.571",
3
+ "version": "0.0.573",
4
4
  "license": "MIT",
5
5
  "description": "Vue Styleless UI Component Library, powered by Tailwind CSS.",
6
6
  "keywords": [
@@ -44,7 +44,7 @@ export interface UCalendarProps<TModelValue> {
44
44
  /**
45
45
  * Date string format.
46
46
  */
47
- dateFormat?: string | undefined;
47
+ dateFormat?: string;
48
48
 
49
49
  /**
50
50
  * Same as date format, but used when timepicker is enabled.
@@ -64,12 +64,12 @@ export interface UCalendarProps<TModelValue> {
64
64
  /**
65
65
  * Min date (JavaScript Date object or string formatted in given `dateFormat`).
66
66
  */
67
- minDate?: string | Date | undefined;
67
+ minDate?: string | Date;
68
68
 
69
69
  /**
70
70
  * Max date (JavaScript Date object or string formatted in given `dateFormat`).
71
71
  */
72
- maxDate?: string | Date | undefined;
72
+ maxDate?: string | Date;
73
73
 
74
74
  /**
75
75
  * Component config object.
@@ -38,7 +38,6 @@ const props = withDefaults(defineProps<Props>(), {
38
38
  dateTimeFormat: getDefault<Props>(defaultConfig, UDatePicker).dateTimeFormat,
39
39
  userDateFormat: getDefault<Props>(defaultConfig, UDatePicker).userDateFormat,
40
40
  userDateTimeFormat: getDefault<Props>(defaultConfig, UDatePicker).userDateTimeFormat,
41
- leftIcon: getDefault<Props>(defaultConfig, UDatePicker).leftIcon,
42
41
  rightIcon: getDefault<Props>(defaultConfig, UDatePicker).rightIcon,
43
42
  disabled: getDefault<Props>(defaultConfig, UDatePicker).disabled,
44
43
  dataTest: "",
@@ -245,7 +244,7 @@ defineExpose({
245
244
  <div v-bind="wrapperAttrs" ref="wrapper">
246
245
  <UInput
247
246
  :id="elementId"
248
- :key="String(localValue)"
247
+ :key="String(userDateFormat)"
249
248
  ref="input"
250
249
  :model-value="userFormatDate"
251
250
  :label-align="labelAlign"
@@ -56,7 +56,7 @@ export interface UDatePickerProps<TModelValue> {
56
56
  /**
57
57
  * Date string format.
58
58
  */
59
- dateFormat?: string | undefined;
59
+ dateFormat?: string;
60
60
 
61
61
  /**
62
62
  * Same as date format, but used when timepicker is enabled.
@@ -76,12 +76,12 @@ export interface UDatePickerProps<TModelValue> {
76
76
  /**
77
77
  * Min date (JavaScript Date object or string formatted in given `dateFormat`).
78
78
  */
79
- minDate?: string | Date | undefined;
79
+ minDate?: string | Date;
80
80
 
81
81
  /**
82
82
  * Max date (JavaScript Date object or string formatted in given `dateFormat`).
83
83
  */
84
- maxDate?: string | Date | undefined;
84
+ maxDate?: string | Date;
85
85
 
86
86
  /**
87
87
  * Left icon name.
@@ -73,10 +73,8 @@ const props = withDefaults(defineProps<Props>(), {
73
73
  dateFormat: getDefault<Props>(defaultConfig, UDatePickerRange).dateFormat,
74
74
  userDateFormat: getDefault<Props>(defaultConfig, UDatePickerRange).userDateFormat,
75
75
  size: getDefault<Props>(defaultConfig, UDatePickerRange).size,
76
- leftIcon: getDefault<Props>(defaultConfig, UDatePickerRange).leftIcon,
77
76
  rightIcon: getDefault<Props>(defaultConfig, UDatePickerRange).rightIcon,
78
77
  labelAlign: getDefault<Props>(defaultConfig, UDatePickerRange).labelAlign,
79
- label: getDefault<Props>(defaultConfig, UDatePickerRange).label,
80
78
  disabled: getDefault<Props>(defaultConfig, UDatePickerRange).disabled,
81
79
  customRangeButton: () => ({
82
80
  range: { from: null, to: null },
@@ -109,17 +109,17 @@ export interface UDatePickerRangeProps<TModelValue> {
109
109
  /**
110
110
  * Min date (JavaScript Date object or string formatted in given `dateFormat`).
111
111
  */
112
- minDate?: string | Date | undefined;
112
+ minDate?: string | Date;
113
113
 
114
114
  /**
115
115
  * Max date (JavaScript Date object or string formatted in given `dateFormat`).
116
116
  */
117
- maxDate?: string | Date | undefined;
117
+ maxDate?: string | Date;
118
118
 
119
119
  /**
120
120
  * Date string format.
121
121
  */
122
- dateFormat?: string | undefined;
122
+ dateFormat?: string;
123
123
 
124
124
  /**
125
125
  * Same as date format, but used when timepicker is enabled.
@@ -14,7 +14,7 @@ interface Types {
14
14
  }
15
15
 
16
16
  export interface ArgType {
17
- control?: "text" | "number" | "boolean" | "array" | "select" | false;
17
+ control?: "text" | "date" | "number" | "boolean" | "array" | "select" | false;
18
18
  options?: string[];
19
19
  table?: TableConfig;
20
20
  name?: string;
@@ -93,6 +93,26 @@ export function getArgTypes(componentName: string | undefined) {
93
93
  component.attributes?.forEach((attribute: Attribute) => {
94
94
  const type = attribute.value.type;
95
95
 
96
+ if (type.includes("|")) {
97
+ types[attribute.name] = {
98
+ control: type.split("|")[0].toLowerCase() as ArgType["control"],
99
+ table: {
100
+ defaultValue: { summary: attribute.default || "" },
101
+ },
102
+ };
103
+ }
104
+
105
+ if (attribute.enum) {
106
+ types[attribute.name] = {
107
+ options: attribute.enum,
108
+ control: "select",
109
+ table: {
110
+ defaultValue: { summary: attribute.default || "" },
111
+ type: { summary: attribute.enum.join(" | ") },
112
+ },
113
+ };
114
+ }
115
+
96
116
  if (type === "string" || type.includes("string")) {
97
117
  types[attribute.name] = {
98
118
  control: "text",
@@ -111,40 +131,46 @@ export function getArgTypes(componentName: string | undefined) {
111
131
  };
112
132
  }
113
133
 
114
- if (type === "boolean") {
134
+ if (type === "Date" || attribute.enum?.includes("Date")) {
115
135
  types[attribute.name] = {
116
- control: "boolean",
136
+ control: "date",
117
137
  table: {
118
138
  defaultValue: { summary: attribute.default || "" },
139
+ type: {
140
+ summary: ["Date", "string"].join(" | "),
141
+ },
119
142
  },
120
143
  };
121
144
  }
122
145
 
123
- if (type === "array") {
146
+ if (type === "TModelValue") {
124
147
  types[attribute.name] = {
125
- control: "array",
148
+ control: "date",
126
149
  table: {
127
- defaultValue: { summary: attribute.default || [] },
150
+ defaultValue: { summary: attribute.default || "" },
151
+ type: {
152
+ summary: ["string", "Date", "from: string, to: string", "from: Date, to: Date"].join(
153
+ " | ",
154
+ ),
155
+ },
128
156
  },
129
157
  };
130
158
  }
131
159
 
132
- if (type.includes("|")) {
160
+ if (type === "boolean") {
133
161
  types[attribute.name] = {
134
- control: type.split("|")[0] as ArgType["control"],
162
+ control: "boolean",
135
163
  table: {
136
164
  defaultValue: { summary: attribute.default || "" },
137
165
  },
138
166
  };
139
167
  }
140
168
 
141
- if (attribute.enum) {
169
+ if (type === "array") {
142
170
  types[attribute.name] = {
143
- options: attribute.enum,
144
- control: "select",
171
+ control: "array",
145
172
  table: {
146
- defaultValue: { summary: attribute.default || "" },
147
- type: { summary: attribute.enum.join(" | ") },
173
+ defaultValue: { summary: attribute.default || [] },
148
174
  },
149
175
  };
150
176
  }
package/web-types.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "framework": "vue",
3
3
  "name": "vueless",
4
- "version": "0.0.571",
4
+ "version": "0.0.573",
5
5
  "contributions": {
6
6
  "html": {
7
7
  "description-markup": "markdown",
@@ -1175,13 +1175,9 @@
1175
1175
  "name": "dateFormat",
1176
1176
  "required": false,
1177
1177
  "description": "Date string format.",
1178
- "enum": [
1179
- "string",
1180
- "undefined"
1181
- ],
1182
1178
  "value": {
1183
1179
  "kind": "expression",
1184
- "type": "union"
1180
+ "type": "string"
1185
1181
  }
1186
1182
  },
1187
1183
  {
@@ -1219,8 +1215,7 @@
1219
1215
  "description": "Min date (JavaScript Date object or string formatted in given `dateFormat`).",
1220
1216
  "enum": [
1221
1217
  "string",
1222
- "Date",
1223
- "undefined"
1218
+ "Date"
1224
1219
  ],
1225
1220
  "value": {
1226
1221
  "kind": "expression",
@@ -1233,8 +1228,7 @@
1233
1228
  "description": "Max date (JavaScript Date object or string formatted in given `dateFormat`).",
1234
1229
  "enum": [
1235
1230
  "string",
1236
- "Date",
1237
- "undefined"
1231
+ "Date"
1238
1232
  ],
1239
1233
  "value": {
1240
1234
  "kind": "expression",
@@ -3041,13 +3035,9 @@
3041
3035
  "name": "dateFormat",
3042
3036
  "required": false,
3043
3037
  "description": "Date string format.",
3044
- "enum": [
3045
- "string",
3046
- "undefined"
3047
- ],
3048
3038
  "value": {
3049
3039
  "kind": "expression",
3050
- "type": "union"
3040
+ "type": "string"
3051
3041
  }
3052
3042
  },
3053
3043
  {
@@ -3085,8 +3075,7 @@
3085
3075
  "description": "Min date (JavaScript Date object or string formatted in given `dateFormat`).",
3086
3076
  "enum": [
3087
3077
  "string",
3088
- "Date",
3089
- "undefined"
3078
+ "Date"
3090
3079
  ],
3091
3080
  "value": {
3092
3081
  "kind": "expression",
@@ -3099,8 +3088,7 @@
3099
3088
  "description": "Max date (JavaScript Date object or string formatted in given `dateFormat`).",
3100
3089
  "enum": [
3101
3090
  "string",
3102
- "Date",
3103
- "undefined"
3091
+ "Date"
3104
3092
  ],
3105
3093
  "value": {
3106
3094
  "kind": "expression",
@@ -3114,8 +3102,7 @@
3114
3102
  "value": {
3115
3103
  "kind": "expression",
3116
3104
  "type": "string"
3117
- },
3118
- "default": "getDefault<Props>(defaultConfig, UDatePicker).leftIcon"
3105
+ }
3119
3106
  },
3120
3107
  {
3121
3108
  "name": "rightIcon",
@@ -3339,8 +3326,7 @@
3339
3326
  "description": "Min date (JavaScript Date object or string formatted in given `dateFormat`).",
3340
3327
  "enum": [
3341
3328
  "string",
3342
- "Date",
3343
- "undefined"
3329
+ "Date"
3344
3330
  ],
3345
3331
  "value": {
3346
3332
  "kind": "expression",
@@ -3353,8 +3339,7 @@
3353
3339
  "description": "Max date (JavaScript Date object or string formatted in given `dateFormat`).",
3354
3340
  "enum": [
3355
3341
  "string",
3356
- "Date",
3357
- "undefined"
3342
+ "Date"
3358
3343
  ],
3359
3344
  "value": {
3360
3345
  "kind": "expression",
@@ -3365,13 +3350,9 @@
3365
3350
  "name": "dateFormat",
3366
3351
  "required": false,
3367
3352
  "description": "Date string format.",
3368
- "enum": [
3369
- "string",
3370
- "undefined"
3371
- ],
3372
3353
  "value": {
3373
3354
  "kind": "expression",
3374
- "type": "union"
3355
+ "type": "string"
3375
3356
  }
3376
3357
  },
3377
3358
  {
@@ -3415,8 +3396,7 @@
3415
3396
  "value": {
3416
3397
  "kind": "expression",
3417
3398
  "type": "string"
3418
- },
3419
- "default": "getDefault<Props>(defaultConfig, UDatePickerRange).leftIcon"
3399
+ }
3420
3400
  },
3421
3401
  {
3422
3402
  "name": "rightIcon",
@@ -3435,8 +3415,7 @@
3435
3415
  "value": {
3436
3416
  "kind": "expression",
3437
3417
  "type": "string"
3438
- },
3439
- "default": "getDefault<Props>(defaultConfig, UDatePickerRange).label"
3418
+ }
3440
3419
  },
3441
3420
  {
3442
3421
  "name": "labelAlign",