@unsource/ui 1.5.7 → 1.7.0

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/dist/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "unsource-ui",
3
3
  "configKey": "unsourceUi",
4
- "version": "1.5.7",
4
+ "version": "1.7.0",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "3.6.1"
package/dist/module.mjs CHANGED
@@ -22,21 +22,32 @@ const module = defineNuxtModule({
22
22
  await installModule("@unocss/nuxt", {
23
23
  configFile: "./runtime/uno.config.{mjs,js,ts}"
24
24
  });
25
- await installModule("@nuxt/icon");
26
- await installModule("nuxt-swiper");
27
- _nuxt.options.modules.push(
28
- "@unocss/nuxt",
29
- "@nuxt/icon",
30
- "nuxt-swiper"
31
- );
32
- _nuxt.options.icon = {
25
+ await installModule("@nuxt/icon", {
33
26
  customCollections: [
34
27
  {
35
28
  prefix: "my-icon",
36
29
  dir: "./assets/icons"
37
30
  }
38
31
  ]
39
- };
32
+ });
33
+ await installModule("nuxt-swiper");
34
+ await installModule("nuxt-lodash", {
35
+ prefix: "_",
36
+ // prefixSkip: ["is"],
37
+ upperAfterPrefix: false,
38
+ exclude: [],
39
+ alias: [
40
+ // ["camelCase", "stringToCamelCase"], // => stringToCamelCase
41
+ // ["kebabCase", "stringToKebab"], // => stringToKebab
42
+ // ["isDate", "isLodashDate"], // => _isLodashDate
43
+ ]
44
+ });
45
+ _nuxt.options.modules.push(
46
+ "@unocss/nuxt",
47
+ "@nuxt/icon",
48
+ "nuxt-swiper",
49
+ "nuxt-lodash"
50
+ );
40
51
  }
41
52
  });
42
53
 
@@ -1,15 +1,16 @@
1
- export type CardCustomClass = Record<'main' | 'inside' | 'logoName' | 'name' | 'desc' | 'body' | 'logo' | 'slider' | 'sliderWrapper' | 'sliderSlides' | 'title' | 'titleText' | 'tags' | 'tag' | 'description' | 'footer' | 'imagesItem' | 'image' | 'avatar', string>;
1
+ export type CardCustomClass = Partial<Record<'main' | 'inside' | 'logoName' | 'name' | 'desc' | 'body' | 'logo' | 'slider' | 'sliderWrapper' | 'sliderSlides' | 'title' | 'titleText' | 'tags' | 'tag' | 'description' | 'footer' | 'imagesItem' | 'image' | 'avatar', string>>;
2
+ export type TagItem = {
3
+ value?: string;
4
+ icon?: string;
5
+ variant?: string;
6
+ };
2
7
  export type CardItem = {
3
8
  title?: string;
4
9
  description?: string;
5
10
  image?: string;
6
11
  avatar?: string;
7
12
  images?: string[];
8
- tags?: {
9
- value?: string;
10
- icon?: string;
11
- variant?: string;
12
- }[];
13
+ tags?: TagItem[];
13
14
  };
