orio-ui 0.1.1 → 1.0.2
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/README.md +9 -7
- package/dist/module.cjs +5 -0
- package/dist/module.d.mts +3 -0
- package/dist/module.d.ts +3 -0
- package/dist/module.json +12 -0
- package/dist/module.mjs +24 -0
- package/dist/runtime/assets/css/animation.css +1 -0
- package/dist/runtime/assets/css/colors.css +1 -0
- package/{src/runtime/assets/css/cool-gradient-hover.scss → dist/runtime/assets/css/cool-gradient-hover.css} +4 -14
- package/dist/runtime/assets/css/main.css +1 -0
- package/dist/runtime/assets/css/scroll.css +1 -0
- package/{src → dist}/runtime/components/Button.vue +38 -46
- package/dist/runtime/components/CheckBox.vue +93 -0
- package/{src → dist}/runtime/components/ControlElement.vue +15 -18
- package/{src → dist}/runtime/components/DashedContainer.vue +7 -13
- package/dist/runtime/components/DatePicker.vue +30 -0
- package/{src → dist}/runtime/components/DateRangePicker.vue +14 -15
- package/{src → dist}/runtime/components/EmptyState.vue +22 -28
- package/{src → dist}/runtime/components/Icon.vue +12 -23
- package/dist/runtime/components/Input.vue +43 -0
- package/{src → dist}/runtime/components/Modal.vue +2 -44
- package/{src → dist}/runtime/components/Popover.vue +9 -2
- package/{src → dist}/runtime/components/Selector.vue +58 -58
- package/dist/runtime/components/Tag.vue +21 -0
- package/{src → dist}/runtime/components/Textarea.vue +19 -30
- package/{src → dist}/runtime/components/view/Dates.vue +1 -3
- package/{src → dist}/runtime/components/view/Separator.vue +1 -5
- package/{src → dist}/runtime/components/view/Text.vue +38 -42
- package/dist/runtime/composables/index.d.ts +4 -0
- package/dist/runtime/composables/index.js +6 -0
- package/dist/runtime/composables/useApi.d.ts +10 -0
- package/dist/runtime/composables/useApi.js +9 -0
- package/dist/runtime/composables/useFuzzySearch.d.ts +10 -0
- package/dist/runtime/composables/useFuzzySearch.js +22 -0
- package/dist/runtime/composables/useModal.d.ts +15 -0
- package/dist/runtime/composables/useModal.js +28 -0
- package/dist/runtime/composables/useTheme.d.ts +6 -0
- package/dist/runtime/composables/useTheme.js +23 -0
- package/dist/runtime/index.d.ts +20 -0
- package/dist/runtime/index.js +20 -0
- package/dist/runtime/utils/icon-registry.d.ts +2 -0
- package/{src/runtime/utils/icon-registry.ts → dist/runtime/utils/icon-registry.js} +14 -29
- package/dist/types.d.mts +7 -0
- package/dist/types.d.ts +7 -0
- package/package.json +12 -16
- package/nuxt.config.ts +0 -38
- package/src/module.ts +0 -16
- package/src/runtime/assets/css/animation.css +0 -88
- package/src/runtime/assets/css/colors.css +0 -142
- package/src/runtime/assets/css/main.css +0 -11
- package/src/runtime/assets/css/scroll.css +0 -46
- package/src/runtime/components/CheckBox.vue +0 -103
- package/src/runtime/components/DatePicker.vue +0 -84
- package/src/runtime/components/Input.vue +0 -54
- package/src/runtime/components/Tag.vue +0 -45
- package/src/runtime/composables/index.ts +0 -4
- package/src/runtime/composables/useApi.ts +0 -26
- package/src/runtime/composables/useFuzzySearch.ts +0 -51
- package/src/runtime/composables/useModal.ts +0 -47
- package/src/runtime/composables/useTheme.ts +0 -31
- package/src/runtime/index.ts +0 -25
- /package/{src → dist}/runtime/components/LoadingSpinner.vue +0 -0
|
@@ -13,7 +13,7 @@ const props = defineProps<{
|
|
|
13
13
|
origin: OriginRect | null;
|
|
14
14
|
}>();
|
|
15
15
|
|
|
16
|
-
const show = defineModel<
|
|
16
|
+
const show = defineModel<boolean>('show');
|
|
17
17
|
|
|
18
18
|
const wrapper = ref<HTMLDivElement | null>(null);
|
|
19
19
|
|
|
@@ -65,47 +65,5 @@ watch(show, (open) => {
|
|
|
65
65
|
</template>
|
|
66
66
|
|
|
67
67
|
<style scoped>
|
|
68
|
-
.overlay {
|
|
69
|
-
position: fixed;
|
|
70
|
-
inset: 0;
|
|
71
|
-
background: rgba(0, 0, 0, 0.45);
|
|
72
|
-
backdrop-filter: blur(6px);
|
|
73
|
-
|
|
74
|
-
display: flex;
|
|
75
|
-
justify-content: center;
|
|
76
|
-
align-items: center;
|
|
77
|
-
|
|
78
|
-
transition: opacity 0.25s ease;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
.modal {
|
|
82
|
-
position: absolute;
|
|
83
|
-
|
|
84
|
-
width: 380px;
|
|
85
|
-
max-width: 90vw;
|
|
86
|
-
max-height: 90vh;
|
|
87
|
-
|
|
88
|
-
background: white;
|
|
89
|
-
border-radius: 1rem;
|
|
90
|
-
padding: 24px;
|
|
91
|
-
|
|
92
|
-
transform-origin: top left;
|
|
93
|
-
box-shadow: 0 25px 60px rgba(0, 0, 0, 0.25);
|
|
94
|
-
|
|
95
|
-
transition:
|
|
96
|
-
transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1),
|
|
97
|
-
opacity 0.3s ease;
|
|
98
|
-
|
|
99
|
-
color: var(--color-muted);
|
|
100
|
-
opacity: 0;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
.overlay-fade-enter-from,
|
|
104
|
-
.overlay-fade-leave-to {
|
|
105
|
-
opacity: 0;
|
|
106
|
-
}
|
|
107
|
-
.overlay-fade-enter-active,
|
|
108
|
-
.overlay-fade-leave-active {
|
|
109
|
-
transition: opacity 0.25s ease;
|
|
110
|
-
}
|
|
68
|
+
.overlay{align-items:center;backdrop-filter:blur(6px);background:rgba(0,0,0,.45);display:flex;inset:0;justify-content:center;position:fixed;transition:opacity .25s ease}.modal{background:#fff;border-radius:1rem;box-shadow:0 25px 60px rgba(0,0,0,.25);color:var(--color-muted);max-height:90vh;max-width:90vw;padding:24px;position:absolute;transform-origin:top left;transition:transform .35s cubic-bezier(.2,.8,.2,1),opacity .3s ease;width:380px}.modal,.overlay-fade-enter-from,.overlay-fade-leave-to{opacity:0}.overlay-fade-enter-active,.overlay-fade-leave-active{transition:opacity .25s ease}
|
|
111
69
|
</style>
|
|
@@ -20,7 +20,14 @@
|
|
|
20
20
|
</template>
|
|
21
21
|
|
|
22
22
|
<script setup lang="ts">
|
|
23
|
-
import {
|
|
23
|
+
import {
|
|
24
|
+
ref,
|
|
25
|
+
computed,
|
|
26
|
+
nextTick,
|
|
27
|
+
onMounted,
|
|
28
|
+
onBeforeUnmount,
|
|
29
|
+
watch,
|
|
30
|
+
} from 'vue';
|
|
24
31
|
import { useElementBounding } from '@vueuse/core';
|
|
25
32
|
|
|
26
33
|
const props = defineProps({
|
|
@@ -239,7 +246,7 @@ onBeforeUnmount(() => {
|
|
|
239
246
|
window.removeEventListener('resize', redrawPopover, true);
|
|
240
247
|
});
|
|
241
248
|
</script>
|
|
242
|
-
<style
|
|
249
|
+
<style scoped>
|
|
243
250
|
.popover {
|
|
244
251
|
border: 0;
|
|
245
252
|
background-color: transparent;
|
|
@@ -18,7 +18,9 @@ const props = withDefaults(defineProps<SelectProps>(), {
|
|
|
18
18
|
|
|
19
19
|
const { field, optionName, placeholder } = toRefs(props);
|
|
20
20
|
|
|
21
|
-
const modelValue = defineModel<
|
|
21
|
+
const modelValue = defineModel<
|
|
22
|
+
SelectableOption | SelectableOption[] | null | undefined
|
|
23
|
+
>({
|
|
22
24
|
required: true,
|
|
23
25
|
});
|
|
24
26
|
|
|
@@ -33,7 +35,7 @@ const flatModalValue = computed(() => {
|
|
|
33
35
|
? modelValue.value
|
|
34
36
|
: (modelValue.value as T)[key.value];
|
|
35
37
|
return modelValue.value.map((option) =>
|
|
36
|
-
typeof option === 'string' ? option : (option as T)[key.value]
|
|
38
|
+
typeof option === 'string' ? option : (option as T)[key.value],
|
|
37
39
|
);
|
|
38
40
|
});
|
|
39
41
|
|
|
@@ -41,7 +43,9 @@ function toggleOption(option: SelectableOption, toggle: () => void) {
|
|
|
41
43
|
if (props.multiple) {
|
|
42
44
|
if (Array.isArray(modelValue.value)) {
|
|
43
45
|
const index = modelValue.value.findIndex((opt) =>
|
|
44
|
-
typeof option === 'string'
|
|
46
|
+
typeof option === 'string'
|
|
47
|
+
? option === opt
|
|
48
|
+
: opt[key.value] === (option as T)[key.value],
|
|
45
49
|
);
|
|
46
50
|
if (index > -1) {
|
|
47
51
|
modelValue.value.splice(index, 1);
|
|
@@ -63,7 +67,9 @@ function isOptionSelected(option: SelectableOption): boolean {
|
|
|
63
67
|
return !!(
|
|
64
68
|
flatModalValue.value &&
|
|
65
69
|
(flatModalValue.value === (option as T)[key.value] ||
|
|
66
|
-
(flatModalValue.value as string[]).includes(
|
|
70
|
+
(flatModalValue.value as string[]).includes(
|
|
71
|
+
(option as T)[key.value] as string,
|
|
72
|
+
))
|
|
67
73
|
);
|
|
68
74
|
}
|
|
69
75
|
|
|
@@ -88,9 +94,19 @@ const selectorAttrs = computed(() => ({ getOptionKey, getOptionLabel }));
|
|
|
88
94
|
<template #default="{ toggle }">
|
|
89
95
|
<slot name="trigger" :toggle>
|
|
90
96
|
<div class="selector-trigger">
|
|
91
|
-
<slot
|
|
97
|
+
<slot
|
|
98
|
+
name="trigger-content"
|
|
99
|
+
:toggle
|
|
100
|
+
v-bind="selectorAttrs"
|
|
101
|
+
:attrs="$attrs"
|
|
102
|
+
>
|
|
92
103
|
<div class="trigger-content">
|
|
93
|
-
<slot
|
|
104
|
+
<slot
|
|
105
|
+
name="trigger-label"
|
|
106
|
+
:toggle
|
|
107
|
+
v-bind="selectorAttrs"
|
|
108
|
+
:attrs="$attrs"
|
|
109
|
+
>
|
|
94
110
|
<template v-if="!props.multiple">
|
|
95
111
|
{{ getOptionLabel(modelValue as T) }}
|
|
96
112
|
</template>
|
|
@@ -135,7 +151,7 @@ const selectorAttrs = computed(() => ({ getOptionKey, getOptionLabel }));
|
|
|
135
151
|
</orio-control-element>
|
|
136
152
|
</template>
|
|
137
153
|
|
|
138
|
-
<style
|
|
154
|
+
<style scoped>
|
|
139
155
|
.selector-trigger {
|
|
140
156
|
z-index: 1;
|
|
141
157
|
min-height: 1.5rem;
|
|
@@ -144,74 +160,58 @@ const selectorAttrs = computed(() => ({ getOptionKey, getOptionLabel }));
|
|
|
144
160
|
align-items: center;
|
|
145
161
|
justify-content: space-between;
|
|
146
162
|
cursor: pointer;
|
|
147
|
-
|
|
148
163
|
background: var(--color-bg);
|
|
149
164
|
border: 1px solid var(--color-border);
|
|
150
165
|
border-radius: 6px;
|
|
151
166
|
padding: 0.5rem 0.75rem;
|
|
152
167
|
font-size: 0.95rem;
|
|
153
168
|
color: var(--color-text);
|
|
154
|
-
transition:
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
color: var(--color-muted);
|
|
171
|
-
transition: color 0.2s ease;
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
&:hover .icon {
|
|
175
|
-
color: var(--color-accent);
|
|
176
|
-
}
|
|
169
|
+
transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
|
|
170
|
+
}
|
|
171
|
+
.selector-trigger:hover {
|
|
172
|
+
border-color: var(--color-accent);
|
|
173
|
+
background-color: var(--color-surface); /* subtle lift */
|
|
174
|
+
}
|
|
175
|
+
.selector-trigger:focus-within {
|
|
176
|
+
border-color: var(--color-accent);
|
|
177
|
+
box-shadow: 0 0 0 2px var(--color-surface);
|
|
178
|
+
}
|
|
179
|
+
.selector-trigger .icon {
|
|
180
|
+
color: var(--color-muted);
|
|
181
|
+
transition: color 0.2s ease;
|
|
182
|
+
}
|
|
183
|
+
.selector-trigger:hover .icon {
|
|
184
|
+
color: var(--color-accent);
|
|
177
185
|
}
|
|
178
186
|
|
|
179
187
|
.selector-content {
|
|
180
188
|
min-width: 15rem;
|
|
181
189
|
max-height: 20rem;
|
|
182
190
|
overflow: auto;
|
|
183
|
-
|
|
184
191
|
background: var(--color-bg);
|
|
185
192
|
border: 1px solid var(--color-border);
|
|
186
193
|
border-radius: 6px;
|
|
187
194
|
margin-top: 0.25rem;
|
|
188
195
|
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
&.selected {
|
|
209
|
-
background-color: var(--color-accent);
|
|
210
|
-
color: var(--color-accent-soft);
|
|
211
|
-
font-weight: 500;
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
}
|
|
196
|
+
}
|
|
197
|
+
.selector-content ul {
|
|
198
|
+
list-style: none;
|
|
199
|
+
padding: 0;
|
|
200
|
+
margin: 0;
|
|
201
|
+
}
|
|
202
|
+
.selector-content ul li {
|
|
203
|
+
padding: 0.5rem 0.75rem;
|
|
204
|
+
cursor: pointer;
|
|
205
|
+
transition: background-color 0.15s ease, color 0.15s ease;
|
|
206
|
+
color: var(--color-text);
|
|
207
|
+
}
|
|
208
|
+
.selector-content ul li:hover {
|
|
209
|
+
background-color: var(--color-surface); /* neutral lift */
|
|
210
|
+
}
|
|
211
|
+
.selector-content ul li.selected {
|
|
212
|
+
background-color: var(--color-accent);
|
|
213
|
+
color: var(--color-accent-soft);
|
|
214
|
+
font-weight: 500;
|
|
215
215
|
}
|
|
216
216
|
|
|
217
217
|
.trigger-content {
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
export type TagStyle = 'neutral' | 'accent';
|
|
3
|
+
|
|
4
|
+
interface Props {
|
|
5
|
+
text: string;
|
|
6
|
+
variant?: TagStyle;
|
|
7
|
+
}
|
|
8
|
+
withDefaults(defineProps<Props>(), {
|
|
9
|
+
variant: 'neutral',
|
|
10
|
+
});
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<template>
|
|
14
|
+
<span class="tag" :class="`tag--${variant}`">
|
|
15
|
+
{{ text }}
|
|
16
|
+
</span>
|
|
17
|
+
</template>
|
|
18
|
+
|
|
19
|
+
<style scoped>
|
|
20
|
+
.tag{border:1px solid transparent;border-radius:1rem;display:inline-block;font-size:.8rem;font-weight:500;line-height:1;max-height:1rem;padding:.25rem .6rem;-webkit-user-select:none;-moz-user-select:none;user-select:none}.tag--neutral{background-color:var(--color-surface);border-color:color-mix(in srgb,var(--color-border) 80%,var(--color-accent) 20%);color:var(--color-muted)}.tag--accent{background-color:var(--color-accent-soft);border-color:var(--color-accent-border);color:var(--color-accent)}
|
|
21
|
+
</style>
|
|
@@ -11,16 +11,11 @@ const modelValue = defineModel<string>({ default: '' });
|
|
|
11
11
|
|
|
12
12
|
<template>
|
|
13
13
|
<orio-control-element v-bind="attrs">
|
|
14
|
-
<textarea
|
|
15
|
-
v-bind="attrs"
|
|
16
|
-
v-model="modelValue"
|
|
17
|
-
rows="4"
|
|
18
|
-
class="textarea"
|
|
19
|
-
/>
|
|
14
|
+
<textarea v-bind="attrs" v-model="modelValue" rows="4" class="textarea" />
|
|
20
15
|
</orio-control-element>
|
|
21
16
|
</template>
|
|
22
17
|
|
|
23
|
-
<style
|
|
18
|
+
<style scoped>
|
|
24
19
|
.textarea {
|
|
25
20
|
width: 100%;
|
|
26
21
|
padding: 0.5rem 0.75rem;
|
|
@@ -32,28 +27,22 @@ const modelValue = defineModel<string>({ default: '' });
|
|
|
32
27
|
background-color: var(--color-bg);
|
|
33
28
|
box-sizing: border-box;
|
|
34
29
|
resize: vertical; /* Let user resize vertically only */
|
|
35
|
-
transition:
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
&:disabled {
|
|
54
|
-
background-color: var(--color-surface);
|
|
55
|
-
color: var(--color-muted);
|
|
56
|
-
cursor: not-allowed;
|
|
57
|
-
}
|
|
30
|
+
transition: border-color 0.2s ease, box-shadow 0.2s ease;
|
|
31
|
+
}
|
|
32
|
+
.textarea::placeholder {
|
|
33
|
+
color: var(--color-muted);
|
|
34
|
+
}
|
|
35
|
+
.textarea:hover {
|
|
36
|
+
border-color: var(--color-accent);
|
|
37
|
+
}
|
|
38
|
+
.textarea:focus {
|
|
39
|
+
border-color: var(--color-accent);
|
|
40
|
+
box-shadow: 0 0 0 2px var(--color-accent-soft);
|
|
41
|
+
outline: none;
|
|
42
|
+
}
|
|
43
|
+
.textarea:disabled {
|
|
44
|
+
background-color: var(--color-surface);
|
|
45
|
+
color: var(--color-muted);
|
|
46
|
+
cursor: not-allowed;
|
|
58
47
|
}
|
|
59
48
|
</style>
|
|
@@ -22,9 +22,5 @@ const margin = computed(() => `${props.margin}rem`);
|
|
|
22
22
|
</template>
|
|
23
23
|
|
|
24
24
|
<style scoped>
|
|
25
|
-
div
|
|
26
|
-
width: 100%;
|
|
27
|
-
border-block-end: v-bind(sizePx) v-bind(style) var(--color-border);
|
|
28
|
-
margin-block: v-bind(margin);
|
|
29
|
-
}
|
|
25
|
+
div{border-block-end:v-bind(sizePx) v-bind(style) var(--color-border);margin-block:v-bind(margin);width:100%}
|
|
30
26
|
</style>
|
|
@@ -32,52 +32,48 @@ const clampLines = computed(() => Number(props.lineClamp ?? 1));
|
|
|
32
32
|
</div>
|
|
33
33
|
</template>
|
|
34
34
|
|
|
35
|
-
<style
|
|
35
|
+
<style scoped>
|
|
36
36
|
div {
|
|
37
37
|
white-space: pre-wrap;
|
|
38
38
|
display: flex;
|
|
39
39
|
align-items: center;
|
|
40
40
|
gap: 0.25rem;
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
}
|
|
79
|
-
&.extra-large {
|
|
80
|
-
font-size: 1.75rem;
|
|
81
|
-
}
|
|
41
|
+
}
|
|
42
|
+
div.clamp {
|
|
43
|
+
display: -webkit-box;
|
|
44
|
+
overflow: hidden;
|
|
45
|
+
line-clamp: v-bind(clampLines);
|
|
46
|
+
-webkit-line-clamp: v-bind(clampLines);
|
|
47
|
+
-webkit-box-orient: vertical;
|
|
48
|
+
}
|
|
49
|
+
div.uppercase {
|
|
50
|
+
text-transform: uppercase;
|
|
51
|
+
}
|
|
52
|
+
div.text {
|
|
53
|
+
color: var(--color-text);
|
|
54
|
+
}
|
|
55
|
+
div.title {
|
|
56
|
+
font-weight: bold;
|
|
57
|
+
color: var(--color-text);
|
|
58
|
+
}
|
|
59
|
+
div.subtitle {
|
|
60
|
+
font-weight: semi-bold;
|
|
61
|
+
color: var(--color-muted);
|
|
62
|
+
}
|
|
63
|
+
div.italics {
|
|
64
|
+
font-style: italic;
|
|
65
|
+
color: var(--color-muted);
|
|
66
|
+
}
|
|
67
|
+
div.small {
|
|
68
|
+
font-size: 0.75rem;
|
|
69
|
+
}
|
|
70
|
+
div.medium {
|
|
71
|
+
font-size: 0.875rem;
|
|
72
|
+
}
|
|
73
|
+
div.large {
|
|
74
|
+
font-size: 1.25rem;
|
|
75
|
+
}
|
|
76
|
+
div.extra-large {
|
|
77
|
+
font-size: 1.75rem;
|
|
82
78
|
}
|
|
83
79
|
</style>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type RequestBody = Record<string, unknown>;
|
|
2
|
+
export type RequestMethod = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH';
|
|
3
|
+
export interface ApiOptions {
|
|
4
|
+
method?: RequestMethod;
|
|
5
|
+
body?: RequestBody;
|
|
6
|
+
signal?: AbortSignal;
|
|
7
|
+
query?: Record<string, unknown>;
|
|
8
|
+
}
|
|
9
|
+
export declare function useApi<T = unknown>(url: string): Promise<T>;
|
|
10
|
+
export declare function useApi<T = unknown>(url: string, options: ApiOptions): Promise<T>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type MaybeRef } from 'vue';
|
|
2
|
+
import { useFuse, type FuseOptions } from '@vueuse/integrations/useFuse';
|
|
3
|
+
/**
|
|
4
|
+
* Search using Fuse.js fuzzy search
|
|
5
|
+
* @param dataSource - Array of strings or objects to search
|
|
6
|
+
* @param search - Search query string
|
|
7
|
+
* @param options - Fuse.js options (e.g., { keys: ['name'] })
|
|
8
|
+
*/
|
|
9
|
+
export declare function useFuzzySearch(dataSource: MaybeRef<string[]>, search: MaybeRef<string>): ReturnType<typeof useFuse>;
|
|
10
|
+
export declare function useFuzzySearch<T extends object>(dataSource: MaybeRef<T[]>, search: MaybeRef<string>, options: FuseOptions<T>): ReturnType<typeof useFuse>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { computed, unref } from "vue";
|
|
2
|
+
import { useFuse } from "@vueuse/integrations/useFuse";
|
|
3
|
+
export function useFuzzySearch(dataSource, search, options) {
|
|
4
|
+
const isObjectArray = !!options;
|
|
5
|
+
if (!isObjectArray) {
|
|
6
|
+
const wrappedData = computed(() => {
|
|
7
|
+
const data = unref(dataSource);
|
|
8
|
+
return data.map((str) => ({ value: str }));
|
|
9
|
+
});
|
|
10
|
+
const { results } = useFuse(search, wrappedData, {
|
|
11
|
+
fuseOptions: { keys: ["value"] },
|
|
12
|
+
matchAllWhenSearchEmpty: true
|
|
13
|
+
});
|
|
14
|
+
return computed(() => results.value.map(({ item }) => item.value));
|
|
15
|
+
} else {
|
|
16
|
+
const { results } = useFuse(search, dataSource, {
|
|
17
|
+
fuseOptions: options,
|
|
18
|
+
matchAllWhenSearchEmpty: true
|
|
19
|
+
});
|
|
20
|
+
return computed(() => results.value.map(({ item }) => item));
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface OriginRect {
|
|
2
|
+
x: number;
|
|
3
|
+
y: number;
|
|
4
|
+
width: number;
|
|
5
|
+
height: number;
|
|
6
|
+
}
|
|
7
|
+
export interface ModalProps {
|
|
8
|
+
show: boolean;
|
|
9
|
+
origin: OriginRect | null;
|
|
10
|
+
'onUpdate:show': (state: boolean) => void;
|
|
11
|
+
}
|
|
12
|
+
export declare function useModal(): {
|
|
13
|
+
modalProps: import("vue").Ref<any, any>;
|
|
14
|
+
openModal: (event?: MouseEvent) => void;
|
|
15
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ref } from "vue";
|
|
2
|
+
export function useModal() {
|
|
3
|
+
const modalProps = ref({
|
|
4
|
+
show: false,
|
|
5
|
+
origin: null,
|
|
6
|
+
"onUpdate:show": (state) => updateShow(state)
|
|
7
|
+
});
|
|
8
|
+
function updateShow(state) {
|
|
9
|
+
modalProps.value.show = state;
|
|
10
|
+
}
|
|
11
|
+
function openModal(event) {
|
|
12
|
+
modalProps.value.origin = null;
|
|
13
|
+
if (!event) {
|
|
14
|
+
modalProps.value.show = true;
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
const target = event.target;
|
|
18
|
+
const rect = target.getBoundingClientRect();
|
|
19
|
+
modalProps.value.origin = {
|
|
20
|
+
x: rect.left,
|
|
21
|
+
y: rect.top,
|
|
22
|
+
width: rect.width,
|
|
23
|
+
height: rect.height
|
|
24
|
+
};
|
|
25
|
+
modalProps.value.show = true;
|
|
26
|
+
}
|
|
27
|
+
return { modalProps, openModal };
|
|
28
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { onMounted } from "vue";
|
|
2
|
+
import { useLocalStorage } from "@vueuse/core";
|
|
3
|
+
export function useTheme() {
|
|
4
|
+
const theme = useLocalStorage("orio-theme", "navy");
|
|
5
|
+
const mode = useLocalStorage("orio-mode", "dark");
|
|
6
|
+
function setTheme(name) {
|
|
7
|
+
theme.value = name;
|
|
8
|
+
if (typeof document !== "undefined") {
|
|
9
|
+
document.documentElement.setAttribute("data-theme", name);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
function setMode(name) {
|
|
13
|
+
mode.value = name;
|
|
14
|
+
if (typeof document !== "undefined") {
|
|
15
|
+
document.documentElement.setAttribute("data-mode", name);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
onMounted(() => {
|
|
19
|
+
setTheme(theme.value);
|
|
20
|
+
setMode(mode.value);
|
|
21
|
+
});
|
|
22
|
+
return { theme, setTheme, mode, setMode };
|
|
23
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export { default as Button } from './components/Button.vue.js';
|
|
2
|
+
export { default as Input } from './components/Input.vue.js';
|
|
3
|
+
export { default as Textarea } from './components/Textarea.vue.js';
|
|
4
|
+
export { default as CheckBox } from './components/CheckBox.vue.js';
|
|
5
|
+
export { default as DatePicker } from './components/DatePicker.vue.js';
|
|
6
|
+
export { default as DateRangePicker } from './components/DateRangePicker.vue.js';
|
|
7
|
+
export { default as Selector } from './components/Selector.vue.js';
|
|
8
|
+
export { default as Tag } from './components/Tag.vue.js';
|
|
9
|
+
export { default as Icon } from './components/Icon.vue.js';
|
|
10
|
+
export { default as LoadingSpinner } from './components/LoadingSpinner.vue.js';
|
|
11
|
+
export { default as Modal } from './components/Modal.vue.js';
|
|
12
|
+
export { default as Popover } from './components/Popover.vue.js';
|
|
13
|
+
export { default as EmptyState } from './components/EmptyState.vue.js';
|
|
14
|
+
export { default as DashedContainer } from './components/DashedContainer.vue.js';
|
|
15
|
+
export { default as ControlElement } from './components/ControlElement.vue.js';
|
|
16
|
+
export { default as ViewText } from './components/view/Text.vue.js';
|
|
17
|
+
export { default as ViewDates } from './components/view/Dates.vue.js';
|
|
18
|
+
export { default as ViewSeparator } from './components/view/Separator.vue.js';
|
|
19
|
+
export * from './composables/index.js';
|
|
20
|
+
export { iconRegistry, type IconName } from './utils/icon-registry.js';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export { default as Button } from "./components/Button.vue";
|
|
2
|
+
export { default as Input } from "./components/Input.vue";
|
|
3
|
+
export { default as Textarea } from "./components/Textarea.vue";
|
|
4
|
+
export { default as CheckBox } from "./components/CheckBox.vue";
|
|
5
|
+
export { default as DatePicker } from "./components/DatePicker.vue";
|
|
6
|
+
export { default as DateRangePicker } from "./components/DateRangePicker.vue";
|
|
7
|
+
export { default as Selector } from "./components/Selector.vue";
|
|
8
|
+
export { default as Tag } from "./components/Tag.vue";
|
|
9
|
+
export { default as Icon } from "./components/Icon.vue";
|
|
10
|
+
export { default as LoadingSpinner } from "./components/LoadingSpinner.vue";
|
|
11
|
+
export { default as Modal } from "./components/Modal.vue";
|
|
12
|
+
export { default as Popover } from "./components/Popover.vue";
|
|
13
|
+
export { default as EmptyState } from "./components/EmptyState.vue";
|
|
14
|
+
export { default as DashedContainer } from "./components/DashedContainer.vue";
|
|
15
|
+
export { default as ControlElement } from "./components/ControlElement.vue";
|
|
16
|
+
export { default as ViewText } from "./components/view/Text.vue";
|
|
17
|
+
export { default as ViewDates } from "./components/view/Dates.vue";
|
|
18
|
+
export { default as ViewSeparator } from "./components/view/Separator.vue";
|
|
19
|
+
export * from "./composables/index.js";
|
|
20
|
+
export { iconRegistry } from "./utils/icon-registry.js";
|