vueless 0.0.592 → 0.0.594

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.
Files changed (72) hide show
  1. package/composables/useUI.ts +17 -15
  2. package/package.json +1 -1
  3. package/types.ts +2 -0
  4. package/ui.button/storybook/stories.ts +3 -1
  5. package/ui.button-link/storybook/stories.ts +3 -1
  6. package/ui.button-toggle/storybook/stories.ts +3 -1
  7. package/ui.button-toggle-item/storybook/stories.ts +3 -1
  8. package/ui.container-accordion/storybook/stories.ts +3 -1
  9. package/ui.container-card/storybook/stories.ts +3 -1
  10. package/ui.container-col/storybook/stories.ts +1 -1
  11. package/ui.container-divider/storybook/stories.ts +3 -1
  12. package/ui.container-group/storybook/stories.ts +1 -1
  13. package/ui.container-groups/storybook/stories.ts +1 -1
  14. package/ui.container-modal/storybook/stories.ts +1 -1
  15. package/ui.container-modal-confirm/storybook/stories.ts +1 -1
  16. package/ui.container-page/storybook/stories.ts +3 -1
  17. package/ui.container-row/storybook/stories.ts +3 -1
  18. package/ui.data-list/storybook/stories.ts +3 -1
  19. package/ui.data-table/storybook/stories.ts +3 -1
  20. package/ui.dropdown-badge/storybook/stories.ts +1 -1
  21. package/ui.dropdown-button/storybook/stories.ts +1 -1
  22. package/ui.dropdown-link/storybook/stories.ts +1 -1
  23. package/ui.dropdown-list/storybook/stories.ts +1 -1
  24. package/ui.dropdown-list/types.ts +1 -1
  25. package/ui.form-calendar/storybook/stories.ts +1 -1
  26. package/ui.form-checkbox/storybook/stories.ts +3 -1
  27. package/ui.form-checkbox-group/storybook/stories.ts +3 -1
  28. package/ui.form-checkbox-multi-state/storybook/stories.ts +3 -1
  29. package/ui.form-color-picker/storybook/stories.ts +3 -1
  30. package/ui.form-date-picker/UDatePicker.vue +1 -1
  31. package/ui.form-date-picker/storybook/stories.ts +1 -1
  32. package/ui.form-date-picker-range/storybook/stories.ts +3 -1
  33. package/ui.form-input/storybook/stories.ts +3 -1
  34. package/ui.form-input-file/storybook/stories.ts +3 -1
  35. package/ui.form-input-money/storybook/stories.ts +3 -1
  36. package/ui.form-input-number/storybook/stories.ts +3 -1
  37. package/ui.form-input-rating/storybook/stories.ts +3 -1
  38. package/ui.form-input-search/storybook/stories.ts +3 -1
  39. package/ui.form-label/ULabel.vue +1 -1
  40. package/ui.form-label/storybook/stories.ts +3 -1
  41. package/ui.form-radio/storybook/stories.ts +3 -1
  42. package/ui.form-radio-group/storybook/stories.ts +3 -1
  43. package/ui.form-select/USelect.vue +535 -682
  44. package/ui.form-select/{config.js → config.ts} +2 -1
  45. package/ui.form-select/{constants.js → constants.ts} +0 -5
  46. package/ui.form-select/storybook/Docs.mdx +2 -2
  47. package/ui.form-select/storybook/{stories.js → stories.ts} +23 -13
  48. package/ui.form-select/types.ts +134 -0
  49. package/ui.form-select/utilSelect.ts +122 -0
  50. package/ui.form-switch/storybook/stories.ts +3 -1
  51. package/ui.form-textarea/storybook/stories.ts +3 -1
  52. package/ui.image-avatar/storybook/stories.ts +3 -1
  53. package/ui.image-icon/storybook/stories.ts +3 -1
  54. package/ui.loader/storybook/stories.ts +3 -1
  55. package/ui.loader-overlay/storybook/stories.ts +1 -1
  56. package/ui.loader-progress/storybook/stories.ts +3 -1
  57. package/ui.navigation-progress/storybook/stories.ts +3 -1
  58. package/ui.navigation-tab/storybook/stories.ts +3 -1
  59. package/ui.navigation-tabs/storybook/stories.ts +3 -1
  60. package/ui.other-dot/storybook/stories.ts +3 -1
  61. package/ui.text-alert/storybook/stories.ts +3 -1
  62. package/ui.text-badge/storybook/stories.ts +3 -1
  63. package/ui.text-block/storybook/stories.ts +3 -1
  64. package/ui.text-empty/storybook/stories.ts +3 -1
  65. package/ui.text-file/storybook/stories.ts +3 -1
  66. package/ui.text-files/storybook/stories.ts +3 -1
  67. package/ui.text-header/storybook/stories.ts +3 -1
  68. package/ui.text-money/storybook/stories.ts +3 -1
  69. package/ui.text-notify/storybook/stories.ts +1 -1
  70. package/utils/storybook.ts +3 -5
  71. package/web-types.json +77 -35
  72. package/ui.form-select/utilSelect.js +0 -100
