vueless 0.0.674 → 0.0.676
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/bin/commands/create.js +77 -0
- package/bin/commands/index.js +2 -0
- package/bin/commands/init.js +4 -8
- package/bin/constants.js +2 -5
- package/bin/index.js +1 -1
- package/bin/utils/dataUtils.js +53 -0
- package/bin/utils/formatUtil.js +48 -0
- package/composables/useUI.ts +12 -1
- package/constants.js +6 -0
- package/package.json +2 -2
- package/plugin-vite.js +3 -1
- package/types.ts +1 -1
- package/ui.boilerplate/storybook/stories.ts +1 -1
- package/ui.boilerplate/types.ts +1 -1
- package/ui.button/UButton.vue +9 -6
- package/ui.button/types.ts +1 -1
- package/ui.button-link/ULink.vue +37 -62
- package/ui.button-link/config.ts +8 -35
- package/ui.button-link/storybook/stories.ts +0 -22
- package/ui.button-link/types.ts +1 -11
- package/ui.button-toggle/types.ts +1 -1
- package/ui.button-toggle-item/types.ts +1 -1
- package/ui.container-accordion/types.ts +1 -1
- package/ui.container-card/types.ts +1 -1
- package/ui.container-col/types.ts +1 -1
- package/ui.container-divider/types.ts +1 -1
- package/ui.container-group/types.ts +1 -1
- package/ui.container-groups/types.ts +1 -1
- package/ui.container-modal/UModal.vue +21 -20
- package/ui.container-modal/config.ts +3 -2
- package/ui.container-modal/types.ts +1 -1
- package/ui.container-modal-confirm/types.ts +1 -1
- package/ui.container-page/UPage.vue +31 -19
- package/ui.container-page/config.ts +1 -0
- package/ui.container-page/types.ts +1 -1
- package/ui.container-row/types.ts +1 -1
- package/ui.data-list/types.ts +1 -1
- package/ui.data-table/types.ts +1 -1
- package/ui.dropdown-badge/types.ts +1 -1
- package/ui.dropdown-button/types.ts +1 -1
- package/ui.dropdown-link/UDropdownLink.vue +29 -33
- package/ui.dropdown-link/config.ts +3 -3
- package/ui.dropdown-link/types.ts +1 -1
- package/ui.dropdown-list/types.ts +1 -1
- package/ui.form-calendar/types.ts +1 -1
- package/ui.form-checkbox/types.ts +1 -1
- package/ui.form-checkbox-group/types.ts +1 -1
- package/ui.form-checkbox-multi-state/types.ts +1 -1
- package/ui.form-date-picker/types.ts +1 -1
- package/ui.form-date-picker-range/types.ts +1 -1
- package/ui.form-input/types.ts +1 -1
- package/ui.form-input-file/types.ts +1 -1
- package/ui.form-input-money/types.ts +1 -1
- package/ui.form-input-number/types.ts +1 -1
- package/ui.form-input-rating/types.ts +1 -1
- package/ui.form-input-search/types.ts +1 -1
- package/ui.form-label/types.ts +1 -1
- package/ui.form-radio/types.ts +1 -1
- package/ui.form-radio-group/types.ts +1 -1
- package/ui.form-select/USelect.vue +8 -6
- package/ui.form-select/types.ts +1 -1
- package/ui.form-switch/types.ts +1 -1
- package/ui.form-textarea/types.ts +1 -1
- package/ui.image-avatar/types.ts +1 -1
- package/ui.image-icon/UIcon.vue +2 -18
- package/ui.image-icon/storybook/stories.ts +0 -3
- package/ui.image-icon/types.ts +1 -13
- package/ui.loader/types.ts +1 -1
- package/ui.loader-overlay/types.ts +1 -1
- package/ui.loader-progress/types.ts +1 -1
- package/ui.navigation-pagination/types.ts +1 -1
- package/ui.navigation-progress/types.ts +2 -2
- package/ui.navigation-tab/types.ts +1 -1
- package/ui.navigation-tabs/types.ts +1 -1
- package/ui.other-dot/types.ts +1 -1
- package/ui.other-theme-color-toggle/storybook/stories.ts +1 -1
- package/ui.other-theme-color-toggle/types.ts +1 -1
- package/ui.text-alert/types.ts +1 -1
- package/ui.text-badge/types.ts +1 -1
- package/ui.text-block/types.ts +1 -1
- package/ui.text-empty/types.ts +1 -1
- package/ui.text-file/types.ts +1 -1
- package/ui.text-files/types.ts +1 -1
- package/ui.text-header/types.ts +1 -1
- package/ui.text-money/types.ts +1 -1
- package/ui.text-notify/types.ts +1 -1
- package/ui.text-number/types.ts +1 -1
- package/utils/theme.ts +5 -1
|
@@ -32,7 +32,7 @@ const emit = defineEmits([
|
|
|
32
32
|
"update:modelValue",
|
|
33
33
|
|
|
34
34
|
/**
|
|
35
|
-
* Triggers when back link
|
|
35
|
+
* Triggers when a back link is clicked.
|
|
36
36
|
*/
|
|
37
37
|
"back",
|
|
38
38
|
]);
|
|
@@ -113,6 +113,7 @@ const {
|
|
|
113
113
|
config,
|
|
114
114
|
modalAttrs,
|
|
115
115
|
titleAttrs,
|
|
116
|
+
backLinkWrapperAttrs,
|
|
116
117
|
backLinkAttrs,
|
|
117
118
|
backLinkIconAttrs,
|
|
118
119
|
closeIconAttrs,
|
|
@@ -157,25 +158,25 @@ const {
|
|
|
157
158
|
<slot name="before-title" />
|
|
158
159
|
|
|
159
160
|
<div v-bind="headerLeftFallbackAttrs">
|
|
160
|
-
<
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
<
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
</
|
|
161
|
+
<div v-if="isShownArrowButton" v-bind="backLinkWrapperAttrs">
|
|
162
|
+
<UIcon
|
|
163
|
+
internal
|
|
164
|
+
size="2xs"
|
|
165
|
+
color="gray"
|
|
166
|
+
:name="config.defaults.backIcon"
|
|
167
|
+
v-bind="backLinkIconAttrs"
|
|
168
|
+
/>
|
|
169
|
+
|
|
170
|
+
<ULink
|
|
171
|
+
size="sm"
|
|
172
|
+
color="gray"
|
|
173
|
+
:to="backTo"
|
|
174
|
+
:ring="false"
|
|
175
|
+
:label="backLabel"
|
|
176
|
+
v-bind="backLinkAttrs"
|
|
177
|
+
@click="onClickBackLink"
|
|
178
|
+
/>
|
|
179
|
+
</div>
|
|
179
180
|
|
|
180
181
|
<UHeader :label="title" size="sm" v-bind="titleAttrs" />
|
|
181
182
|
<div v-if="description" v-bind="descriptionAttrs" v-text="description" />
|
|
@@ -18,9 +18,10 @@ export default /*tw*/ {
|
|
|
18
18
|
leaveToClass: "opacity-0",
|
|
19
19
|
},
|
|
20
20
|
innerWrapper: "py-12 w-full h-full overflow-auto",
|
|
21
|
-
header: "flex
|
|
22
|
-
headerLeft: "flex items-center
|
|
21
|
+
header: "flex justify-between px-4 md:px-8 pb-6 pt-8",
|
|
22
|
+
headerLeft: "flex items-center gap-4",
|
|
23
23
|
headerLeftFallback: "flex flex-col",
|
|
24
|
+
backLinkWrapper: "flex items-center gap-0.5 mb-0.5",
|
|
24
25
|
backLink: "{ULink} flex items-center gap-0.5",
|
|
25
26
|
backLinkIcon: "{UIcon}",
|
|
26
27
|
title: "{UHeader}",
|
|
@@ -25,6 +25,13 @@ const props = withDefaults(defineProps<Props>(), {
|
|
|
25
25
|
backLabel: "",
|
|
26
26
|
});
|
|
27
27
|
|
|
28
|
+
const emit = defineEmits([
|
|
29
|
+
/**
|
|
30
|
+
* Triggers when a back link is clicked.
|
|
31
|
+
*/
|
|
32
|
+
"back",
|
|
33
|
+
]);
|
|
34
|
+
|
|
28
35
|
const { isMobileBreakpoint } = useBreakpoint();
|
|
29
36
|
|
|
30
37
|
const isExistHeader = computed(() => {
|
|
@@ -56,6 +63,10 @@ onMounted(() => {
|
|
|
56
63
|
}
|
|
57
64
|
});
|
|
58
65
|
|
|
66
|
+
function onClickBackLink() {
|
|
67
|
+
emit("back");
|
|
68
|
+
}
|
|
69
|
+
|
|
59
70
|
/**
|
|
60
71
|
* Get element / nested component attributes for each config token ✨
|
|
61
72
|
* Applies: `class`, `config`, redefined default `props` and dev `vl-...` attributes.
|
|
@@ -66,6 +77,7 @@ const {
|
|
|
66
77
|
pageAttrs,
|
|
67
78
|
rightRoundingAttrs,
|
|
68
79
|
titleAttrs,
|
|
80
|
+
backLinkWrapperAttrs,
|
|
69
81
|
backLinkAttrs,
|
|
70
82
|
backLinkIconAttrs,
|
|
71
83
|
headerAttrs,
|
|
@@ -95,25 +107,25 @@ const {
|
|
|
95
107
|
<slot name="before-title" />
|
|
96
108
|
|
|
97
109
|
<div v-bind="headerLeftFallbackAttrs">
|
|
98
|
-
<
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
<
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
</
|
|
110
|
+
<div v-if="isShownArrowButton" v-bind="backLinkWrapperAttrs">
|
|
111
|
+
<UIcon
|
|
112
|
+
internal
|
|
113
|
+
size="2xs"
|
|
114
|
+
color="gray"
|
|
115
|
+
:name="config.defaults.backIcon"
|
|
116
|
+
v-bind="backLinkIconAttrs"
|
|
117
|
+
/>
|
|
118
|
+
|
|
119
|
+
<ULink
|
|
120
|
+
:ring="false"
|
|
121
|
+
size="sm"
|
|
122
|
+
color="gray"
|
|
123
|
+
:to="backTo"
|
|
124
|
+
:label="backLabel"
|
|
125
|
+
v-bind="backLinkAttrs"
|
|
126
|
+
@click="onClickBackLink"
|
|
127
|
+
/>
|
|
128
|
+
</div>
|
|
117
129
|
|
|
118
130
|
<UHeader :label="title" :size="titleSize" v-bind="titleAttrs" />
|
|
119
131
|
<div v-if="description" v-bind="descriptionAttrs" v-text="description" />
|
|
@@ -32,6 +32,7 @@ export default /*tw*/ {
|
|
|
32
32
|
header: "flex items-start justify-between mb-4 md:mb-6",
|
|
33
33
|
headerLeft: "flex items-center gap-4",
|
|
34
34
|
headerLeftFallback: "flex flex-col gap-0.5",
|
|
35
|
+
backLinkWrapper: "flex items-center gap-0.5",
|
|
35
36
|
backLink: "{ULink}",
|
|
36
37
|
backLinkIcon: "{UIcon}",
|
|
37
38
|
title: "{UHeader}",
|
package/ui.data-list/types.ts
CHANGED
package/ui.data-table/types.ts
CHANGED
|
@@ -68,12 +68,18 @@ const mutatedProps = computed(() => ({
|
|
|
68
68
|
opened: isShownOptions.value,
|
|
69
69
|
}));
|
|
70
70
|
|
|
71
|
-
const { config, wrapperAttrs, dropdownLinkAttrs, dropdownListAttrs,
|
|
71
|
+
const { config, getDataTest, wrapperAttrs, dropdownLinkAttrs, dropdownListAttrs, toggleIconAttrs } =
|
|
72
72
|
useUI<Config>(defaultConfig, mutatedProps);
|
|
73
73
|
</script>
|
|
74
74
|
|
|
75
75
|
<template>
|
|
76
76
|
<div v-click-outside="hideOptions" v-bind="wrapperAttrs">
|
|
77
|
+
<!--
|
|
78
|
+
@slot Use it to add something before the label.
|
|
79
|
+
@binding {boolean} opened
|
|
80
|
+
-->
|
|
81
|
+
<slot name="left" :opened="isShownOptions" />
|
|
82
|
+
|
|
77
83
|
<ULink
|
|
78
84
|
:id="elementId"
|
|
79
85
|
:ring="ring"
|
|
@@ -84,48 +90,38 @@ const { config, wrapperAttrs, dropdownLinkAttrs, dropdownListAttrs, dropdownIcon
|
|
|
84
90
|
:disabled="disabled"
|
|
85
91
|
:underlined="underlined"
|
|
86
92
|
v-bind="dropdownLinkAttrs"
|
|
87
|
-
:data-test="
|
|
93
|
+
:data-test="getDataTest()"
|
|
88
94
|
@click="onClickLink"
|
|
89
95
|
@keydown.enter="onClickLink"
|
|
90
96
|
@keydown.space.prevent="onClickLink"
|
|
91
97
|
>
|
|
92
|
-
<template #
|
|
98
|
+
<template #default>
|
|
93
99
|
<!--
|
|
94
|
-
@slot Use it to add something
|
|
100
|
+
@slot Use it to add something instead of the default label.
|
|
101
|
+
@binding {string} label
|
|
95
102
|
@binding {boolean} opened
|
|
96
103
|
-->
|
|
97
|
-
<slot name="left" :opened="isShownOptions" />
|
|
98
|
-
</template>
|
|
99
|
-
|
|
100
|
-
<template #default>
|
|
101
|
-
<!--
|
|
102
|
-
@slot Use it to add something instead of the default label.
|
|
103
|
-
@binding {string} label
|
|
104
|
-
@binding {boolean} opened
|
|
105
|
-
-->
|
|
106
104
|
<slot :label="label" :opened="isShownOptions" />
|
|
107
105
|
</template>
|
|
108
|
-
|
|
109
|
-
<template #right>
|
|
110
|
-
<!--
|
|
111
|
-
@slot Use it to add something after the label.
|
|
112
|
-
@binding {boolean} opened
|
|
113
|
-
-->
|
|
114
|
-
<slot name="right" :opened="isShownOptions">
|
|
115
|
-
<UIcon
|
|
116
|
-
v-if="!noIcon"
|
|
117
|
-
internal
|
|
118
|
-
interactive
|
|
119
|
-
:color="color"
|
|
120
|
-
:name="config.defaults.dropdownIcon"
|
|
121
|
-
v-bind="dropdownIconAttrs"
|
|
122
|
-
:data-test="`${dataTest}-dropdown`"
|
|
123
|
-
@click="onClickLink"
|
|
124
|
-
/>
|
|
125
|
-
</slot>
|
|
126
|
-
</template>
|
|
127
106
|
</ULink>
|
|
128
107
|
|
|
108
|
+
<!--
|
|
109
|
+
@slot Use it to add something after the label.
|
|
110
|
+
@binding {boolean} opened
|
|
111
|
+
-->
|
|
112
|
+
<slot name="right" :opened="isShownOptions">
|
|
113
|
+
<UIcon
|
|
114
|
+
v-if="!noIcon"
|
|
115
|
+
internal
|
|
116
|
+
interactive
|
|
117
|
+
:color="color"
|
|
118
|
+
:name="config.defaults.toggleIcon"
|
|
119
|
+
v-bind="toggleIconAttrs"
|
|
120
|
+
:data-test="getDataTest('toggle')"
|
|
121
|
+
@click="onClickLink"
|
|
122
|
+
/>
|
|
123
|
+
</slot>
|
|
124
|
+
|
|
129
125
|
<UDropdownList
|
|
130
126
|
v-if="isShownOptions"
|
|
131
127
|
ref="dropdown-list"
|
|
@@ -133,7 +129,7 @@ const { config, wrapperAttrs, dropdownLinkAttrs, dropdownListAttrs, dropdownIcon
|
|
|
133
129
|
:options="options"
|
|
134
130
|
:label-key="labelKey"
|
|
135
131
|
v-bind="dropdownListAttrs"
|
|
136
|
-
:data-test="
|
|
132
|
+
:data-test="getDataTest('list')"
|
|
137
133
|
@click-option="onClickOption"
|
|
138
134
|
/>
|
|
139
135
|
</div>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export default /*tw*/ {
|
|
2
2
|
wrapper: {
|
|
3
|
-
base: "relative inline-
|
|
3
|
+
base: "relative inline-flex",
|
|
4
4
|
variants: {
|
|
5
5
|
opened: {
|
|
6
6
|
true: "group",
|
|
@@ -8,7 +8,7 @@ export default /*tw*/ {
|
|
|
8
8
|
},
|
|
9
9
|
},
|
|
10
10
|
dropdownLink: "{ULink}",
|
|
11
|
-
|
|
11
|
+
toggleIcon: {
|
|
12
12
|
base: "{UIcon} block transition duration-300 group-[]:rotate-180",
|
|
13
13
|
defaults: {
|
|
14
14
|
size: {
|
|
@@ -43,6 +43,6 @@ export default /*tw*/ {
|
|
|
43
43
|
noIcon: false,
|
|
44
44
|
disabled: false,
|
|
45
45
|
/* icons */
|
|
46
|
-
|
|
46
|
+
toggleIcon: "keyboard_arrow_down",
|
|
47
47
|
},
|
|
48
48
|
};
|
package/ui.form-input/types.ts
CHANGED
package/ui.form-label/types.ts
CHANGED
package/ui.form-radio/types.ts
CHANGED
|
@@ -416,6 +416,7 @@ const mutatedProps = computed(() => ({
|
|
|
416
416
|
|
|
417
417
|
const {
|
|
418
418
|
config,
|
|
419
|
+
getDataTest,
|
|
419
420
|
selectLabelAttrs,
|
|
420
421
|
wrapperAttrs,
|
|
421
422
|
innerWrapperAttrs,
|
|
@@ -453,7 +454,7 @@ const {
|
|
|
453
454
|
centred
|
|
454
455
|
interactive
|
|
455
456
|
v-bind="selectLabelAttrs"
|
|
456
|
-
:data-test="
|
|
457
|
+
:data-test="getDataTest()"
|
|
457
458
|
:tabindex="-1"
|
|
458
459
|
>
|
|
459
460
|
<template #label>
|
|
@@ -503,6 +504,7 @@ const {
|
|
|
503
504
|
v-show="!multiple || (!isLocalValue && multiple)"
|
|
504
505
|
v-bind="toggleWrapperAttrs"
|
|
505
506
|
:tabindex="-1"
|
|
507
|
+
:data-test="getDataTest('toggle')"
|
|
506
508
|
@mousedown.prevent.stop="toggle"
|
|
507
509
|
>
|
|
508
510
|
<!--
|
|
@@ -517,7 +519,6 @@ const {
|
|
|
517
519
|
color="gray"
|
|
518
520
|
:name="config.defaults.dropdownIcon"
|
|
519
521
|
v-bind="toggleIconAttrs"
|
|
520
|
-
:data-test="`${dataTest}-toggle`"
|
|
521
522
|
:tabindex="-1"
|
|
522
523
|
/>
|
|
523
524
|
</slot>
|
|
@@ -526,6 +527,7 @@ const {
|
|
|
526
527
|
<div
|
|
527
528
|
v-if="isLocalValue && clearable && !disabled && !multiple"
|
|
528
529
|
v-bind="clearAttrs"
|
|
530
|
+
:data-test="getDataTest('clear')"
|
|
529
531
|
@mousedown="onMouseDownClear"
|
|
530
532
|
>
|
|
531
533
|
<!--
|
|
@@ -539,7 +541,6 @@ const {
|
|
|
539
541
|
color="gray"
|
|
540
542
|
:name="config.defaults.clearIcon"
|
|
541
543
|
v-bind="clearIconAttrs"
|
|
542
|
-
:data-test="`${dataTest}-clear`"
|
|
543
544
|
/>
|
|
544
545
|
</slot>
|
|
545
546
|
</div>
|
|
@@ -599,6 +600,7 @@ const {
|
|
|
599
600
|
<div
|
|
600
601
|
v-if="!disabled"
|
|
601
602
|
v-bind="clearMultipleAttrs"
|
|
603
|
+
:data-test="getDataTest('clear-item')"
|
|
602
604
|
@mousedown.prevent.capture
|
|
603
605
|
@click.prevent.capture
|
|
604
606
|
@mousedown="onMouseDownClearItem($event, item)"
|
|
@@ -614,7 +616,6 @@ const {
|
|
|
614
616
|
color="gray"
|
|
615
617
|
:name="config.defaults.clearMultipleIcon"
|
|
616
618
|
v-bind="clearMultipleIconAttrs"
|
|
617
|
-
:data-test="`${dataTest}-clear-all`"
|
|
618
619
|
/>
|
|
619
620
|
</slot>
|
|
620
621
|
</div>
|
|
@@ -634,7 +635,7 @@ const {
|
|
|
634
635
|
:disabled="disabled"
|
|
635
636
|
:aria-controls="'listbox-' + elementId"
|
|
636
637
|
v-bind="searchInputAttrs"
|
|
637
|
-
:data-test="
|
|
638
|
+
:data-test="getDataTest('search')"
|
|
638
639
|
@focus="activate"
|
|
639
640
|
@blur.prevent="deactivate"
|
|
640
641
|
@keyup.esc="deactivate"
|
|
@@ -674,6 +675,7 @@ const {
|
|
|
674
675
|
<div
|
|
675
676
|
v-if="isLocalValue && clearable && !disabled && multiple"
|
|
676
677
|
v-bind="clearMultipleTextAttrs"
|
|
678
|
+
:data-test="getDataTest('clear-all')"
|
|
677
679
|
@mousedown.prevent.capture="onMouseDownClear"
|
|
678
680
|
@click.prevent.capture
|
|
679
681
|
v-text="currentLocale.clear"
|
|
@@ -693,7 +695,7 @@ const {
|
|
|
693
695
|
:add-option="addOption"
|
|
694
696
|
tabindex="-1"
|
|
695
697
|
v-bind="dropdownListAttrs as KeyAttrsWithConfig<UDropdownListConfig>"
|
|
696
|
-
:data-test="
|
|
698
|
+
:data-test="getDataTest()"
|
|
697
699
|
@add="onAddOption"
|
|
698
700
|
@focus="activate"
|
|
699
701
|
@mousedown.prevent.capture
|
package/ui.form-select/types.ts
CHANGED
package/ui.form-switch/types.ts
CHANGED
package/ui.image-avatar/types.ts
CHANGED