@bagelink/vue 0.0.1135 → 0.0.1137
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/components/AddressSearch.vue.d.ts +6 -6
- package/dist/components/Alert.vue.d.ts +2 -2
- package/dist/components/Alert.vue.d.ts.map +1 -1
- package/dist/components/Badge.vue.d.ts +3 -3
- package/dist/components/Badge.vue.d.ts.map +1 -1
- package/dist/components/Btn.vue.d.ts +3 -3
- package/dist/components/Btn.vue.d.ts.map +1 -1
- package/dist/components/DropDown.vue.d.ts +3 -3
- package/dist/components/DropDown.vue.d.ts.map +1 -1
- package/dist/components/Icon/Icon.vue.d.ts +11 -0
- package/dist/components/Icon/Icon.vue.d.ts.map +1 -0
- package/dist/components/Icon/constants.d.ts +4 -0
- package/dist/components/Icon/constants.d.ts.map +1 -0
- package/dist/components/Icon/types.d.ts +5 -0
- package/dist/components/Icon/types.d.ts.map +1 -0
- package/dist/components/ListItem.vue.d.ts +2 -2
- package/dist/components/ListItem.vue.d.ts.map +1 -1
- package/dist/components/NavBar.vue.d.ts +3 -3
- package/dist/components/NavBar.vue.d.ts.map +1 -1
- package/dist/components/Pill.vue.d.ts +4 -4
- package/dist/components/Pill.vue.d.ts.map +1 -1
- package/dist/components/TableSchema.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/NumberInput.vue.d.ts +3 -3
- package/dist/components/form/inputs/NumberInput.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/PasswordInput.vue.d.ts +3 -3
- package/dist/components/form/inputs/PasswordInput.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/SelectInput.vue.d.ts +22 -22
- package/dist/components/form/inputs/SelectInput.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/TelInput.vue.d.ts +6 -6
- package/dist/components/form/inputs/TextInput.vue.d.ts +3 -3
- package/dist/components/form/inputs/TextInput.vue.d.ts.map +1 -1
- package/dist/components/index.d.ts +1 -2
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/layout/TabsNav.vue.d.ts +2 -2
- package/dist/components/layout/TabsNav.vue.d.ts.map +1 -1
- package/dist/index.cjs +4649 -226
- package/dist/index.mjs +4649 -226
- package/dist/style.css +1998 -3504
- package/dist/types/BtnOptions.d.ts +2 -2
- package/dist/types/BtnOptions.d.ts.map +1 -1
- package/dist/types/NavLink.d.ts +2 -2
- package/dist/types/NavLink.d.ts.map +1 -1
- package/dist/types/index.d.ts +3 -3
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/AccordionItem.vue +3 -3
- package/src/components/Alert.vue +2 -2
- package/src/components/Badge.vue +3 -3
- package/src/components/Btn.vue +6 -6
- package/src/components/Carousel.vue +12 -12
- package/src/components/Dropdown.vue +3 -3
- package/src/components/Icon/Icon.vue +49 -0
- package/src/components/Icon/constants.ts +4427 -0
- package/src/components/Icon/types.ts +6 -0
- package/src/components/ListItem.vue +2 -2
- package/src/components/NavBar.vue +6 -6
- package/src/components/Pill.vue +7 -7
- package/src/components/TableSchema.vue +3 -4
- package/src/components/form/inputs/NumberInput.vue +3 -3
- package/src/components/form/inputs/PasswordInput.vue +3 -3
- package/src/components/form/inputs/RichText/richTextTypes.d.ts +2 -2
- package/src/components/form/inputs/SelectInput.vue +2 -2
- package/src/components/form/inputs/TableField.vue +3 -3
- package/src/components/form/inputs/TextInput.vue +6 -6
- package/src/components/index.ts +1 -2
- package/src/components/layout/TabsNav.vue +2 -2
- package/src/styles/theme.css +258 -266
- package/src/types/BtnOptions.ts +2 -2
- package/src/types/NavLink.ts +2 -2
- package/src/types/index.ts +4 -3
- package/src/components/MaterialIcon.vue +0 -21
- package/src/types/materialIcons.ts +0 -3761
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IconType, ThemeType } from '.';
|
|
2
2
|
export interface BtnOptions {
|
|
3
3
|
onClick?: () => void;
|
|
4
4
|
color?: ThemeType;
|
|
5
5
|
theme?: ThemeType;
|
|
6
6
|
disabled?: boolean;
|
|
7
|
-
icon?:
|
|
7
|
+
icon?: IconType;
|
|
8
8
|
flat?: boolean;
|
|
9
9
|
thin?: boolean;
|
|
10
10
|
type?: 'button' | 'submit' | 'reset';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BtnOptions.d.ts","sourceRoot":"","sources":["../../src/types/BtnOptions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"BtnOptions.d.ts","sourceRoot":"","sources":["../../src/types/BtnOptions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,GAAG,CAAA;AAE5C,MAAM,WAAW,UAAU;IAC1B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;IACpB,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,IAAI,CAAC,EAAE,QAAQ,CAAA;IACf,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,IAAI,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAA;IACpC,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,OAAO,CAAA;CAChB"}
|
package/dist/types/NavLink.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NavLink.d.ts","sourceRoot":"","sources":["../../src/types/NavLink.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"NavLink.d.ts","sourceRoot":"","sources":["../../src/types/NavLink.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAE7C,MAAM,WAAW,OAAO;IACvB,KAAK,EAAE,MAAM,CAAA;IACb,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,IAAI,EAAE,QAAQ,CAAA;IACd,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,EAAE,OAAO,EAAE,CAAA;IACpB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;CACpB"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { MaterialIcons } from '
|
|
1
|
+
import { IconType, MaterialIcons } from '../components/Icon/types';
|
|
2
2
|
export type { ModalApi, ModalComponentProps, ModalComponentProps as ModalFormComponentProps, ModalFormOptions, ModalOptions, } from '../plugins/modal';
|
|
3
|
-
export type { MaterialIcons };
|
|
3
|
+
export type { IconType, MaterialIcons };
|
|
4
4
|
export * from './BagelForm';
|
|
5
5
|
export * from './BtnOptions';
|
|
6
6
|
export type { StorageFile } from './file';
|
|
@@ -9,7 +9,7 @@ export type { Tables, TableToTypeMapping } from '../../../sdk/src/index.ts';
|
|
|
9
9
|
export type Tab = {
|
|
10
10
|
label: string;
|
|
11
11
|
id: string;
|
|
12
|
-
icon?:
|
|
12
|
+
icon?: IconType;
|
|
13
13
|
} | string;
|
|
14
14
|
export type ThemeType = 'light' | 'white' | 'red' | 'gray' | 'gray-light' | 'black' | 'green' | 'yellow' | 'primary' | 'blue';
|
|
15
15
|
export type Option = string | number | {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACX,QAAQ,EACR,mBAAmB,EACnB,mBAAmB,IAAI,uBAAuB,EAC9C,gBAAgB,EAChB,YAAY,GACZ,MAAM,kBAAkB,CAAA;AAEzB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACX,QAAQ,EACR,mBAAmB,EACnB,mBAAmB,IAAI,uBAAuB,EAC9C,gBAAgB,EAChB,YAAY,GACZ,MAAM,kBAAkB,CAAA;AAEzB,OAAO,KAAK,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AAEvE,YAAY,EAAE,QAAQ,EAAE,aAAa,EAAE,CAAA;AAEvC,cAAc,aAAa,CAAA;AAC3B,cAAc,cAAc,CAAA;AAC5B,YAAY,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAA;AAEzC,YAAY,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACxC,YAAY,EAAE,MAAM,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAA;AAE/D,MAAM,MAAM,GAAG,GAAG;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,CAAC,EAAE,QAAQ,CAAA;CACf,GAAG,MAAM,CAAA;AAEV,MAAM,MAAM,SAAS,GACpB,OAAO,GACL,OAAO,GACP,KAAK,GACL,MAAM,GACN,YAAY,GACZ,OAAO,GACP,OAAO,GACP,QAAQ,GACR,SAAS,GACT,MAAM,CAAA;AAET,MAAM,MAAM,MAAM,GACf,MAAM,GACN,MAAM,GACN;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,GACtB;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,CAAA;AAE5C,MAAM,MAAM,KAAK,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
|
-
import {
|
|
2
|
+
import { Icon } from '@bagelink/vue'
|
|
3
3
|
import { inject, watch, computed } from 'vue'
|
|
4
4
|
|
|
5
5
|
const props = defineProps<{
|
|
@@ -74,7 +74,7 @@ function toggle() {
|
|
|
74
74
|
v-if="iconPosition === 'start'"
|
|
75
75
|
class="accordion-icon" :class="[iconClass, { open: isOpen && iconType === 'expand_more' }]"
|
|
76
76
|
>
|
|
77
|
-
<
|
|
77
|
+
<Icon :icon="computedIcon" />
|
|
78
78
|
</span>
|
|
79
79
|
|
|
80
80
|
<slot name="head">
|
|
@@ -87,7 +87,7 @@ function toggle() {
|
|
|
87
87
|
v-if="iconPosition === 'end'"
|
|
88
88
|
class="accordion-icon" :class="[iconClass, { open: isOpen && iconType === 'expand_more' }]"
|
|
89
89
|
>
|
|
90
|
-
<
|
|
90
|
+
<Icon :icon="computedIcon" />
|
|
91
91
|
</span>
|
|
92
92
|
</button>
|
|
93
93
|
<Transition name="expand">
|
package/src/components/Alert.vue
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import type {
|
|
2
|
+
import type { IconType } from '@bagelink/vue'
|
|
3
3
|
import { Icon } from '@bagelink/vue'
|
|
4
4
|
import Btn from './Btn.vue'
|
|
5
5
|
|
|
@@ -7,7 +7,7 @@ interface Props {
|
|
|
7
7
|
message: string
|
|
8
8
|
dismissable?: boolean
|
|
9
9
|
type?: 'info' | 'warning' | 'error'
|
|
10
|
-
icon?:
|
|
10
|
+
icon?: IconType | 'none'
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
withDefaults(
|
package/src/components/Badge.vue
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import type {
|
|
2
|
+
import type { IconType } from '@bagelink/vue'
|
|
3
3
|
import { Icon } from '@bagelink/vue'
|
|
4
4
|
|
|
5
5
|
interface Props {
|
|
6
6
|
color?: 'green' | 'red' | 'blue' | 'light' | 'gray' | 'yellow'
|
|
7
7
|
size?: string
|
|
8
8
|
text: string
|
|
9
|
-
icon?:
|
|
10
|
-
iconEnd?:
|
|
9
|
+
icon?: IconType
|
|
10
|
+
iconEnd?: IconType
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
defineProps<Props>()
|
package/src/components/Btn.vue
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import type {
|
|
2
|
+
import type { IconType, ThemeType } from '@bagelink/vue'
|
|
3
3
|
import type { SetupContext } from 'vue'
|
|
4
|
-
import {
|
|
4
|
+
import { Icon, Loading } from '@bagelink/vue'
|
|
5
5
|
import { useSlots } from 'vue'
|
|
6
6
|
import { RouterLink } from 'vue-router'
|
|
7
7
|
|
|
8
8
|
const props = withDefaults(
|
|
9
9
|
defineProps<{
|
|
10
10
|
disabled?: boolean
|
|
11
|
-
icon?:
|
|
12
|
-
iconEnd?:
|
|
11
|
+
icon?: IconType
|
|
12
|
+
iconEnd?: IconType
|
|
13
13
|
color?: ThemeType
|
|
14
14
|
theme?: ThemeType
|
|
15
15
|
flat?: boolean
|
|
@@ -81,12 +81,12 @@ const slots: SetupContext['slots'] = useSlots()
|
|
|
81
81
|
>
|
|
82
82
|
<Loading v-if="loading" class="h-100p" size="15" />
|
|
83
83
|
<div v-else class="bgl_btn-flex">
|
|
84
|
-
<
|
|
84
|
+
<Icon v-if="icon" :icon="icon" />
|
|
85
85
|
<slot />
|
|
86
86
|
<template v-if="!slots.default && value">
|
|
87
87
|
{{ value }}
|
|
88
88
|
</template>
|
|
89
|
-
<
|
|
89
|
+
<Icon v-if="iconEnd" :icon="iconEnd" />
|
|
90
90
|
</div>
|
|
91
91
|
</component>
|
|
92
92
|
</template>
|
|
@@ -37,7 +37,7 @@ const THRESHOLDS = {
|
|
|
37
37
|
const GAP_PERCENT = 1
|
|
38
38
|
|
|
39
39
|
// Template refs and state
|
|
40
|
-
const bglSlider = $ref<HTMLElement>()
|
|
40
|
+
const bglSlider = $ref<HTMLElement | undefined>()
|
|
41
41
|
const isSliderAvailable = $computed(() => !!bglSlider)
|
|
42
42
|
|
|
43
43
|
let itemCount = $ref(props.items)
|
|
@@ -124,7 +124,7 @@ function animateTransform(start: number, end: number, duration: number) {
|
|
|
124
124
|
// Navigation
|
|
125
125
|
function goToSlide(index: number, isTouchNav = false) {
|
|
126
126
|
countSlides()
|
|
127
|
-
if (!isSliderAvailable || index < 0 || index >= slideCount) return
|
|
127
|
+
if (!isSliderAvailable || !bglSlider || index < 0 || index >= slideCount) return
|
|
128
128
|
|
|
129
129
|
const containerWidth = bglSlider.offsetWidth
|
|
130
130
|
const gapWidth = (containerWidth * GAP_PERCENT) / 100
|
|
@@ -161,7 +161,7 @@ function prev() {
|
|
|
161
161
|
|
|
162
162
|
// Height management
|
|
163
163
|
function calcHeight() {
|
|
164
|
-
if (!isSliderAvailable) return
|
|
164
|
+
if (!isSliderAvailable || !bglSlider) return
|
|
165
165
|
try {
|
|
166
166
|
const activeSlide = bglSlider.children[activeSlideIndex]
|
|
167
167
|
if (!activeSlide) return
|
|
@@ -180,7 +180,7 @@ function updateHeight() {
|
|
|
180
180
|
|
|
181
181
|
// Slide management
|
|
182
182
|
function countSlides() {
|
|
183
|
-
if (!isSliderAvailable) return
|
|
183
|
+
if (!isSliderAvailable || !bglSlider) return
|
|
184
184
|
slideCount = bglSlider.children.length
|
|
185
185
|
}
|
|
186
186
|
|
|
@@ -192,7 +192,7 @@ function handleSlideChange() {
|
|
|
192
192
|
}
|
|
193
193
|
|
|
194
194
|
function handleResize() {
|
|
195
|
-
if (!isSliderAvailable) return
|
|
195
|
+
if (!isSliderAvailable || !bglSlider) return
|
|
196
196
|
itemCount = window.innerWidth < 600
|
|
197
197
|
? 1
|
|
198
198
|
: window.innerWidth < 991
|
|
@@ -221,7 +221,7 @@ function preventDefaultClick(e: MouseEvent) {
|
|
|
221
221
|
|
|
222
222
|
async function disableDrag() {
|
|
223
223
|
await nextTick()
|
|
224
|
-
if (!isSliderAvailable) return
|
|
224
|
+
if (!isSliderAvailable || !bglSlider) return
|
|
225
225
|
|
|
226
226
|
const elements = Array.from(bglSlider.querySelectorAll('img, a')) as HTMLElement[]
|
|
227
227
|
elements.forEach((el) => {
|
|
@@ -250,7 +250,7 @@ function startDrag(e: MouseEvent) {
|
|
|
250
250
|
}
|
|
251
251
|
|
|
252
252
|
function onDrag(e: MouseEvent) {
|
|
253
|
-
if (!isSliderAvailable || !isPressed) return
|
|
253
|
+
if (!isSliderAvailable || !bglSlider || !isPressed) return
|
|
254
254
|
|
|
255
255
|
const x = e.pageX
|
|
256
256
|
const distance = x - startX
|
|
@@ -276,7 +276,7 @@ function endDrag() {
|
|
|
276
276
|
document.removeEventListener('mousemove', onDrag)
|
|
277
277
|
document.removeEventListener('mouseup', endDrag)
|
|
278
278
|
|
|
279
|
-
if (!isSliderAvailable) return
|
|
279
|
+
if (!isSliderAvailable || !bglSlider) return
|
|
280
280
|
|
|
281
281
|
const currentTransform = getCurrentTransform()
|
|
282
282
|
const singleItemWidth = bglSlider.offsetWidth / itemCount
|
|
@@ -331,7 +331,7 @@ function onTouchStart(e: TouchEvent) {
|
|
|
331
331
|
}
|
|
332
332
|
|
|
333
333
|
function onTouchMove(e: TouchEvent) {
|
|
334
|
-
if (!isSliderAvailable || !isPressed) return
|
|
334
|
+
if (!isSliderAvailable || !bglSlider || !isPressed) return
|
|
335
335
|
|
|
336
336
|
const touch = e.touches[0]
|
|
337
337
|
const x = touch.pageX
|
|
@@ -400,7 +400,7 @@ function onTouchMove(e: TouchEvent) {
|
|
|
400
400
|
}
|
|
401
401
|
|
|
402
402
|
function onTouchEnd() {
|
|
403
|
-
if (!isSliderAvailable || !isPressed || !isHorizontalScroll) {
|
|
403
|
+
if (!isSliderAvailable || !bglSlider || !isPressed || !isHorizontalScroll) {
|
|
404
404
|
isPressed = false
|
|
405
405
|
hasScrollDirectionLock = false
|
|
406
406
|
return
|
|
@@ -493,7 +493,7 @@ function onTouchEnd() {
|
|
|
493
493
|
|
|
494
494
|
// Wheel events
|
|
495
495
|
function onWheel(e: WheelEvent) {
|
|
496
|
-
if (!props.allowScroll || !isSliderAvailable || isPressed || isDragging) return
|
|
496
|
+
if (!props.allowScroll || !isSliderAvailable || !bglSlider || isPressed || isDragging) return
|
|
497
497
|
|
|
498
498
|
const isHorizontal = Math.abs(e.deltaX) > Math.abs(e.deltaY)
|
|
499
499
|
if (!isHorizontal) return
|
|
@@ -539,7 +539,7 @@ onMounted(() => {
|
|
|
539
539
|
})
|
|
540
540
|
|
|
541
541
|
onUnmounted(() => {
|
|
542
|
-
if (isSliderAvailable) {
|
|
542
|
+
if (isSliderAvailable && bglSlider) {
|
|
543
543
|
Array.from(bglSlider.children).forEach((child) => {
|
|
544
544
|
const element = child as HTMLElement
|
|
545
545
|
element.removeEventListener('click', preventDefaultClick)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import type {
|
|
2
|
+
import type { IconType } from '@bagelink/vue'
|
|
3
3
|
import { Btn } from '@bagelink/vue'
|
|
4
4
|
import { Dropdown as DDown } from 'floating-vue'
|
|
5
5
|
|
|
@@ -12,9 +12,9 @@ defineProps<{
|
|
|
12
12
|
thin?: boolean
|
|
13
13
|
flat?: boolean
|
|
14
14
|
disabled?: boolean
|
|
15
|
-
icon?:
|
|
15
|
+
icon?: IconType
|
|
16
16
|
triggerClass?: string
|
|
17
|
-
iconEnd?:
|
|
17
|
+
iconEnd?: IconType
|
|
18
18
|
border?: boolean
|
|
19
19
|
outline?: boolean
|
|
20
20
|
round?: boolean
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { IconType } from '@bagelink/vue'
|
|
3
|
+
import { FONT_AWESOME_ICONS, MATERIAL_ICONS, FONT_AWESOME_BRANDS_ICONS } from './constants'
|
|
4
|
+
|
|
5
|
+
const props = defineProps<{
|
|
6
|
+
icon?: IconType
|
|
7
|
+
name?: IconType
|
|
8
|
+
size?: number | string
|
|
9
|
+
color?: string
|
|
10
|
+
weight?: number | string
|
|
11
|
+
}>()
|
|
12
|
+
|
|
13
|
+
const iconRender = (props.icon || props.name) as IconType
|
|
14
|
+
|
|
15
|
+
const iconRenderType = $computed(() => {
|
|
16
|
+
if (MATERIAL_ICONS.includes(iconRender)) return 'material'
|
|
17
|
+
if (FONT_AWESOME_ICONS.includes(iconRender) || FONT_AWESOME_BRANDS_ICONS.includes(iconRender)) return 'font-awesome'
|
|
18
|
+
return 'material'
|
|
19
|
+
})
|
|
20
|
+
|
|
21
|
+
const isFaBrand = $computed(() => FONT_AWESOME_BRANDS_ICONS.includes(iconRender))
|
|
22
|
+
</script>
|
|
23
|
+
|
|
24
|
+
<template>
|
|
25
|
+
<span
|
|
26
|
+
v-if="iconRenderType === 'material'"
|
|
27
|
+
class="bgl_icon-font"
|
|
28
|
+
:style="{ 'fontSize': `${size}rem`, color, 'font-variation-settings': `'wght' ${weight || 400}` }"
|
|
29
|
+
>
|
|
30
|
+
{{ iconRender }}
|
|
31
|
+
</span>
|
|
32
|
+
<i
|
|
33
|
+
v-else-if="iconRenderType === 'font-awesome'"
|
|
34
|
+
class="fa" :class="[`fa-${iconRender}`, { 'fa-brands': isFaBrand }]"
|
|
35
|
+
:style="{ 'fontSize': `${size}rem`, color, 'font-variation-settings': `'wght' ${weight || 400}` }"
|
|
36
|
+
/>
|
|
37
|
+
</template>
|
|
38
|
+
|
|
39
|
+
<style>
|
|
40
|
+
@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200');
|
|
41
|
+
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.7.2/css/all.min.css');
|
|
42
|
+
[dir='rtl'] .data-row .bgl_icon-font,
|
|
43
|
+
[dir='rtl'] .embedded-field .bgl_icon-font,
|
|
44
|
+
[dir='rtl'] .rich-text-editor .toolbar .bgl_icon-font {
|
|
45
|
+
transform: rotateY(180deg) !important;
|
|
46
|
+
}
|
|
47
|
+
</style>
|
|
48
|
+
|
|
49
|
+
<!-- <style src="./font-awesome.css" /> -->
|