@@ -112,23 +112,25 @@ export default function useUI<T>(
112
112
  const extendsKeys = getExtendsKeys(baseClasses);
113
113
 
114
114
  if (extendsKeys.length) {
115
- const extendsClasses = extendsKeys.map((key) => toValue(getClasses(key, mutatedProps)));
116
-
117
115
  const keyAttrs = keysAttrs[`${key}Attrs`];
118
116
 
119
- keysAttrs[`${key}Attrs`] = computed(() => ({
120
- ...keyAttrs.value,
121
- class: cx([
122
- ...extendsClasses,
123
- keyAttrs.value.class?.replaceAll(EXTENDS_PATTERN_REG_EXP, ""),
124
- ]),
125
- // TODO: Cannot merge several keys
126
- config: getMergedConfig({
127
- defaultConfig: config.value[extendsKeys[0]],
128
- globalConfig: keyAttrs.value.config,
129
- propsConfig: propsConfig[extendsKeys[0]],
130
- }),
131
- })) as ComputedRef<KeyAttrsWithConfig<T>>;
117
+ keysAttrs[`${key}Attrs`] = computed(() => {
118
+ const extendsClasses = extendsKeys.map((key) => toValue(getClasses(key, mutatedProps)));
119
+
120
+ return {
121
+ ...keyAttrs.value,
122
+ class: cx([
123
+ ...extendsClasses,
124
+ keyAttrs.value.class?.replaceAll(EXTENDS_PATTERN_REG_EXP, ""),
125
+ ]),
126
+ // TODO: Add ability to merge array of keys
127
+ config: getMergedConfig({
128
+ defaultConfig: config.value[extendsKeys[0]],
129
+ globalConfig: keyAttrs.value.config,
130
+ propsConfig: propsConfig[extendsKeys[0]],
131
+ }),
132
+ };
133
+ }) as ComputedRef<KeyAttrsWithConfig<T>>;
132
134
  }
133
135
  }
134
136
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vueless",
3
- "version": "0.0.592",
3
+ "version": "0.0.594",
4
4
  "license": "MIT",
5
5
  "description": "Vue Styleless UI Component Library, powered by Tailwind CSS.",
6
6
  "keywords": [
package/types.ts CHANGED
@@ -54,6 +54,7 @@ import UInputSearchConfig from "./ui.form-input-search/config.ts";
54
54
  import UInputFileConfig from "./ui.form-input-file/config.ts";
55
55
  import UInputMoneyConfig from "./ui.form-input-money/config.ts";
56
56
  import UDataListConfig from "./ui.data-list/config.ts";
57
+ import USelectConfig from "./ui.form-select/config.ts";
57
58
 
58
59
  import type { ComputedRef, Ref, ComponentInternalInstance } from "vue";
59
60
  import type { Props } from "tippy.js";
@@ -224,6 +225,7 @@ export interface Components {
224
225
  UInputFile: Partial<typeof UInputFileConfig>;
225
226
  UInputMoney: Partial<typeof UInputMoneyConfig>;
226
227
  UDataList: Partial<typeof UDataListConfig>;
228
+ USelect: Partial<typeof USelectConfig>;
227
229
  }
228
230
 
229
231
  /* Make all config keys optional and allow to have string and object values. */
@@ -37,7 +37,9 @@ export default {
37
37
  ...getArgTypes(UButton.__name),
38
38
  },
39
39
  parameters: {
40
- ...getDocsDescription(UButton.__name),
40
+ docs: {
41
+ ...getDocsDescription(UButton.__name),
42
+ },
41
43
  },
42
44
  } as Meta;
43
45
 
@@ -29,7 +29,9 @@ export default {
29
29
  ...getArgTypes(ULink.__name),
30
30
  },
31
31
  parameters: {
32
- ...getDocsDescription(ULink.__name),
32
+ docs: {
33
+ ...getDocsDescription(ULink.__name),
34
+ },
33
35
  },
34
36
  } as Meta;
35
37
 
@@ -36,7 +36,9 @@ export default {
36
36
  modelValue: { control: { type: "text" } },
37
37
  },