14
15
  type __VLS_Props = {
15
16
  direction?: 'column' | 'row' | 'row-reverse' | 'column-reverse';
@@ -63,8 +63,8 @@
63
63
  :class="customClass.inside"
64
64
  >
65
65
  <div
66
- name="logoName"
67
66
  v-if="item.logo || item.name || item.desc"
67
+ name="logoName"
68
68
  class="flex gap-2 items-center"
69
69
  :class="customClass.logoName"
70
70
  >
@@ -75,22 +75,22 @@
75
75
  class="!object-cover shrink-0 w-14 h-14 aspect-square rounded-full border-(2 solid primary-500)"
76
76
  />
77
77
  <div
78
- name="nameDesc"
79
78
  v-if="item.name || item.desc"
79
+ name="nameDesc"
80
80
  :class="customClass.nameDesc"
81
81
  class="flex flex-col"
82
82
  >
83
83
  <h3
84
- name="name"
85
84
  v-if="item.name"
85
+ name="name"
86
86
  :class="customClass.name"
87
- class="text-(lg gray-600) font-medium"
87
+ class="text-(lg gray-600) font-semibold"
88
88
  >
89
89
  {{ item.name }}
90
90
  </h3>
91
91
  <p
92
- name="desc"
93
92
  v-if="item.desc"
93
+ name="desc"
94
94
  :class="customClass.desc"
95
95
  class="text-(base gray-500)"
96
96
  >
@@ -103,16 +103,16 @@
103
103
  :item="item"
104
104
  />
105
105
  <div
106
- name="title"
107
106
  v-if="$slots.title || item.title"
107
+ name="title"
108
108
  class="flex justify-between"
109
109
  :class="customClass.title"
110
110
  >
111
111
  <h3
112
- name="titleText"
113
112
  v-if="item.title"
113
+ name="titleText"
114
114
  :class="customClass.titleText"
115
- class="text-(lg gray-600) font-medium"
115
+ class="text-(lg gray-600) font-semibold"
116
116
  >
117
117
  {{ item.title }}
118
118
  </h3>
@@ -122,23 +122,23 @@
122
122
  />
123
123
  </div>
124
124
  <p
125
- name="description"
126
125
  v-if="item.description"
126
+ name="description"
127
127
  :class="customClass.description"
128
128
  class="text-(base gray-500)"
129
129
  >
130
130
  {{ item.description }}
131
131
  </p>
132
132
  <div
133
- name="tags"
134
133
  v-if="item.tags?.length"
134
+ name="tags"
135
135
  :class="customClass.tags"
136
136
  class="flex items-center justify-start gap-2"
137
137
  >
138
138
  <UnChips
139
- name="tag"
140
139
  v-for="(tag, index) in item.tags"
141
140
  :key="index"
141
+ name="tag"
142
142
  :class="customClass.tag"
143
143
  :label="tag.value"
144
144
  :icon="tag.icon"
@@ -158,8 +158,8 @@
158
158
  />
159
159
  </div>
160
160
  <div
161
- name="footer"
162
161
  v-if="$slots.footerStart || $slots.footerEnd"
162
+ name="footer"
163
163
  :class="customClass.footer"
164
164
  class="flex justify-between items-stretch border-t-(2 dashed border) p-3"
165
165
  >
@@ -1,15 +1,16 @@
1
- export type CardCustomClass = Record<'main' | 'inside' | 'logoName' | 'name' | 'desc' | 'body' | 'logo' | 'slider' | 'sliderWrapper' | 'sliderSlides' | 'title' | 'titleText' | 'tags' | 'tag' | 'description' | 'footer' | 'imagesItem' | 'image' | 'avatar', string>;
1
+ export type CardCustomClass = Partial<Record<'main' | 'inside' | 'logoName' | 'name' | 'desc' | 'body' | 'logo' | 'slider' | 'sliderWrapper' | 'sliderSlides' | 'title' | 'titleText' | 'tags' | 'tag' | 'description' | 'footer' | 'imagesItem' | 'image' | 'avatar', string>>;
2
+ export type TagItem = {
3
+ value?: string;
4
+ icon?: string;
5
+ variant?: string;
6
+ };
2
7
  export type CardItem = {
3
8
  title?: string;
4
9
  description?: string;
5
10
  image?: string;
6
11
  avatar?: string;
7
12
  images?: string[];
8
- tags?: {
9
- value?: string;
10
- icon?: string;
11
- variant?: string;
12
- }[];
13
+ tags?: TagItem[];
13
14
  };
14
15
  type __VLS_Props = {
15
16
  direction?: 'column' | 'row' | 'row-reverse' | 'column-reverse';
@@ -0,0 +1,34 @@
1
+ import type { CardCustomClass, CardItem, TagItem } from './UnCard.vue.js';
2
+ type __VLS_Props = {
3
+ title?: string;
4
+ description?: string;
5
+ icon?: string;
6
+ tags?: TagItem[];
7
+ items?: CardItem[];
8
+ customClass?: Partial<Record<'card' | 'collapsibleIcon', unknown> & {
9
+ cardInside?: CardCustomClass;
10
+ }>;
11
+ collapsibleIcon?: string;
12
+ noRotate?: boolean;
13
+ };
14
+ type __VLS_ModelProps = {
15
+ 'show'?: boolean;
16
+ };
17
+ type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
18
+ declare var __VLS_11: {};
19
+ type __VLS_Slots = {} & {
20
+ default?: (props: typeof __VLS_11) => any;
21
+ };
22
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
23
+ "update:show": (value: boolean | undefined) => any;
24
+ }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
25
+ "onUpdate:show"?: ((value: boolean | undefined) => any) | undefined;
26
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
27
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
28
+ declare const _default: typeof __VLS_export;
29
+ export default _default;
30
+ type __VLS_WithSlots<T, S> = T & {
31
+ new (): {
32
+ $slots: S;
33
+ };
34
+ };
@@ -0,0 +1,40 @@
1
+ <template>
2
+ <div
3
+ class="flex flex-col p-3 bg-white rounded-2xl gap-4"
4
+ >
5
+ <div
6
+ :class="customClass?.header"
7
+ class="cursor-pointer flex items-center justify-between"
8
+ @click="show = !show"
9
+ >
10
+ <UnCard
11
+ :item="{ avatar: icon, title, tags, description }"
12
+ :class="customClass.card"
13
+ :custom-class="customClass.cardInside"
14
+ />
15
+ <UnNuxtIcon
16
+ :class="customClass?.collapsibleIcon"
17
+ :name="collapsibleIcon || 'solar:alt-arrow-down-bold-duotone'"
18
+ class="transition-all duration-300"
19
+ :style="{ rotate: show && !noRotate ? '180deg' : '0deg' }"
20
+ />
21
+ </div>
22
+ <template v-if="show">
23
+ <slot />
24
+ </template>
25
+ </div>
26
+ </template>
27
+
28
+ <script setup>
29
+ const { customClass = {} } = defineProps({
30
+ title: { type: String, required: false },
31
+ description: { type: String, required: false },
32
+ icon: { type: String, required: false },
33
+ tags: { type: Array, required: false },
34
+ items: { type: Array, required: false },
35
+ customClass: { type: Object, required: false },
36
+ collapsibleIcon: { type: String, required: false },
37
+ noRotate: { type: Boolean, required: false }
38
+ });
39
+ const show = defineModel("show", { type: Boolean });
40
+ </script>
@@ -0,0 +1,34 @@
1
+ import type { CardCustomClass, CardItem, TagItem } from './UnCard.vue.js';
2
+ type __VLS_Props = {
3
+ title?: string;
4
+ description?: string;
5
+ icon?: string;
6
+ tags?: TagItem[];
7
+ items?: CardItem[];
8
+ customClass?: Partial<Record<'card' | 'collapsibleIcon', unknown> & {
9
+ cardInside?: CardCustomClass;
10
+ }>;
11
+ collapsibleIcon?: string;
12
+ noRotate?: boolean;
13
+ };
14
+ type __VLS_ModelProps = {
15
+ 'show'?: boolean;
16
+ };
17
+ type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
18
+ declare var __VLS_11: {};
19
+ type __VLS_Slots = {} & {
20
+ default?: (props: typeof __VLS_11) => any;
21
+ };
22
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
23
+ "update:show": (value: boolean | undefined) => any;
24
+ }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
25
+ "onUpdate:show"?: ((value: boolean | undefined) => any) | undefined;
26
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
27
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
28
+ declare const _default: typeof __VLS_export;
29
+ export default _default;
30
+ type __VLS_WithSlots<T, S> = T & {
31
+ new (): {
32
+ $slots: S;
33
+ };
34
+ };
@@ -2,15 +2,26 @@ import type { CardCustomClass, CardItem } from './UnCard.vue.js';
2
2
  type __VLS_Props = {
3
3
  title?: string;
4
4
  items?: CardItem[];
5
- customClass?: Record<'main' | 'title' | 'header' | 'items', unknown> & {
5
+ customClass?: Record<'title' | 'header' | 'items' | 'collapsibleIcon', unknown> & {
6
6
  item?: CardCustomClass;
7
7
  };
8
+ collapsible?: boolean;
9
+ collapsibleIcon?: string;
10
+ noRotate?: boolean;
8
11
  };
12
+ type __VLS_ModelProps = {
13
+ 'show'?: boolean;
14
+ };
15
+ type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
9
16
  declare var __VLS_1: {};
10
17
  type __VLS_Slots = {} & {
11
18
  default?: (props: typeof __VLS_1) => any;
12
19
  };
13
- declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
20
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
21
+ "update:show": (value: boolean | undefined) => any;
22
+ }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
23
+ "onUpdate:show"?: ((value: boolean | undefined) => any) | undefined;
24
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
14
25
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
15
26
  declare const _default: typeof __VLS_export;
