vueless 0.0.418 → 0.0.419

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.419",
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",
@@ -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.419",
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"
@@ -4031,6 +4034,10 @@
4031
4034
  {
4032
4035
  "type": "object",
4033
4036
  "name": "file"
4037
+ },
4038
+ {
4039
+ "type": "number",
4040
+ "name": "index"
4034
4041
  }
4035
4042
  ]
4036
4043
  },
@@ -4042,6 +4049,10 @@
4042
4049
  {
4043
4050
  "type": "object",
4044
4051
  "name": "file"
4052
+ },
4053
+ {
4054
+ "type": "number",
4055
+ "name": "index"
4045
4056
  }
4046
4057
  ]
4047
4058
  }