38
38
  parameters: {
39
- ...getDocsDescription(UToggle.__name),
39
+ docs: {
40
+ ...getDocsDescription(UToggle.__name),
41
+ },
40
42
  },
41
43
  } as Meta;
42
44
 
@@ -28,7 +28,9 @@ export default {
28
28
  value: { control: { type: "text" } },
29
29
  },
30
30
  parameters: {
31
- ...getDocsDescription(UToggleItem.__name),
31
+ docs: {
32
+ ...getDocsDescription(UToggleItem.__name),
33
+ },
32
34
  },
33
35
  } as Meta;
34
36
 
@@ -45,7 +45,9 @@ export default {
45
45
  ...getArgTypes(UAccordion.__name),
46
46
  },
47
47
  parameters: {
48
- ...getDocsDescription(UAccordion.__name),
48
+ docs: {
49
+ ...getDocsDescription(UAccordion.__name),
50
+ },
49
51
  },
50
52
  } as Meta;
51
53
 
@@ -29,7 +29,9 @@ export default {
29
29
  ...getArgTypes(UCard.__name),
30
30
  },
31
31
  parameters: {
32
- ...getDocsDescription(UCard.__name),
32
+ docs: {
33
+ ...getDocsDescription(UCard.__name),
34
+ },
33
35
  },
34
36
  } as Meta;
35
37
 
@@ -26,11 +26,11 @@ export default {
26
26
  },
27
27
  parameters: {
28
28
  docs: {
29
+ ...getDocsDescription(UCol.__name),
29
30
  story: {
30
31
  iframeHeight: 360,
31
32
  },
32
33
  },
33
- ...getDocsDescription(UCol.__name),
34
34
  },
35
35
  } as Meta;
36
36
 
@@ -24,7 +24,9 @@ export default {
24
24
  ...getArgTypes(UDivider.__name),
25
25
  },
26
26
  parameters: {
27
- ...getDocsDescription(UDivider.__name),
27
+ docs: {
28
+ ...getDocsDescription(UDivider.__name),
29
+ },
28
30
  },
29
31
  } as Meta;
30
32
 
@@ -29,11 +29,11 @@ export default {
29
29
  },
30
30
  parameters: {
31
31
  docs: {
32
+ ...getDocsDescription(UGroup.__name),
32
33
  story: {
33
34
  iframeHeight: 360,
34
35
  },
35
36
  },
36
- ...getDocsDescription(UGroup.__name),
37
37
  },
38
38
  } as Meta;
39
39
 
@@ -22,11 +22,11 @@ export default {
22
22
  },
23
23
  parameters: {
24
24
  docs: {
25
+ ...getDocsDescription(UGroups.__name),
25
26
  story: {
26
27
  iframeHeight: 360,
27
28
  },
28
29
  },
29
- ...getDocsDescription(UGroups.__name),
30
30
  },
31
31
  } as Meta;
32
32
 
@@ -34,11 +34,11 @@ export default {
34
34
  },
35
35
  parameters: {
36
36
  docs: {
37
+ ...getDocsDescription(UModal.__name),
37
38
  story: {
38
39
  height: "500px",
39
40
  },
40
41
  },
41
- ...getDocsDescription(UModal.__name),
42
42
  },
43
43
  } as Meta;
44
44
 
@@ -35,11 +35,11 @@ export default {
35
35
  },
36
36
  parameters: {
37
37
  docs: {
38
+ ...getDocsDescription(UModalConfirm.__name),
38
39
  story: {
39
40
  height: "360px",
40
41
  },
41
42
  },
42
- ...getDocsDescription(UModalConfirm.__name),
43
43
  },
44
44
  } as Meta;
45
45
 
@@ -33,7 +33,9 @@ export default {
33
33
  ...getArgTypes(UPage.__name),
34
34
  },
35
35
  parameters: {
36
- ...getDocsDescription(UPage.__name),
36
+ docs: {
37
+ ...getDocsDescription(UPage.__name),
38
+ },
37
39
  },
38
40
  } as Meta;
39
41
 
@@ -26,7 +26,9 @@ export default {
26
26
  ...getArgTypes(URow.__name),
27
27
  },
28
28
  parameters: {
29
- ...getDocsDescription(URow.__name),
29
+ docs: {
30
+ ...getDocsDescription(URow.__name),
31
+ },
30
32
  },
31
33
  } as Meta;
32
34
 
@@ -50,7 +50,9 @@ export default {
50
50
  ...getArgTypes(UDataList.__name),
51
51
  },
52
52
  parameters: {
53
- ...getDocsDescription(UDataList.__name),
53
+ docs: {
54
+ ...getDocsDescription(UDataList.__name),
55
+ },
54
56
  },