16
27
  export default _default;
@@ -1,19 +1,19 @@
1
1
  <template>
2
2
  <div
3
- id="booking"
4
3
  class="flex flex-col p-3 bg-white rounded-2xl gap-4"
5
4
  >
6
5
  <div
6
+ v-if="title || $slots.default"
7
7
  :class="customClass?.header"
8
8
  class="flex items-center justify-between"
9
9
  >
10
- <p
10
+ <h3
11
11
  v-if="title"
12
12
  :class="customClass?.title"
13
13
  class="text-(lg gray-600) font-semibold"
14
14
  >
15
15
  {{ title }}
16
- </p>
16
+ </h3>
17
17
  <slot />
18
18
  </div>
19
19
  <UnCard
@@ -27,9 +27,14 @@
27
27
  </template>
28
28
 
29
29
  <script setup>
30
- const { customClass = {} } = defineProps({
30
+ const { customClass = {}, collapsible = false } = defineProps({
31
31
  title: { type: String, required: false },
32
32
  items: { type: Array, required: false },
33
- customClass: { type: Object, required: false }
33
+ customClass: { type: Object, required: false },
34
+ collapsible: { type: Boolean, required: false },
35
+ collapsibleIcon: { type: String, required: false },
36
+ noRotate: { type: Boolean, required: false }
34
37
  });
38
+ const show = defineModel("show", { type: Boolean });
39
+ show.value ||= !collapsible;
35
40
  </script>
@@ -2,15 +2,26 @@ import type { CardCustomClass, CardItem } from './UnCard.vue.js';
2
2
  type __VLS_Props = {
3
3
  title?: string;
4
4
  items?: CardItem[];
5
- customClass?: Record<'main' | 'title' | 'header' | 'items', unknown> & {
5
+ customClass?: Record<'title' | 'header' | 'items' | 'collapsibleIcon', unknown> & {
6
6
  item?: CardCustomClass;
7
7
  };
8
+ collapsible?: boolean;
9
+ collapsibleIcon?: string;
10
+ noRotate?: boolean;
8
11
  };
12
+ type __VLS_ModelProps = {
13
+ 'show'?: boolean;
14
+ };
15
+ type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
9
16
  declare var __VLS_1: {};
10
17
  type __VLS_Slots = {} & {
11
18
  default?: (props: typeof __VLS_1) => any;
12
19
  };
13
- declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
20
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
21
+ "update:show": (value: boolean | undefined) => any;
22
+ }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
23
+ "onUpdate:show"?: ((value: boolean | undefined) => any) | undefined;
24
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
14
25
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
15
26
  declare const _default: typeof __VLS_export;
16
27
  export default _default;
@@ -0,0 +1,25 @@
1
+ export type TabItem = {
2
+ icon?: string;
3
+ value: string;
4
+ title?: string;
5
+ to?: Record<string, unknown>;
6
+ };
7
+ type __VLS_Props = {
8
+ items: TabItem[];
9
+ mini?: boolean;
10
+ routable?: boolean;
11
+ routeTarget?: 'query' | 'hash' | 'name' | 'params';
12
+ label?: string;
13
+ customClass?: Partial<Record<'label' | 'selectedLabel' | 'normalLabel' | 'title' | 'icon', string>>;
14
+ };
15
+ type __VLS_ModelProps = {
16
+ modelValue?: string | number;
17
+ };
18
+ type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
19
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
20
+ "update:modelValue": (value: string | number | undefined) => any;
21
+ }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
22
+ "onUpdate:modelValue"?: ((value: string | number | undefined) => any) | undefined;
23
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
24
+ declare const _default: typeof __VLS_export;
25
+ export default _default;
@@ -0,0 +1,61 @@
1
+ <template>
2
+ <div class="flex items-stretch text-(base gray-600) font-semibold bg-transparent h-13">
3
+ <label
4
+ v-for="item in items"
5
+ :key="item.value"
6
+ :class="[
7
+ customClass.label,
8
+ item?.value === value ? customClass.selectedLabel : customClass.normalLabel,
9
+ item?.value === value ? 'font-semibold text-primary cursor-default border-b-primary' : 'border-b-border',
10
+ mini ? 'px-3' : ' px-4'
11
+ ]"
12
+ class="flex gap-2 justify-center items-center flex-grow basis-1 border-b-(2 solid) cursor-pointer p-3 text-sm"
13
+ @click="addToQuery(item)"
14
+ >
15
+ <input
16
+ v-model="value"
17
+ type="radio"
18
+ :value="item.value"
19
+ hidden
20
+ >
21
+ <UnNuxtIcon
22
+ :class="customClass.icon"
23
+ :name="item.icon"
24
+ />
25
+ <p
26
+ :class="customClass.title"
27
+ class="whitespace-nowrap"
28
+ >
29
+ {{ item.title || item.value }}
30
+ </p>
31
+ </label>
32
+ </div>
33
+ </template>
34
+
35
+ <script setup>
36
+ import { _merge, useRoute, useRouter } from "#imports";
37
+ const { customClass = {}, label, routeTarget, routable } = defineProps({
38
+ items: { type: Array, required: true },
39
+ mini: { type: Boolean, required: false },
40
+ routable: { type: Boolean, required: false },
41
+ routeTarget: { type: String, required: false },
42
+ label: { type: String, required: false },
43
+ customClass: { type: Object, required: false }
44
+ });
45
+ const value = defineModel({ type: [String, Number] });
46
+ const route = useRoute();
47
+ const router = useRouter();
48
+ const addToQuery = (i) => {
49
+ value.value = i.value;
50
+ if (routable) {
51
+ if (i.to) {
52
+ router.replace(i.to);
53
+ } else if (routeTarget) {
54
+ const q = _merge(route, {
55
+ [routeTarget]: label ? { [label]: i.value } : `${routeTarget === "hash" ? "#" : ""}${i.value}`
56
+ });
57
+ router.replace(q);
58
+ }
59
+ }
60
+ };
61
+ </script>
@@ -0,0 +1,25 @@
1
+ export type TabItem = {
2
+ icon?: string;
3
+ value: string;
4
+ title?: string;
5
+ to?: Record<string, unknown>;
6
+ };
7
+ type __VLS_Props = {
8
+ items: TabItem[];
9
+ mini?: boolean;
10
+ routable?: boolean;
11
+ routeTarget?: 'query' | 'hash' | 'name' | 'params';
12
+ label?: string;
13
+ customClass?: Partial<Record<'label' | 'selectedLabel' | 'normalLabel' | 'title' | 'icon', string>>;
14
+ };
15
+ type __VLS_ModelProps = {
16
+ modelValue?: string | number;
17
+ };
18
+ type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
19
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
20
+ "update:modelValue": (value: string | number | undefined) => any;
21
+ }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
22
+ "onUpdate:modelValue"?: ((value: string | number | undefined) => any) | undefined;
23
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
24
+ declare const _default: typeof __VLS_export;
25
+ export default _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unsource/ui",
3
- "version": "1.5.7",
3
+ "version": "1.7.0",
4
4
  "private": false,
