vueless 0.0.418 → 0.0.420

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.418",
3
+ "version": "0.0.420",
4
4
  "license": "MIT",
5
5
  "description": "Vue Styleless UI Component Library, powered by Tailwind CSS.",
6
6
  "keywords": [
@@ -6,13 +6,6 @@ import UIcon from "../../ui.image-icon/UIcon.vue";
6
6
  import UToggleItem from "../../ui.button-toggle-item/UToggleItem.vue";
7
7
  import URow from "../../ui.container-row/URow.vue";
8
8
 
9
- const OPTIONS = [
10
- { value: "11", label: "label 1" },
11
- { value: "12", label: "label 2" },
12
- { value: "13", label: "label 3" },
13
- { value: "14", label: "label 4" },
14
- ];
15
-
16
9
  /**
17
10
  * The `UToggle` component. | [View on GitHub](https://github.com/vuelessjs/vueless/tree/main/src/ui.button-toggle)
18
11
  */
@@ -20,6 +13,14 @@ export default {
20
13
  components: { UIcon, UToggleItem },
21
14
  title: "Buttons & Links / Toggle",
22
15
  component: UToggle,
16
+ args: {
17
+ options: [
18
+ { value: "11", label: "label 1" },
19
+ { value: "12", label: "label 2" },
20
+ { value: "13", label: "label 3" },
21
+ { value: "14", label: "label 4" },
22
+ ],
23
+ },
23
24
  argTypes: {
24
25
  ...getArgTypes(UToggle.__name),
25
26
  modelValue: { control: { type: "text" } },
@@ -29,18 +30,12 @@ export default {
29
30
  const DefaultTemplate = (args) => ({
30
31
  components: { UToggle, UIcon, UToggleItem },
31
32
  setup() {
32
- const value = ref("");
33
-
34
33
  const slots = getSlotNames(UToggle.__name);
35
34
 
36
- return { args, slots, value, OPTIONS };
35
+ return { args, slots };
37
36
  },
38
37
  template: `
39
- <UToggle
40
- v-bind="args"
41
- v-model="value"
42
- :options="OPTIONS"
43
- >
38
+ <UToggle v-bind="args" v-model="args.modelValue">
44
39
  ${args.slotTemplate || getSlotsFragment()}
45
40
  </UToggle>
46
41
  `,
@@ -1,7 +1,5 @@
1
1
  <template>
2
2
  <div v-bind="wrapperAttrs">
3
- <UDivider v-if="upperlined" size="xl" padding="after" v-bind="dividerAttrs" />
4
-
5
3
  <!--
6
4
  @slot Use it to add something instead of the drag icon.
7
5
  @binding {string} empty-title
@@ -38,10 +36,16 @@
38
36
  <div :data-test="`${dataTest}-item-${element[valueKey]}`" v-bind="itemAttrs">
39
37
  <!--
40
38
  @slot Use it to add something instead of the drag icon.
39
+ @binding {object} item
41
40
  @binding {string} icon-name
42
41
  @binding {string} icon-size
43
42
  -->
44
- <slot name="drag" :icon-name="config.defaults.dragIcon" :icon-size="iconSize">
43
+ <slot
44
+ name="drag"
45
+ :item="element"
46
+ :icon-name="config.defaults.dragIcon"
47
+ :icon-size="iconSize"
48
+ >
45
49
  <UIcon
46
50
  internal
47
51
  color="gray"
@@ -76,10 +80,16 @@
76
80
 
77
81
  <!--
78
82
  @slot Use it to add something instead of the delete icon.
83
+ @binding {object} item
79
84
  @binding {string} icon-name
80
85
  @binding {string} icon-size
81
86
  -->
82
- <slot name="delete" :icon-name="config.defaults.deleteIcon" :icon-size="iconSize">
87
+ <slot
88
+ name="delete"
89
+ :item="element"
90
+ :icon-name="config.defaults.deleteIcon"
91
+ :icon-size="iconSize"
92
+ >
83
93
  <UIcon
84
94
  v-if="!element.isHiddenDelete"
85
95
  internal
@@ -96,10 +106,16 @@
96
106
 
97
107
  <!--
98
108
  @slot Use it to add something instead of the edit icon.
109
+ @binding {object} item
99
110
  @binding {string} icon-name
100
111
  @binding {string} icon-size
101
112
  -->
102
- <slot name="edit" :icon-name="config.defaults.editIcon" :icon-size="iconSize">
113
+ <slot
114
+ name="edit"
115
+ :item="element"
116
+ :icon-name="config.defaults.editIcon"
117
+ :icon-size="iconSize"
118
+ >
103
119
  <UIcon
104
120
  v-if="!element.isHiddenEdit"
105
121
  internal
@@ -244,14 +260,6 @@ const props = defineProps({
244
260
  default: getDefault(defaultConfig, UDataListName).nesting,
245
261
  },
246
262
 
247
- /**
248
- * Add line divider above the list.
249
- */
250
- upperlined: {
251
- type: Boolean,
252
- default: getDefault(defaultConfig, UDataListName).upperlined,
253
- },
254
-
255
263
  /**
256
264
  * Disable empty state for nested elements if empty (internal props).
257
265
  * @ignore
@@ -303,7 +311,6 @@ const emit = defineEmits([
303
311
  const {
304
312
  config,
305
313
  wrapperAttrs,
306
- dividerAttrs,
307
314
  emptyAttrs,
308
315
  draggableAttrs,
309
316
  nestedAttrs,
@@ -43,7 +43,6 @@ export default /*tw*/ {
43
43
  valueKey: "id",
44
44
  animationDuration: 200,
45
45
  nesting: false,
46
- upperlined: false,
47
46
  /* icons */
48
47
  dragIcon: "drag_indicator",
49
48
  deleteIcon: "delete",
@@ -28,8 +28,14 @@
28
28
  </template>
29
29
 
30
30
  <template #right-icon>
31
- <!-- @slot Use it add an icon after the date. -->
32
- <slot name="right-icon" />
31
+ <!--
32
+ @slot Use it add an icon after the date.
33
+ @binding {string} icon-name
34
+ @binding {string} icon-size
35
+ -->
36
+ <slot name="right-icon" :icon-name="rightIcon" :icon-size="size">
37
+ <UIcon :name="rightIcon" :size="size" color="gray" />
38
+ </slot>
33
39
  </template>
34
40
 
35
41
  <template #right>
@@ -68,6 +74,7 @@
68
74
  import { computed, nextTick, ref, useId } from "vue";
69
75
  import { merge } from "lodash-es";
70
76
 
77
+ import UIcon from "../ui.image-icon/UIcon.vue";
71
78
  import UInput from "../ui.form-input/UInput.vue";
72
79
  import UCalendar from "../ui.form-calendar/UCalendar.vue";
73
80
  import { VIEW, STANDARD_USER_FORMAT } from "../ui.form-calendar/constants.js";
@@ -223,7 +230,7 @@ const props = defineProps({
223
230
  */
224
231
  rightIcon: {
225
232
  type: String,
226
- default: "",
233
+ default: getDefault(defaultConfig, UDatePicker).calendarIcon,
227
234
  },
228
235
 
229
236
  /**
@@ -123,5 +123,7 @@ export default /*tw*/ {
123
123
  dateTimeFormat: undefined,
124
124
  maxDate: undefined,
125
125
  minDate: undefined,
126
+ /* icons */
127
+ calendarIcon: "calendar_month-fill",
126
128
  },
127
129
  };
@@ -28,8 +28,14 @@
28
28
  </template>
29
29
 
30
30
  <template #right-icon>
31
- <!-- @slot Use it to add icon after the date. -->
32
- <slot name="right-icon" />
31
+ <!--
32
+ @slot Use it add an icon after the date.
33
+ @binding {string} icon-name
34
+ @binding {string} icon-size
35
+ -->
36
+ <slot name="right-icon" :icon-name="rightIcon" :icon-size="size">
37
+ <UIcon :name="rightIcon" :size="size" color="gray" />
38
+ </slot>
33
39
  </template>
34
40
 
35
41
  <template #right>
@@ -147,6 +153,7 @@
147
153
  import { computed, watch, ref, nextTick, provide, useId } from "vue";
148
154
  import { getDefault } from "../utils/utilUI.js";
149
155
 
156
+ import UIcon from "../ui.image-icon/UIcon.vue";
150
157
  import UInput from "../ui.form-input/UInput.vue";
151
158
  import UCalendar from "../ui.form-calendar/UCalendar.vue";
152
159
  import UDatePickerRangePeriodMenu from "./UDatePickerRangePeriodMenu.vue";
@@ -293,7 +300,7 @@ const props = defineProps({
293
300
  */
294
301
  rightIcon: {
295
302
  type: String,
296
- default: "",
303
+ default: getDefault(defaultConfig, UDatePickerRange).calendarIcon,
297
304
  },
298
305
 
299
306
  /**
@@ -202,5 +202,6 @@ export default /*tw*/ {
202
202
  nextIcon: "keyboard_arrow_right",
203
203
  prevIcon: "keyboard_arrow_left",
204
204
  ownRangeIcon: "apps",
205
+ calendarIcon: "calendar_month-fill",
205
206
  },
206
207
  };
@@ -333,8 +333,6 @@ const inputRef = ref(null);
333
333
  const labelComponentRef = ref(null);
334
334
  const leftSlotWrapperRef = ref(null);
335
335
 
336
- defineExpose({ inputRef });
337
-
338
336
  const isTypePassword = computed(() => props.type === "password");
339
337
 
340
338
  const inputValue = computed({
@@ -469,6 +467,14 @@ function setLabelPosition() {
469
467
  labelComponentRef.value.labelElement.style.left = `${leftSlotOrIconWidth + leftPaddingValue}px`;
470
468
  }
471
469
  }
470
+
471
+ defineExpose({
472
+ /**
473
+ * A reference to the input element for direct DOM manipulation.
474
+ * @property {HTMLElement}
475
+ */
476
+ inputRef,
477
+ });
472
478
  </script>
473
479
 
474
480
  <style lang="postcss" scoped>
@@ -10,7 +10,7 @@
10
10
  <!-- @slot Use it to add UFile. -->
11
11
  <slot>
12
12
  <UFile
13
- v-for="file in formattedFileList"
13
+ v-for="(file, index) in formattedFileList"
14
14
  :id="file.id"
15
15
  :key="file.id"
16
16
  :label="file.label"
@@ -23,15 +23,17 @@
23
23
  <template #left="{ file: currentFile }">
24
24
  <!-- @slot Use it to add something left.
25
25
  @binding {object} file
26
+ @binding {number} index
26
27
  -->
27
- <slot name="left" :file="currentFile" />
28
+ <slot name="left" :file="currentFile" :index="index" />
28
29
  </template>
29
30
 
30
31
  <template #right="{ file: currentFile }">
31
32
  <!-- @slot Use it to add something right.
32
33
  @binding {object} file
34
+ @binding {number} index
33
35
  -->
34
- <slot name="right" :file="currentFile" />
36
+ <slot name="right" :file="currentFile" :index="index" />
35
37
  </template>
36
38
  </UFile>
37
39
  </slot>
@@ -119,6 +119,33 @@ export function getArgTypes(componentName) {
119
119
  }
120
120
  });
121
121
 
122
+ component.exposes?.forEach((expose) => {
123
+ const properties = [];
124
+
125
+ expose.properties?.forEach((property) => {
126
+ const description = property.description ? ` (${property.description})` : "";
127
+
128
+ properties.push(`${property.type}${description}`);
129
+ });
130
+
131
+ types[`${expose.name}Expose`] = {
132
+ type: expose.properties ? properties.join(", ") : null,
133
+ name: expose.name,
134
+ description: expose.description,
135
+ control: false,
136
+ table: { category: "expose" },
137
+ };
138
+
139
+ // Hide autogenerated expose docs, but keep props with the same name
140
+ if (!component.attributes?.map((item) => item.name)?.includes(expose.name)) {
141
+ types[expose.name] = {
142
+ table: {
143
+ disable: true,
144
+ },
145
+ };
146
+ }
147
+ });
148
+
122
149
  component.events?.forEach((event) => {
123
150
  const properties = [];
124
151
 
package/web-types.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "framework": "vue",
3
3
  "name": "vueless",
4
- "version": "0.0.418",
4
+ "version": "0.0.420",
5
5
  "contributions": {
6
6
  "html": {
7
7
  "description-markup": "markdown",
@@ -2135,15 +2135,6 @@
2135
2135
  },
2136
2136
  "default": "false"
2137
2137
  },
2138
- {
2139
- "name": "upperlined",
2140
- "description": "Add line divider above the list.",
2141
- "value": {
2142
- "kind": "expression",
2143
- "type": "boolean"
2144
- },
2145
- "default": "false"
2146
- },
2147
2138
  {
2148
2139
  "name": "hideEmptyStateForNesting",
2149
2140
  "description": "@ignore: Disable empty state for nested elements if empty (internal props).",
@@ -2243,6 +2234,10 @@
2243
2234
  "scoped": true,
2244
2235
  "description": "Use it to add something instead of the drag icon.",
2245
2236
  "bindings": [
2237
+ {
2238
+ "type": "object",
2239
+ "name": "item"
2240
+ },
2246
2241
  {
2247
2242
  "type": "string",
2248
2243
  "name": "icon-name"
@@ -2284,6 +2279,10 @@
2284
2279
  "scoped": true,
2285
2280
  "description": "Use it to add something instead of the delete icon.",
2286
2281
  "bindings": [
2282
+ {
2283
+ "type": "object",
2284
+ "name": "item"
2285
+ },
2287
2286
  {
2288
2287
  "type": "string",
2289
2288
  "name": "icon-name"
@@ -2299,6 +2298,10 @@
2299
2298
  "scoped": true,
2300
2299
  "description": "Use it to add something instead of the edit icon.",
2301
2300
  "bindings": [
2301
+ {
2302
+ "type": "object",
2303
+ "name": "item"
2304
+ },
2302
2305
  {
2303
2306
  "type": "string",
2304
2307
  "name": "icon-name"
@@ -2466,7 +2469,7 @@
2466
2469
  "kind": "expression",
2467
2470
  "type": "string"
2468
2471
  },
2469
- "default": "\"\""
2472
+ "default": "getDefault(defaultConfig, UDatePicker).calendarIcon"
2470
2473
  },
2471
2474
  {
2472
2475
  "name": "disabled",
@@ -2551,7 +2554,18 @@
2551
2554
  },
2552
2555
  {
2553
2556
  "name": "right-icon",
2554
- "description": "Use it add an icon after the date."
2557
+ "scoped": true,
2558
+ "description": "Use it add an icon after the date.",
2559
+ "bindings": [
2560
+ {
2561
+ "type": "string",
2562
+ "name": "icon-name"
2563
+ },
2564
+ {
2565
+ "type": "string",
2566
+ "name": "icon-size"
2567
+ }
2568
+ ]
2555
2569
  },
2556
2570
  {
2557
2571
  "name": "right",
@@ -2661,7 +2675,7 @@
2661
2675
  "kind": "expression",
2662
2676
  "type": "string"
2663
2677
  },
2664
- "default": "\"\""
2678
+ "default": "getDefault(defaultConfig, UDatePickerRange).calendarIcon"
2665
2679
  },
2666
2680
  {
2667
2681
  "name": "label",
@@ -2761,7 +2775,18 @@
2761
2775
  },
2762
2776
  {
2763
2777
  "name": "right-icon",
2764
- "description": "Use it to add icon after the date."
2778
+ "scoped": true,
2779
+ "description": "Use it add an icon after the date.",
2780
+ "bindings": [
2781
+ {
2782
+ "type": "string",
2783
+ "name": "icon-name"
2784
+ },
2785
+ {
2786
+ "type": "string",
2787
+ "name": "icon-size"
2788
+ }
2789
+ ]
2765
2790
  },
2766
2791
  {
2767
2792
  "name": "right",
@@ -4031,6 +4056,10 @@
4031
4056
  {
4032
4057
  "type": "object",
4033
4058
  "name": "file"
4059
+ },
4060
+ {
4061
+ "type": "number",
4062
+ "name": "index"
4034
4063
  }
4035
4064
  ]
4036
4065
  },
@@ -4042,6 +4071,10 @@
4042
4071
  {
4043
4072
  "type": "object",
4044
4073
  "name": "file"
4074
+ },
4075
+ {
4076
+ "type": "number",
4077
+ "name": "index"
4045
4078
  }
4046
4079
  ]
4047
4080
  }