55
57
  } as Meta;
56
58
 
@@ -58,7 +58,9 @@ export default {
58
58
  numberOfRows: 5,
59
59
  },
60
60
  parameters: {
61
- ...getDocsDescription(UTable.__name),
61
+ docs: {
62
+ ...getDocsDescription(UTable.__name),
63
+ },
62
64
  },
63
65
  } as Meta;
64
66
 
@@ -33,11 +33,11 @@ export default {
33
33
  },
34
34
  parameters: {
35
35
  docs: {
36
+ ...getDocsDescription(UDropdownBadge.__name),
36
37
  story: {
37
38
  height: "200px",
38
39
  },
39
40
  },
40
- ...getDocsDescription(UDropdownBadge.__name),
41
41
  },
42
42
  } as Meta;
43
43
 
@@ -34,11 +34,11 @@ export default {
34
34
  },
35
35
  parameters: {
36
36
  docs: {
37
+ ...getDocsDescription(UDropdownButton.__name),
37
38
  story: {
38
39
  height: "200px",
39
40
  },
40
41
  },
41
- ...getDocsDescription(UDropdownButton.__name),
42
42
  },
43
43
  } as Meta;
44
44
 
@@ -37,11 +37,11 @@ export default {
37
37
  },
38
38
  parameters: {
39
39
  docs: {
40
+ ...getDocsDescription(UDropdownLink.__name),
40
41
  story: {
41
42
  height: "200px",
42
43
  },
43
44
  },
44
- ...getDocsDescription(UDropdownLink.__name),
45
45
  },
46
46
  } as Meta;
47
47
 
@@ -35,11 +35,11 @@ export default {
35
35
  },
36
36
  parameters: {
37
37
  docs: {
38
+ ...getDocsDescription(UDropdownList.__name),
38
39
  story: {
39
40
  height: "180px",
40
41
  },
41
42
  },
42
- ...getDocsDescription(UDropdownList.__name),
43
43
  },
44
44
  } as Meta;
45
45
 
@@ -13,7 +13,7 @@ export interface BaseOption {
13
13
  }
14
14
 
15
15
  export interface Option extends BaseOption {
16
- [key: string]: string | number | boolean | UnknownObject | OnClickOption | undefined;
16
+ [key: string]: string | number | boolean | UnknownObject | Option[] | OnClickOption | undefined;
17
17
  }
18
18
 
19
19
  export interface Props {
@@ -27,11 +27,11 @@ export default {
27
27
  },
28
28
  parameters: {
29
29
  docs: {
30
+ ...getDocsDescription(UCalendarName),
30
31
  story: {
31
32
  height: "380px",
32
33
  },
33
34
  },
34
- ...getDocsDescription(UCalendarName),
35
35
  },
36
36
  } as Meta;
37
37
 
@@ -30,7 +30,9 @@ export default {
30
30
  modelValue: { control: { type: "boolean" } },
31
31
  },
32
32
  parameters: {
33
- ...getDocsDescription(UCheckbox.__name),
33
+ docs: {
34
+ ...getDocsDescription(UCheckbox.__name),
35
+ },
34
36
  },
35
37
  } as Meta;
36
38
 
@@ -38,7 +38,9 @@ export default {
38
38
  ...getArgTypes(UCheckboxGroup.__name),
39
39
  },
40
40
  parameters: {
41
- ...getDocsDescription(UCheckboxGroup.__name),
41
+ docs: {
42
+ ...getDocsDescription(UCheckboxGroup.__name),
43
+ },
42
44
  },
43
45
  } as Meta;
44
46
 
@@ -31,7 +31,9 @@ export default {
31
31
  ...getArgTypes(UCheckboxMultiState.__name),
32
32
  },
33
33
  parameters: {
34
- ...getDocsDescription(UCheckboxMultiState.__name),
34
+ docs: {
35
+ ...getDocsDescription(UCheckboxMultiState.__name),
36
+ },
35
37
  },
36
38
  } as Meta;
37
39
 
@@ -28,7 +28,9 @@ export default {
28
28
  ...getArgTypes(UColorPicker.__name),
29
29
  },
30
30
  parameters: {
31
- ...getDocsDescription(UColorPicker.__name),
31
+ docs: {
32
+ ...getDocsDescription(UColorPicker.__name),
33
+ },
32
34
  },
33
35
  } as Meta;
34
36
 