5
5
  "description": "nuxt ui kit for unsource env",
6
6
  "repository": "https://github.com/alisa2142/unsource-ui",
@@ -37,6 +37,7 @@
37
37
  "dependencies": {
38
38
  "@neshan-maps-platform/vue3-openlayers": "^2.0.1",
39
39
  "@nuxt/kit": "^4.1.3",
40
+ "nuxt-lodash": "^2.5.3",
40
41
  "nuxt-swiper": "^1.2.2",
41
42
  "swiper": "^11.2.10",
42
43
  "unocss-preset-scrollbar": "^3.2.0"
@@ -1,15 +0,0 @@
1
- declare const _default: typeof __VLS_export;
2
- export default _default;
3
- declare const __VLS_export: import("vue").DefineComponent<{}, {
4
- $props: Partial<typeof props>;
5
- mini: boolean;
6
- items: unknown[];
7
- routable: boolean;
8
- label?: string | undefined;
9
- }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
10
- declare const props: {
11
- readonly mini: boolean;
12
- readonly items: unknown[];
13
- readonly routable: boolean;
14
- readonly label?: string | undefined;
15
- };
@@ -1,47 +0,0 @@
1
- <template>
2
- <div class="flex items-stretch text-(base gray-600) font-semibold bg-transparent p-1 h-13">
3
- <label v-for="item in items"
4
- :class="[[item?.value === ( value ) ? 'text-primary-500 cursor-default border-primary-500 border-2' : 'border-1 border-gray-400' ] , [mini ? 'px-3' : ' px-4']]"
5
- class="flex justify-center items-center flex-grow basis-1 border-b-(solid) cursor-pointer p-3 text-sm"
6
- @click="addToQuery(item.key , item.value)">
7
- <input v-model="value" type="radio" :value="item.value" hidden>
8
- <span class="whitespace-nowrap">
9
- {{ item.label }}
10
- </span>
11
- </label>
12
- </div>
13
- </template>
14
-
15
- <script setup>
16
- const props = defineProps({
17
- items: {
18
- type: Array,
19
- required: true
20
- },
21
- mini: {
22
- type: Boolean,
23
- default: false
24
- },
25
- routable: {
26
- type: Boolean,
27
- default: true
28
- },
29
- label: {
30
- type: String
31
- }
32
- });
33
- const value = defineModel();
34
- const route = useRoute();
35
- const router = useRouter();
36
- const addToQuery = (key, v) => {
37
- value.value = v;
38
- if (props.routable) {
39
- router.replace({
40
- query: {
41
- ...route.query,
42
- [props.label]: v
43
- }
44
- });
45
- }
46
- };
47
- </script>
@@ -1,15 +0,0 @@
1
- declare const _default: typeof __VLS_export;
2
- export default _default;
3
- declare const __VLS_export: import("vue").DefineComponent<{}, {
4
- $props: Partial<typeof props>;
5
- mini: boolean;
6
- items: unknown[];
7
- routable: boolean;
8
- label?: string | undefined;
9
- }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
10
- declare const props: {
11
- readonly mini: boolean;
12
- readonly items: unknown[];
13
- readonly routable: boolean;
14
- readonly label?: string | undefined;
15
- };