vueless 0.0.100 → 0.0.102

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.100",
3
+ "version": "0.0.102",
4
4
  "license": "MIT",
5
5
  "description": "Vue Styleless Component Framework.",
6
6
  "homepage": "https://vueless.com",
@@ -45,9 +45,9 @@ export function useAttrs(props) {
45
45
  classes: placeholderClasses,
46
46
  isComponent: true,
47
47
  });
48
- const iconPlaceholderAttrs = getAttrs("iconPlaceholder", { isComponent: true });
49
- const iconCloseAttrs = getAttrs("iconClose", { isComponent: true });
50
- const iconUploadFileAttrs = getAttrs("iconUploadFile", { isComponent: true });
48
+ const placeholderIconAttrs = getAttrs("placeholderIcon", { isComponent: true });
49
+ const clearIconAttrs = getAttrs("clearIcon", { isComponent: true });
50
+ const chooseFileIconNameAttrs = getAttrs("chooseFileIconName", { isComponent: true });
51
51
  const inputAttrs = getAttrs("input");
52
52
 
53
53
  return {
@@ -59,9 +59,9 @@ export function useAttrs(props) {
59
59
  descriptionAttrs,
60
60
  buttonWrapperAttrs,
61
61
  placeholderWrapperAttrs,
62
- iconPlaceholderAttrs,
63
- iconCloseAttrs,
64
- iconUploadFileAttrs,
62
+ placeholderIconAttrs,
63
+ clearIconAttrs,
64
+ chooseFileIconNameAttrs,
65
65
  placeholderAttrs,
66
66
  };
67
67
  }
@@ -38,13 +38,13 @@ export default /*tw*/ {
38
38
  },
39
39
  },
40
40
  },
41
- iconPlaceholderName: "attach_file",
42
- iconPlaceholder: "-rotate-45",
43
41
  button: "hover:cursor-pointer",
44
- iconUploadFileName: "upload_file",
45
- iconCloseName: "close",
46
- iconClose: "",
47
- iconUploadFile: "",
42
+ placeholderIcon: "-rotate-45",
43
+ placeholderIconName: "attach_file",
44
+ chooseFileIcon: "",
45
+ chooseFileIconName: "upload_file",
46
+ clearIcon: "",
47
+ clearIconName: "close",
48
48
  dropzoneWrapperHover: "border-gray-400 bg-gray-50",
49
49
  dropzoneWrapperError: "hover:border-red-400 border-red-300",
50
50
  input: "sr-only pointer-events-none size-0 opacity-0",
@@ -57,7 +57,7 @@ export default /*tw*/ {
57
57
  defaultVariants: {
58
58
  size: "md",
59
59
  labelAlign: "topInside",
60
- allowedFileTypes: [".png", ".jpg", ".jpeg", ".pdf", ".txt", ".doc", ".docx", "xls", ".xlsx"],
60
+ allowedFileTypes: [],
61
61
  maxFileSize: 100,
62
62
  },
63
63
  };
@@ -9,8 +9,8 @@
9
9
  pill
10
10
  internal
11
11
  :size="nestedComponentSize"
12
- :name="config.iconPlaceholderName"
13
- v-bind="iconPlaceholderAttrs"
12
+ :name="config.placeholderIconName"
13
+ v-bind="placeholderIconAttrs"
14
14
  />
15
15
  <span v-bind="placeholderAttrs" v-text="placeholder" />
16
16
  </div>
@@ -30,8 +30,8 @@
30
30
  <UIcon
31
31
  internal
32
32
  :size="nestedComponentSize"
33
- :name="config.iconUploadFileName"
34
- v-bind="iconUploadFileAttrs"
33
+ :name="config.chooseFileIconName"
34
+ v-bind="chooseFileIconAttrs"
35
35
  />
36
36
  </template>
37
37
  </UButton>
@@ -50,9 +50,9 @@
50
50
  interactive
51
51
  internal
52
52
  :size="nestedComponentSize"
53
- :name="config.iconCloseName"
53
+ :name="config.clearIconName"
54
54
  pill
55
- v-bind="iconCloseAttrs"
55
+ v-bind="clearIconAttrs"
56
56
  @click="onClickResetFiles"
57
57
  />
58
58
  </div>
@@ -64,6 +64,11 @@
64
64
  import { computed, nextTick, onBeforeUnmount, onMounted, ref } from "vue";
65
65
  import { merge } from "lodash-es";
66
66
 
67
+ import UText from "../ui.text-block";
68
+ import UIcon from "../ui.image-icon";
69
+ import ULabel from "../ui.form-label";
70
+ import UButton from "../ui.button";
71
+
67
72
  import UIService, { getRandomId } from "../service.ui";
68
73
  import { getFileMbSize } from "./services/fileForm.service";
69
74
 
@@ -172,9 +177,9 @@ const {
172
177
  descriptionAttrs,
173
178
  buttonWrapperAttrs,
174
179
  placeholderWrapperAttrs,
175
- iconPlaceholderAttrs,
176
- iconCloseAttrs,
177
- iconUploadFileAttrs,
180
+ placeholderIconAttrs,
181
+ clearIconAttrs,
182
+ chooseFileIconAttrs,
178
183
  placeholderAttrs,
179
184
  inputAttrs,
180
185
  } = useAttrs(props);
@@ -226,7 +231,10 @@ onBeforeUnmount(() => {
226
231
  function validate(file) {
227
232
  const targetFileSize = getFileMbSize(file);
228
233
 
229
- const isValidType = extensionNames.value.some((item) => file.type.includes(item));
234
+ const isValidType = extensionNames.value.length
235
+ ? extensionNames.value.some((item) => file.type.includes(item))
236
+ : true;
237
+
230
238
  const isValidSize = targetFileSize <= props.maxFileSize;
231
239
 
232
240
  if (!isValidSize) {
package/web-types.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "framework": "vue",
3
3
  "name": "vueless",
4
- "version": "0.0.100",
4
+ "version": "0.0.102",
5
5
  "contributions": {
6
6
  "html": {
7
7
  "description-markup": "markdown",
@@ -3492,7 +3492,7 @@
3492
3492
  "kind": "expression",
3493
3493
  "type": "array"
3494
3494
  },
3495
- "default": ".png,.jpg,.jpeg,.pdf,.txt,.doc,.docx,xls,.xlsx"
3495
+ "default": ""
3496
3496
  },
3497
3497
  {
3498
3498
  "name": "size",