@@ -277,7 +277,7 @@ watchEffect(() => {
277
277
  <div v-bind="wrapperAttrs" ref="wrapper">
278
278
  <UInput
279
279
  :id="elementId"
280
- :key="String(userDateFormat)"
280
+ :key="String(userFormatDate)"
281
281
  ref="input"
282
282
  :model-value="userFormatDate"
283
283
  :label-align="labelAlign"
@@ -36,11 +36,11 @@ export default {
36
36
  },
37
37
  parameters: {
38
38
  docs: {
39
+ ...getDocsDescription(UDatePickerName),
39
40
  story: {
40
41
  height: "480px",
41
42
  },
42
43
  },
43
- ...getDocsDescription(UDatePickerName),
44
44
  },
45
45
  } as Meta;
46
46
 
@@ -46,7 +46,9 @@ export default {
46
46
  },
47
47
  },
48
48
  parameters: {
49
- ...getDocsDescription(UDatePickerRangeName),
49
+ docs: {
50
+ ...getDocsDescription(UDatePickerRangeName),
51
+ },
50
52
  },
51
53
  },
52
54
  } as Meta;
@@ -30,7 +30,9 @@ export default {
30
30
  modelValue: { control: { type: "text" } },
31
31
  },
32
32
  parameters: {
33
- ...getDocsDescription(UInput.__name),
33
+ docs: {
34
+ ...getDocsDescription(UInput.__name),
35
+ },
34
36
  },
35
37
  } as Meta;
36
38
 
@@ -27,7 +27,9 @@ export default {
27
27
  ...getArgTypes(UInputFile.__name),
28
28
  },
29
29
  parameters: {
30
- ...getDocsDescription(UInputFile.__name),
30
+ docs: {
31
+ ...getDocsDescription(UInputFile.__name),
32
+ },
31
33
  },
32
34
  } as Meta;
33
35
 
@@ -30,7 +30,9 @@ export default {
30
30
  modelValue: { control: { type: "number" } },
31
31
  },
32
32
  parameters: {
33
- ...getDocsDescription(UInputMoney.__name),
33
+ docs: {
34
+ ...getDocsDescription(UInputMoney.__name),
35
+ },
34
36
  },
35
37
  } as Meta;
36
38
 
@@ -28,7 +28,9 @@ export default {
28
28
  modelValue: { control: { type: "number" } },
29
29
  },
30
30
  parameters: {
31
- ...getDocsDescription(UInputNumber.__name),
31
+ docs: {
32
+ ...getDocsDescription(UInputNumber.__name),
33
+ },
32
34
  },
33
35
  } as Meta;
34
36
 
@@ -28,7 +28,9 @@ export default {
28
28
  ...getArgTypes(UInputRating.__name),
29
29
  },
30
30
  parameters: {
31
- ...getDocsDescription(UInputRating.__name),
31
+ docs: {
32
+ ...getDocsDescription(UInputRating.__name),
33
+ },
32
34
  },
33
35
  } as Meta;
34
36
 
@@ -26,7 +26,9 @@ export default {
26
26
  ...getArgTypes(UInputSearch.__name),
27
27
  },
28
28
  parameters: {
29
- ...getDocsDescription(UInputSearch.__name),
29
+ docs: {
30
+ ...getDocsDescription(UInputSearch.__name),
31
+ },
30
32
  },
31
33
  } as Meta;
32
34
 
@@ -23,7 +23,7 @@ const emit = defineEmits([
23
23
  "click",
24
24
  ]);
25
25
 
26
- const labelRef = ref(null);
26
+ const labelRef = ref<HTMLLabelElement | null>(null);
27
27
  const wrapperRef = ref(null);
28
28
 
29
29
  const isHorizontalPlacement = computed(() => {
@@ -30,7 +30,9 @@ export default {
30
30
  ...getArgTypes(ULabel.__name),
31
31
  },
32
32
  parameters: {
33
- ...getDocsDescription(ULabel.__name),
33
+ docs: {
34
+ ...getDocsDescription(ULabel.__name),
35
+ },
34
36
  },
35
37
  } as Meta;
36
38
 
@@ -30,7 +30,9 @@ export default {
30
30
  ...getArgTypes(URadio.__name),
31
31
  },
32
32
  parameters: {
33
- ...getDocsDescription(URadio.__name),
33
+ docs: {
34
+ ...getDocsDescription(URadio.__name),
35
+ },
34
36
  },
35
37
  } as Meta;
36
38
 
@@ -37,7 +37,9 @@ export default {
37
37
  ...getArgTypes(URadioGroup.__name),
38
38
  },
39
39
  parameters: {
40
- ...getDocsDescription(URadioGroup.__name),
40
+ docs: {
41
+ ...getDocsDescription(URadioGroup.__name),
42
+ },
41
43
  },
42
44
  } as Meta;
43
45