@fy-/fws-vue 0.0.947 → 0.0.949
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/components/ui/DefaultInput.vue +104 -79
- package/env.d.ts +2 -0
- package/index.ts +10 -0
- package/package.json +3 -5
- package/presets/Wind/accordion/index.js +75 -0
- package/presets/Wind/autocomplete/index.js +294 -0
- package/presets/Wind/avatar/index.js +48 -0
- package/presets/Wind/badge/index.js +43 -0
- package/presets/Wind/badgedirective/index.js +50 -0
- package/presets/Wind/blockui/index.js +8 -0
- package/presets/Wind/breadcrumb/index.js +45 -0
- package/presets/Wind/button/index.js +474 -0
- package/presets/Wind/calendar/index.js +659 -0
- package/presets/Wind/card/index.js +40 -0
- package/presets/Wind/carousel/index.js +152 -0
- package/presets/Wind/cascadeselect/index.js +225 -0
- package/presets/Wind/checkbox/index.js +112 -0
- package/presets/Wind/chip/index.js +45 -0
- package/presets/Wind/chips/index.js +120 -0
- package/presets/Wind/colorpicker/index.js +129 -0
- package/presets/Wind/confirmpopup/index.js +123 -0
- package/presets/Wind/contextmenu/index.js +128 -0
- package/presets/Wind/datatable/index.js +1330 -0
- package/presets/Wind/dataview/index.js +40 -0
- package/presets/Wind/deferred/index.js +3 -0
- package/presets/Wind/dialog/index.js +251 -0
- package/presets/Wind/divider/index.js +72 -0
- package/presets/Wind/dock/index.js +97 -0
- package/presets/Wind/dropdown/index.js +287 -0
- package/presets/Wind/fieldset/index.js +99 -0
- package/presets/Wind/fileupload/index.js +173 -0
- package/presets/Wind/floatlabel/index.js +26 -0
- package/presets/Wind/galleria/index.js +351 -0
- package/presets/Wind/global.js +77 -0
- package/presets/Wind/iconfield/index.js +22 -0
- package/presets/Wind/image/index.js +206 -0
- package/presets/Wind/index.js +181 -0
- package/presets/Wind/inlinemessage/index.js +29 -0
- package/presets/Wind/inplace/index.js +30 -0
- package/presets/Wind/inputgroup/index.js +5 -0
- package/presets/Wind/inputgroupaddon/index.js +28 -0
- package/presets/Wind/inputmask/index.js +34 -0
- package/presets/Wind/inputnumber/index.js +244 -0
- package/presets/Wind/inputotp/index.js +72 -0
- package/presets/Wind/inputswitch/index.js +106 -0
- package/presets/Wind/inputtext/index.js +61 -0
- package/presets/Wind/knob/index.js +47 -0
- package/presets/Wind/listbox/index.js +159 -0
- package/presets/Wind/megamenu/index.js +218 -0
- package/presets/Wind/menu/index.js +111 -0
- package/presets/Wind/menubar/index.js +188 -0
- package/presets/Wind/message/index.js +87 -0
- package/presets/Wind/metergroup/index.js +110 -0
- package/presets/Wind/multiselect/index.js +619 -0
- package/presets/Wind/orderlist/index.js +275 -0
- package/presets/Wind/organizationchart/index.js +143 -0
- package/presets/Wind/overlaypanel/index.js +42 -0
- package/presets/Wind/paginator/index.js +596 -0
- package/presets/Wind/panel/index.js +95 -0
- package/presets/Wind/panelmenu/index.js +136 -0
- package/presets/Wind/password/index.js +141 -0
- package/presets/Wind/picklist/index.js +684 -0
- package/presets/Wind/progressbar/index.js +68 -0
- package/presets/Wind/progressspinner/index.js +51 -0
- package/presets/Wind/radiobutton/index.js +92 -0
- package/presets/Wind/rating/index.js +86 -0
- package/presets/Wind/ripple/index.js +6 -0
- package/presets/Wind/scrollpanel/index.js +77 -0
- package/presets/Wind/scrolltop/index.js +45 -0
- package/presets/Wind/selectbutton/index.js +58 -0
- package/presets/Wind/sidebar/index.js +165 -0
- package/presets/Wind/skeleton/index.js +19 -0
- package/presets/Wind/slider/index.js +135 -0
- package/presets/Wind/speeddial/index.js +536 -0
- package/presets/Wind/splitbutton/index.js +1078 -0
- package/presets/Wind/splitter/index.js +64 -0
- package/presets/Wind/stepper/index.js +180 -0
- package/presets/Wind/steps/index.js +132 -0
- package/presets/Wind/tabmenu/index.js +84 -0
- package/presets/Wind/tabview/index.js +168 -0
- package/presets/Wind/tag/index.js +37 -0
- package/presets/Wind/terminal/index.js +60 -0
- package/presets/Wind/textarea/index.js +40 -0
- package/presets/Wind/tieredmenu/index.js +121 -0
- package/presets/Wind/timeline/index.js +107 -0
- package/presets/Wind/toast/index.js +111 -0
- package/presets/Wind/togglebutton/index.js +91 -0
- package/presets/Wind/toolbar/index.js +30 -0
- package/presets/Wind/tooltip/index.js +43 -0
- package/presets/Wind/tree/index.js +300 -0
- package/presets/Wind/treeselect/index.js +404 -0
- package/presets/Wind/treetable/index.js +505 -0
- package/presets/Wind/tristatecheckbox/index.js +118 -0
- package/style.css +5 -6
|
@@ -3,6 +3,12 @@ import { LinkIcon } from "@heroicons/vue/24/solid";
|
|
|
3
3
|
import { computed, ref, toRef } from "vue";
|
|
4
4
|
import type { ErrorObject } from "@vuelidate/core";
|
|
5
5
|
import { useTranslation } from "../../composables/translations";
|
|
6
|
+
import InputText from "primevue/inputtext";
|
|
7
|
+
import Textarea from "primevue/textarea";
|
|
8
|
+
import Calendar from "primevue/calendar";
|
|
9
|
+
import Password from "primevue/password";
|
|
10
|
+
import Checkbox from "primevue/checkbox";
|
|
11
|
+
|
|
6
12
|
type modelValueType = string | number | string[] | number[] | undefined;
|
|
7
13
|
|
|
8
14
|
type checkboxValueType = any[] | Set<any> | undefined | boolean;
|
|
@@ -91,91 +97,110 @@ defineExpose({ focus, getInputRef });
|
|
|
91
97
|
].includes(type)
|
|
92
98
|
"
|
|
93
99
|
>
|
|
94
|
-
<
|
|
95
|
-
:for="id"
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
'
|
|
109
|
-
'email'
|
|
110
|
-
'search'
|
|
111
|
-
'
|
|
112
|
-
'
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
100
|
+
<div class="flex flex-col gap-2">
|
|
101
|
+
<label :for="id" v-if="label">{{ label }}</label>
|
|
102
|
+
<!-- @vue-skip -->
|
|
103
|
+
<InputText
|
|
104
|
+
:id="id"
|
|
105
|
+
v-model="model"
|
|
106
|
+
:placeholder="placeholder"
|
|
107
|
+
:invalid="checkErrors ? true : false"
|
|
108
|
+
:aria-describedby="
|
|
109
|
+
help && !['checkbox', 'radio'].includes(type)
|
|
110
|
+
? `${id}-help`
|
|
111
|
+
: undefined
|
|
112
|
+
"
|
|
113
|
+
v-if="
|
|
114
|
+
type == 'text' ||
|
|
115
|
+
type == 'email' ||
|
|
116
|
+
type == 'search' ||
|
|
117
|
+
type == 'url' ||
|
|
118
|
+
type == 'phone'
|
|
119
|
+
"
|
|
120
|
+
/>
|
|
121
|
+
<!-- @vue-skip -->
|
|
122
|
+
<Textarea
|
|
123
|
+
:id="id"
|
|
124
|
+
v-model="model"
|
|
125
|
+
:placeholder="placeholder"
|
|
126
|
+
:invalid="checkErrors ? true : false"
|
|
127
|
+
:aria-describedby="
|
|
128
|
+
help && !['checkbox', 'radio'].includes(type)
|
|
129
|
+
? `${id}-help`
|
|
130
|
+
: undefined
|
|
131
|
+
"
|
|
132
|
+
v-if="type == 'textarea'"
|
|
133
|
+
/>
|
|
134
|
+
<!-- @vue-skip -->
|
|
135
|
+
<Calendar
|
|
136
|
+
:id="id"
|
|
137
|
+
v-model="model"
|
|
138
|
+
:placeholder="placeholder"
|
|
139
|
+
:invalid="checkErrors ? true : false"
|
|
140
|
+
showIcon
|
|
141
|
+
iconDisplay="input"
|
|
142
|
+
:aria-describedby="
|
|
143
|
+
help && !['checkbox', 'radio'].includes(type)
|
|
144
|
+
? `${id}-help`
|
|
145
|
+
: undefined
|
|
146
|
+
"
|
|
147
|
+
v-if="type == 'date'"
|
|
148
|
+
/>
|
|
149
|
+
<!-- @vue-skip -->
|
|
150
|
+
<Calendar
|
|
151
|
+
:id="id"
|
|
152
|
+
v-model="model"
|
|
153
|
+
:placeholder="placeholder"
|
|
154
|
+
:invalid="checkErrors ? true : false"
|
|
155
|
+
showTime
|
|
156
|
+
hourFormat="24"
|
|
157
|
+
showIcon
|
|
158
|
+
iconDisplay="input"
|
|
159
|
+
:aria-describedby="
|
|
160
|
+
help && !['checkbox', 'radio'].includes(type)
|
|
161
|
+
? `${id}-help`
|
|
162
|
+
: undefined
|
|
163
|
+
"
|
|
164
|
+
v-if="type == 'datetime'"
|
|
165
|
+
/>
|
|
166
|
+
<!-- @vue-skip -->
|
|
167
|
+
<Password
|
|
168
|
+
:id="id"
|
|
169
|
+
v-model="model"
|
|
170
|
+
:placeholder="placeholder"
|
|
171
|
+
:invalid="checkErrors ? true : false"
|
|
172
|
+
:aria-describedby="
|
|
173
|
+
help && !['checkbox', 'radio'].includes(type)
|
|
174
|
+
? `${id}-help`
|
|
175
|
+
: undefined
|
|
176
|
+
"
|
|
177
|
+
toggleMask
|
|
178
|
+
v-if="type == 'password'"
|
|
179
|
+
/>
|
|
180
|
+
<small
|
|
181
|
+
:id="`${id}-help`"
|
|
182
|
+
v-if="help && !['checkbox', 'radio'].includes(type)"
|
|
183
|
+
>
|
|
184
|
+
{{ help }}
|
|
185
|
+
</small>
|
|
186
|
+
<small
|
|
187
|
+
:id="`${id}-error`"
|
|
188
|
+
v-if="checkErrors"
|
|
189
|
+
class="mt-2 text-xs fws-error-text"
|
|
190
|
+
>
|
|
191
|
+
{{ checkErrors }}
|
|
192
|
+
</small>
|
|
193
|
+
</div>
|
|
163
194
|
</template>
|
|
164
195
|
|
|
165
196
|
<template v-if="type == 'checkbox'">
|
|
166
197
|
<div class="flex items-center">
|
|
167
|
-
<
|
|
168
|
-
:aria-describedby="label"
|
|
169
|
-
:id="id"
|
|
170
|
-
ref="inputRef"
|
|
171
|
-
:true-value="checkboxTrueValue"
|
|
172
|
-
:false-value="checkboxFalseValue"
|
|
198
|
+
<Checkbox
|
|
173
199
|
v-model="modelCheckbox"
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
:checked="modelCheckbox"
|
|
177
|
-
class="w-4 h-4 mr-2 text-fv-primary-600 bg-fv-neutral-100 border-fv-neutral-300 rounded focus:ring-fv-primary-500 dark:focus:ring-fv-primary-600 dark:ring-offset-fv-neutral-800 focus:ring-2 dark:bg-fv-neutral-700 dark:border-fv-neutral-600"
|
|
200
|
+
:binary="true"
|
|
201
|
+
:aria-describedby="label"
|
|
178
202
|
/>
|
|
203
|
+
|
|
179
204
|
<label
|
|
180
205
|
:for="id"
|
|
181
206
|
v-if="label"
|
package/env.d.ts
CHANGED
package/index.ts
CHANGED
|
@@ -49,6 +49,10 @@ import FilterData from "./components/fws/FilterData.vue";
|
|
|
49
49
|
import CmsArticleBoxed from "./components/fws/CmsArticleBoxed.vue";
|
|
50
50
|
import CmsArticleSingle from "./components/fws/CmsArticleSingle.vue";
|
|
51
51
|
|
|
52
|
+
// Primevue
|
|
53
|
+
import Wind from "./presets/Wind";
|
|
54
|
+
|
|
55
|
+
// Css
|
|
52
56
|
import "./style.css";
|
|
53
57
|
|
|
54
58
|
function createFWS(): Plugin {
|
|
@@ -92,6 +96,9 @@ declare module "vue" {
|
|
|
92
96
|
}
|
|
93
97
|
}
|
|
94
98
|
|
|
99
|
+
const Primevue = {
|
|
100
|
+
Wind: Wind,
|
|
101
|
+
};
|
|
95
102
|
export {
|
|
96
103
|
i18nextPromise,
|
|
97
104
|
useTranslation,
|
|
@@ -133,4 +140,7 @@ export {
|
|
|
133
140
|
FilterData,
|
|
134
141
|
CmsArticleBoxed,
|
|
135
142
|
CmsArticleSingle,
|
|
143
|
+
|
|
144
|
+
// Primevue
|
|
145
|
+
Primevue,
|
|
136
146
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fy-/fws-vue",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.949",
|
|
4
4
|
"author": "Florian 'Fy' Gasquez <m@fy.to>",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -37,9 +37,7 @@
|
|
|
37
37
|
"pinia": "2.x.x",
|
|
38
38
|
"timeago.js": "^4.0.x",
|
|
39
39
|
"vue": "^3.3.x",
|
|
40
|
-
"vue-router": "^4.1.x"
|
|
41
|
-
|
|
42
|
-
"dependencies": {
|
|
43
|
-
"timeago.js": "^4.0.2"
|
|
40
|
+
"vue-router": "^4.1.x",
|
|
41
|
+
"primevue": "^3.5.x"
|
|
44
42
|
}
|
|
45
43
|
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
accordiontab: {
|
|
3
|
+
header: ({ props }) => ({
|
|
4
|
+
class: [
|
|
5
|
+
// Sizing
|
|
6
|
+
"pt-6 pb-0",
|
|
7
|
+
"mt-6",
|
|
8
|
+
|
|
9
|
+
// Shape
|
|
10
|
+
"border-x-0 border-b-0",
|
|
11
|
+
|
|
12
|
+
// Color
|
|
13
|
+
"border border-surface-200 dark:border-surface-700",
|
|
14
|
+
|
|
15
|
+
// State
|
|
16
|
+
{
|
|
17
|
+
"select-none pointer-events-none cursor-default opacity-60":
|
|
18
|
+
props?.disabled,
|
|
19
|
+
},
|
|
20
|
+
],
|
|
21
|
+
}),
|
|
22
|
+
headerAction: ({ context }) => ({
|
|
23
|
+
class: [
|
|
24
|
+
//Font
|
|
25
|
+
"font-semibold",
|
|
26
|
+
"leading-7",
|
|
27
|
+
|
|
28
|
+
// Alignments
|
|
29
|
+
"flex items-center justify-between flex-row-reverse",
|
|
30
|
+
"relative",
|
|
31
|
+
|
|
32
|
+
// Shape
|
|
33
|
+
"rounded-md",
|
|
34
|
+
|
|
35
|
+
// Color
|
|
36
|
+
"bg-transparent",
|
|
37
|
+
"text-surface-900 dark:text-surface-0",
|
|
38
|
+
|
|
39
|
+
// States
|
|
40
|
+
"focus:outline-none focus:outline-offset-0 focus-visible:ring-2 focus-visible:ring-primary-600 ring-inset dark:focus-visible:ring-primary-500", // Focus
|
|
41
|
+
|
|
42
|
+
// Misc
|
|
43
|
+
"cursor-pointer no-underline select-none",
|
|
44
|
+
],
|
|
45
|
+
}),
|
|
46
|
+
headerIcon: {
|
|
47
|
+
class: "inline-block ml-2",
|
|
48
|
+
},
|
|
49
|
+
headerTitle: {
|
|
50
|
+
class: "leading-7",
|
|
51
|
+
},
|
|
52
|
+
content: {
|
|
53
|
+
class: [
|
|
54
|
+
// Font
|
|
55
|
+
"leading-7",
|
|
56
|
+
|
|
57
|
+
// Spacing
|
|
58
|
+
"pr-12 pt-2",
|
|
59
|
+
|
|
60
|
+
// Color
|
|
61
|
+
"text-surface-600 dark:text-surface-0/70",
|
|
62
|
+
],
|
|
63
|
+
},
|
|
64
|
+
transition: {
|
|
65
|
+
enterFromClass: "max-h-0",
|
|
66
|
+
enterActiveClass:
|
|
67
|
+
"overflow-hidden transition-[max-height] duration-1000 ease-[cubic-bezier(0.42,0,0.58,1)]",
|
|
68
|
+
enterToClass: "max-h-[1000px]",
|
|
69
|
+
leaveFromClass: "max-h-[1000px]",
|
|
70
|
+
leaveActiveClass:
|
|
71
|
+
"overflow-hidden transition-[max-height] duration-[450ms] ease-[cubic-bezier(0,1,0,1)]",
|
|
72
|
+
leaveToClass: "max-h-0",
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
};
|
|
@@ -0,0 +1,294 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
root: ({ props }) => ({
|
|
3
|
+
class: [
|
|
4
|
+
"relative",
|
|
5
|
+
|
|
6
|
+
// Flex
|
|
7
|
+
"inline-flex",
|
|
8
|
+
|
|
9
|
+
// Size
|
|
10
|
+
{ "w-full": props.multiple },
|
|
11
|
+
|
|
12
|
+
// Color
|
|
13
|
+
"text-surface-900 dark:text-surface-0",
|
|
14
|
+
|
|
15
|
+
//States
|
|
16
|
+
{
|
|
17
|
+
"opacity-60 select-none pointer-events-none cursor-default":
|
|
18
|
+
props.disabled,
|
|
19
|
+
},
|
|
20
|
+
],
|
|
21
|
+
}),
|
|
22
|
+
container: ({ props, state }) => ({
|
|
23
|
+
class: [
|
|
24
|
+
// Font
|
|
25
|
+
"font-sans sm:text-sm leading-none",
|
|
26
|
+
|
|
27
|
+
// Flex
|
|
28
|
+
"flex items-center flex-wrap",
|
|
29
|
+
"gap-1",
|
|
30
|
+
|
|
31
|
+
// Spacing
|
|
32
|
+
"m-0 list-none",
|
|
33
|
+
"px-3 py-1",
|
|
34
|
+
{ "px-3 py-1.5": !props.multiple, "px-3 py-1": props.multiple },
|
|
35
|
+
// Size
|
|
36
|
+
"w-full",
|
|
37
|
+
|
|
38
|
+
// Shape
|
|
39
|
+
"appearance-none rounded-md",
|
|
40
|
+
|
|
41
|
+
// Color
|
|
42
|
+
"text-surface-900 dark:text-surface-0",
|
|
43
|
+
"bg-surface-0 dark:bg-surface-900",
|
|
44
|
+
"placeholder:text-surface-400 dark:placeholder:text-surface-500",
|
|
45
|
+
"shadow-sm",
|
|
46
|
+
|
|
47
|
+
// States
|
|
48
|
+
"focus:outline-none focus:outline-offset-0",
|
|
49
|
+
// States
|
|
50
|
+
{
|
|
51
|
+
"ring-1 ring-inset": !state.focused,
|
|
52
|
+
"ring-2 ring-inset ring-primary-500 dark:ring-primary-400":
|
|
53
|
+
state.focused,
|
|
54
|
+
},
|
|
55
|
+
|
|
56
|
+
{
|
|
57
|
+
"ring-surface-300 dark:ring-surface-600":
|
|
58
|
+
!props.invalid && !state.focused,
|
|
59
|
+
},
|
|
60
|
+
|
|
61
|
+
// Invalid State
|
|
62
|
+
{ "ring-red-500 dark:ring-red-400": props.invalid && !state.focused },
|
|
63
|
+
|
|
64
|
+
// Transition
|
|
65
|
+
"transition duration-200 ease-in-out",
|
|
66
|
+
|
|
67
|
+
// Misc
|
|
68
|
+
"cursor-text overflow-hidden",
|
|
69
|
+
],
|
|
70
|
+
}),
|
|
71
|
+
inputtoken: ({ props }) => ({
|
|
72
|
+
class: [
|
|
73
|
+
{ "py-1.5 px-0": !props.multiple, "p-0.5": props.multiple },
|
|
74
|
+
,
|
|
75
|
+
"inline-flex flex-auto",
|
|
76
|
+
],
|
|
77
|
+
}),
|
|
78
|
+
input: ({ props }) => ({
|
|
79
|
+
class: [
|
|
80
|
+
// Font
|
|
81
|
+
"font-sans sm:text-sm leading-none",
|
|
82
|
+
|
|
83
|
+
// Shape
|
|
84
|
+
"appearance-none rounded-md",
|
|
85
|
+
{ "rounded-tr-none rounded-br-none": props.dropdown },
|
|
86
|
+
{ "outline-none shadow-none rounded-none": props.multiple },
|
|
87
|
+
|
|
88
|
+
// Size
|
|
89
|
+
{ "w-full": props.multiple },
|
|
90
|
+
|
|
91
|
+
// Spacing
|
|
92
|
+
"m-0",
|
|
93
|
+
{ "py-1.5 px-3": !props.multiple, "p-0": props.multiple },
|
|
94
|
+
|
|
95
|
+
// Colors
|
|
96
|
+
"text-surface-700 dark:text-white/80",
|
|
97
|
+
"border",
|
|
98
|
+
{
|
|
99
|
+
"bg-surface-0 dark:bg-surface-900": !props.multiple,
|
|
100
|
+
"border-surface-300 dark:border-surface-700":
|
|
101
|
+
!props.multiple && !props.invalid,
|
|
102
|
+
"border-0 bg-transparent": props.multiple,
|
|
103
|
+
},
|
|
104
|
+
|
|
105
|
+
// Invalid State
|
|
106
|
+
{ "border-red-500 dark:border-red-400": props.invalid },
|
|
107
|
+
|
|
108
|
+
// States
|
|
109
|
+
{
|
|
110
|
+
"focus:outline-none focus:outline-offset-0 focus:ring-inset focus:ring-2 focus:ring-primary-500 dark:focus:ring-primary-400":
|
|
111
|
+
!props.multiple,
|
|
112
|
+
},
|
|
113
|
+
|
|
114
|
+
// Transition
|
|
115
|
+
"transition-colors duration-200",
|
|
116
|
+
],
|
|
117
|
+
}),
|
|
118
|
+
token: {
|
|
119
|
+
class: [
|
|
120
|
+
// Flexbox
|
|
121
|
+
"inline-flex items-center",
|
|
122
|
+
|
|
123
|
+
// Spacing
|
|
124
|
+
"py-0.5 px-3",
|
|
125
|
+
|
|
126
|
+
// Shape
|
|
127
|
+
"rounded-[1.14rem]",
|
|
128
|
+
|
|
129
|
+
// Colors
|
|
130
|
+
"text-surface-700 dark:text-white/70",
|
|
131
|
+
"bg-surface-200 dark:bg-surface-700",
|
|
132
|
+
],
|
|
133
|
+
},
|
|
134
|
+
label: {
|
|
135
|
+
class: "leading-5",
|
|
136
|
+
},
|
|
137
|
+
removeTokenIcon: {
|
|
138
|
+
class: [
|
|
139
|
+
// Shape
|
|
140
|
+
"rounded-md leading-6",
|
|
141
|
+
|
|
142
|
+
// Spacing
|
|
143
|
+
"ml-2",
|
|
144
|
+
|
|
145
|
+
// Size
|
|
146
|
+
"w-4 h-4",
|
|
147
|
+
|
|
148
|
+
// Transition
|
|
149
|
+
"transition duration-200 ease-in-out",
|
|
150
|
+
|
|
151
|
+
// Misc
|
|
152
|
+
"cursor-pointer",
|
|
153
|
+
],
|
|
154
|
+
},
|
|
155
|
+
dropdownbutton: {
|
|
156
|
+
root: {
|
|
157
|
+
class: [
|
|
158
|
+
"relative text-sm leading-none",
|
|
159
|
+
|
|
160
|
+
// Alignments
|
|
161
|
+
"items-center inline-flex text-center align-bottom",
|
|
162
|
+
|
|
163
|
+
// Shape
|
|
164
|
+
"rounded-r-md",
|
|
165
|
+
|
|
166
|
+
// Size
|
|
167
|
+
"px-2.5 py-1.5",
|
|
168
|
+
"-ml-px",
|
|
169
|
+
|
|
170
|
+
// Colors
|
|
171
|
+
"text-surface-600 dark:text-surface-100",
|
|
172
|
+
"bg-surface-100 dark:bg-surface-800",
|
|
173
|
+
"ring-1 ring-inset ring-surface-300 dark:ring-surface-700",
|
|
174
|
+
|
|
175
|
+
// States
|
|
176
|
+
"hover:bg-surface-200 dark:hover:bg-surface-700",
|
|
177
|
+
"focus:outline-none focus:outline-offset-0 focus:ring-1",
|
|
178
|
+
"focus:ring-primary-500 dark:focus:ring-primary-400",
|
|
179
|
+
],
|
|
180
|
+
},
|
|
181
|
+
},
|
|
182
|
+
loadingicon: {
|
|
183
|
+
class: [
|
|
184
|
+
"text-sm leading-none text-surface-500 dark:text-surface-0/70",
|
|
185
|
+
"absolute top-[50%] right-[0.5rem] -mt-2 animate-spin",
|
|
186
|
+
],
|
|
187
|
+
},
|
|
188
|
+
panel: {
|
|
189
|
+
class: [
|
|
190
|
+
// Position
|
|
191
|
+
"absolute top-0 left-0",
|
|
192
|
+
"mt-2",
|
|
193
|
+
|
|
194
|
+
// Shape
|
|
195
|
+
"border-0",
|
|
196
|
+
"rounded-md",
|
|
197
|
+
"shadow-md",
|
|
198
|
+
"max-h-[15rem]",
|
|
199
|
+
"overflow-auto",
|
|
200
|
+
|
|
201
|
+
// Color
|
|
202
|
+
"bg-surface-0 dark:bg-surface-800",
|
|
203
|
+
"text-surface-800 dark:text-white/80",
|
|
204
|
+
"ring-1 ring-inset ring-surface-300 dark:ring-surface-700",
|
|
205
|
+
],
|
|
206
|
+
},
|
|
207
|
+
list: {
|
|
208
|
+
class: "py-1 list-none m-0",
|
|
209
|
+
},
|
|
210
|
+
item: ({ context }) => ({
|
|
211
|
+
class: [
|
|
212
|
+
// Font
|
|
213
|
+
"sm:text-sm",
|
|
214
|
+
"leading-none",
|
|
215
|
+
{ "font-normal": !context.selected, "font-bold": context.selected },
|
|
216
|
+
|
|
217
|
+
// Position
|
|
218
|
+
"relative",
|
|
219
|
+
|
|
220
|
+
// Shape
|
|
221
|
+
"border-0",
|
|
222
|
+
"rounded-none",
|
|
223
|
+
|
|
224
|
+
// Spacing
|
|
225
|
+
"m-0",
|
|
226
|
+
"py-2 px-4",
|
|
227
|
+
|
|
228
|
+
// Color
|
|
229
|
+
{
|
|
230
|
+
"text-surface-700 dark:text-white/80":
|
|
231
|
+
!context.focused && !context.selected,
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
"bg-surface-200 dark:bg-surface-600/60 text-surface-700 dark:text-white/80":
|
|
235
|
+
context.focused && !context.selected,
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
"bg-primary-500 dark:bg-primary-400 text-white dark:text-surface-700":
|
|
239
|
+
context.focused && context.selected,
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
"bg-transparent text-surface-700 dark:text-white/80":
|
|
243
|
+
!context.focused && context.selected,
|
|
244
|
+
},
|
|
245
|
+
|
|
246
|
+
//States
|
|
247
|
+
"hover:bg-primary-500 dark:hover:bg-primary-400 hover:text-white dark:hover:text-surface-700",
|
|
248
|
+
|
|
249
|
+
// Misc
|
|
250
|
+
"cursor-pointer",
|
|
251
|
+
"overflow-hidden",
|
|
252
|
+
"whitespace-nowrap",
|
|
253
|
+
],
|
|
254
|
+
}),
|
|
255
|
+
itemgroup: {
|
|
256
|
+
class: [
|
|
257
|
+
//Font
|
|
258
|
+
"font-bold",
|
|
259
|
+
"sm:text-sm",
|
|
260
|
+
|
|
261
|
+
// Spacing
|
|
262
|
+
"m-0",
|
|
263
|
+
"py-2 px-4",
|
|
264
|
+
|
|
265
|
+
// Color
|
|
266
|
+
"text-surface-800 dark:text-white/80",
|
|
267
|
+
"bg-surface-0 dark:bg-surface-600/80",
|
|
268
|
+
|
|
269
|
+
// Misc
|
|
270
|
+
"cursor-auto",
|
|
271
|
+
],
|
|
272
|
+
},
|
|
273
|
+
emptymessage: {
|
|
274
|
+
class: [
|
|
275
|
+
// Font
|
|
276
|
+
"leading-none",
|
|
277
|
+
"sm:text-sm",
|
|
278
|
+
|
|
279
|
+
// Spacing
|
|
280
|
+
"py-2 px-4",
|
|
281
|
+
|
|
282
|
+
// Color
|
|
283
|
+
"text-surface-800 dark:text-white/80",
|
|
284
|
+
"bg-transparent",
|
|
285
|
+
],
|
|
286
|
+
},
|
|
287
|
+
transition: {
|
|
288
|
+
enterFromClass: "opacity-0 scale-y-[0.8]",
|
|
289
|
+
enterActiveClass:
|
|
290
|
+
"transition-[transform,opacity] duration-[120ms] ease-[cubic-bezier(0,0,0.2,1)]",
|
|
291
|
+
leaveActiveClass: "transition-opacity duration-100 ease-linear",
|
|
292
|
+
leaveToClass: "opacity-0",
|
|
293
|
+
},
|
|
294
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
root: ({ props, parent }) => ({
|
|
3
|
+
class: [
|
|
4
|
+
// Font
|
|
5
|
+
{
|
|
6
|
+
"text-sm": props.size == null || props.size == "normal",
|
|
7
|
+
"text-lg": props.size == "large",
|
|
8
|
+
"text-xl": props.size == "xlarge",
|
|
9
|
+
},
|
|
10
|
+
|
|
11
|
+
// Alignments
|
|
12
|
+
"inline-flex items-center justify-center",
|
|
13
|
+
"shrink-0",
|
|
14
|
+
"relative",
|
|
15
|
+
|
|
16
|
+
// Sizes
|
|
17
|
+
{
|
|
18
|
+
"h-8 w-8": props.size == null || props.size == "normal",
|
|
19
|
+
"w-12 h-12": props.size == "large",
|
|
20
|
+
"w-16 h-16": props.size == "xlarge",
|
|
21
|
+
},
|
|
22
|
+
{ "-ml-4": parent.instance.$style?.name == "avatargroup" },
|
|
23
|
+
|
|
24
|
+
// Shapes
|
|
25
|
+
{
|
|
26
|
+
"rounded-lg": props.shape == "square",
|
|
27
|
+
"rounded-full": props.shape == "circle",
|
|
28
|
+
},
|
|
29
|
+
{ "border-2": parent.instance.$style?.name == "avatargroup" },
|
|
30
|
+
|
|
31
|
+
// Colors
|
|
32
|
+
"bg-surface-100 dark:bg-surface-700",
|
|
33
|
+
{
|
|
34
|
+
"border-white dark:border-surface-800":
|
|
35
|
+
parent.instance.$style?.name == "avatargroup",
|
|
36
|
+
},
|
|
37
|
+
],
|
|
38
|
+
}),
|
|
39
|
+
image: ({ props }) => ({
|
|
40
|
+
class: [
|
|
41
|
+
"h-full w-full",
|
|
42
|
+
{
|
|
43
|
+
"rounded-lg": props.shape == "square",
|
|
44
|
+
"rounded-full": props.shape == "circle",
|
|
45
|
+
},
|
|
46
|
+
],
|
|
47
|
+
}),
|
|
48
|
+
};
|