@frollo/frollo-web-ui 7.0.1 → 8.0.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/cjs/index.js +34615 -34451
- package/esm/_rollupPluginBabelHelpers-DpC_oIQV.js +2566 -0
- package/esm/{check-94a5917a.js → check--YD4Ts6g.js} +4 -4
- package/esm/fw-accordion.js +27 -26
- package/esm/fw-animations.js +23 -26
- package/esm/fw-bar-chart.js +15289 -19
- package/esm/{fw-button-c8502414.js → fw-button-4QLZlu0U.js} +44 -44
- package/esm/fw-button.js +5 -10
- package/esm/{fw-card-1b6a67fe.js → fw-card-bsYbpPmW.js} +12 -12
- package/esm/fw-card.js +1 -1
- package/esm/fw-checkbox.js +23 -32
- package/esm/fw-date-picker.js +137 -80
- package/esm/fw-drawer.js +31 -34
- package/esm/fw-dropdown-nLtzu2fS.js +277 -0
- package/esm/fw-dropdown.js +7 -15
- package/esm/fw-form.js +1 -1
- package/esm/fw-image-DOgM8i8X.js +200 -0
- package/esm/fw-image.js +5 -21
- package/esm/{fw-input-8969b226.js → fw-input-Qiy53nRk.js} +61 -53
- package/esm/fw-input.js +6 -19
- package/esm/fw-loading-bar-DThRjdw1.js +22 -0
- package/esm/{fw-loading-spinner-72d70258.js → fw-loading-spinner-Dn52RI5h.js} +1 -1
- package/esm/fw-loading.js +3 -7
- package/esm/fw-modal.js +79 -53
- package/esm/fw-navigation-menu.js +15 -20
- package/esm/fw-popover.js +39 -375
- package/esm/fw-progress-bar.js +8 -11
- package/esm/fw-provider-list.js +41 -84
- package/esm/fw-sidebar-menu.js +33 -24
- package/esm/{fw-table-row-23f78218.js → fw-table-row-DkZaaMmE.js} +15 -301
- package/esm/fw-table.js +6 -16
- package/esm/fw-tabs.js +21 -103
- package/esm/{fw-tag-ac28200a.js → fw-tag-CPp1P480.js} +29 -20
- package/esm/fw-tag.js +7 -12
- package/esm/fw-toast.js +22 -37
- package/esm/fw-transactions-card.js +14 -30
- package/esm/index-CUPvK0Aa.js +586 -0
- package/esm/index.js +66 -228
- package/esm/vee-validate.esm-3ptvCDR1.js +4071 -0
- package/frollo-web-ui.esm.js +34134 -34388
- package/icons/chart-line-up.svg +3 -0
- package/icons/icons.stories.ts +24 -29
- package/icons/index.ts +5 -1
- package/icons/sack-dollar.svg +3 -0
- package/icons/xmark.svg +2 -2
- package/index.d.ts +2789 -2573
- package/package.json +75 -73
- package/styles/tailwind.scss +6 -0
- package/types/components/fw-accordion/fw-accordion.vue.d.ts +128 -128
- package/types/components/fw-accordion/index.d.ts +2 -2
- package/types/components/fw-accordion/index.types.d.ts +10 -10
- package/types/components/fw-animations/fw-email-pulse.vue.d.ts +24 -24
- package/types/components/fw-animations/fw-loading-spinner.vue.d.ts +2 -2
- package/types/components/fw-animations/fw-success-pulse.vue.d.ts +24 -24
- package/types/components/fw-animations/index.d.ts +4 -4
- package/types/components/fw-bar-chart/fw-bar-chart.vue.d.ts +83 -83
- package/types/components/fw-bar-chart/index.d.ts +2 -2
- package/types/components/fw-bar-chart/index.types.d.ts +11 -11
- package/types/components/fw-button/fw-button.vue.d.ts +190 -176
- package/types/components/fw-button/index.d.ts +2 -2
- package/types/components/fw-button/index.types.d.ts +27 -26
- package/types/components/fw-card/fw-card.vue.d.ts +82 -82
- package/types/components/fw-card/index.d.ts +2 -2
- package/types/components/fw-card/index.types.d.ts +8 -8
- package/types/components/fw-checkbox/fw-checkbox.vue.d.ts +108 -108
- package/types/components/fw-checkbox/index.d.ts +2 -2
- package/types/components/fw-checkbox/index.types.d.ts +9 -9
- package/types/components/fw-date-picker/fw-date-picker.vue.d.ts +249 -177
- package/types/components/fw-date-picker/index.d.ts +2 -2
- package/types/components/fw-date-picker/index.types.d.ts +21 -16
- package/types/components/fw-drawer/fw-drawer.vue.d.ts +165 -165
- package/types/components/fw-drawer/index.d.ts +2 -2
- package/types/components/fw-drawer/index.types.d.ts +13 -13
- package/types/components/fw-dropdown/fw-dropdown.vue.d.ts +154 -130
- package/types/components/fw-dropdown/index.d.ts +2 -2
- package/types/components/fw-dropdown/index.types.d.ts +16 -13
- package/types/components/fw-form/index.d.ts +2 -2
- package/types/components/fw-image/fw-image.vue.d.ts +103 -84
- package/types/components/fw-image/index.d.ts +2 -2
- package/types/components/fw-image/index.types.d.ts +9 -8
- package/types/components/fw-input/fw-input.vue.d.ts +214 -197
- package/types/components/fw-input/index.d.ts +2 -2
- package/types/components/fw-input/index.types.d.ts +18 -16
- package/types/components/fw-loading/fw-loading-bar.vue.d.ts +2 -2
- package/types/components/fw-loading/fw-loading-card.vue.d.ts +2 -2
- package/types/components/fw-loading/fw-loading-table.vue.d.ts +25 -25
- package/types/components/fw-loading/index.d.ts +4 -4
- package/types/components/fw-modal/fw-modal.vue.d.ts +205 -175
- package/types/components/fw-modal/index.d.ts +2 -2
- package/types/components/fw-modal/index.types.d.ts +16 -14
- package/types/components/fw-navigation-menu/fw-navigation-menu.vue.d.ts +57 -57
- package/types/components/fw-navigation-menu/index.d.ts +2 -2
- package/types/components/fw-navigation-menu/index.types.d.ts +7 -7
- package/types/components/fw-popover/fw-popover.vue.d.ts +157 -157
- package/types/components/fw-popover/index.d.ts +2 -2
- package/types/components/fw-popover/index.types.d.ts +11 -11
- package/types/components/fw-progress-bar/fw-progress-bar.vue.d.ts +52 -52
- package/types/components/fw-progress-bar/index.d.ts +2 -2
- package/types/components/fw-progress-bar/index.types.d.ts +5 -5
- package/types/components/fw-provider-list/fw-provider-list.vue.d.ts +100 -100
- package/types/components/fw-provider-list/index.d.ts +2 -2
- package/types/components/fw-provider-list/index.types.d.ts +11 -11
- package/types/components/fw-sidebar-menu/fw-sidebar-menu.vue.d.ts +88 -72
- package/types/components/fw-sidebar-menu/index.d.ts +2 -2
- package/types/components/fw-sidebar-menu/index.types.d.ts +9 -8
- package/types/components/fw-table/fw-table-head.vue.d.ts +2 -2
- package/types/components/fw-table/fw-table-row.vue.d.ts +2 -2
- package/types/components/fw-table/fw-table.vue.d.ts +71 -71
- package/types/components/fw-table/index.d.ts +4 -4
- package/types/components/fw-table/index.types.d.ts +16 -16
- package/types/components/fw-tabs/fw-tab.vue.d.ts +24 -32
- package/types/components/fw-tabs/fw-tabs.vue.d.ts +24 -24
- package/types/components/fw-tabs/index.d.ts +3 -3
- package/types/components/fw-tabs/index.types.d.ts +8 -0
- package/types/components/fw-tag/fw-tag.vue.d.ts +80 -70
- package/types/components/fw-tag/index.d.ts +2 -2
- package/types/components/fw-tag/index.types.d.ts +18 -18
- package/types/components/fw-toast/fw-toast.vue.d.ts +121 -121
- package/types/components/fw-toast/index.d.ts +2 -2
- package/types/components/fw-toast/index.types.d.ts +13 -13
- package/types/components/fw-transactions-card/fw-transactions-card.vue.d.ts +58 -58
- package/types/components/fw-transactions-card/index.d.ts +2 -2
- package/types/components/fw-transactions-card/index.types.d.ts +6 -6
- package/types/components/index.d.ts +24 -24
- package/types/components/index.types.d.ts +21 -20
- package/types/directives/index.d.ts +2 -2
- package/types/directives/lazy-loader.d.ts +3 -3
- package/types/helpers/get-root-colours.d.ts +17 -17
- package/types/icons/index.d.ts +43 -41
- package/types/index-types.esm.d.ts +6 -6
- package/types/index.browser-umd.d.ts +2 -1
- package/types/index.d.ts +3 -3
- package/types/index.esm.d.ts +5 -5
- package/types/services/index.d.ts +2 -2
- package/types/services/modal.d.ts +9 -9
- package/types/services/toast.d.ts +9 -9
- package/web-components/index.js +19662 -19720
- package/esm/add-to-unscopables-ee05b58f.js +0 -25
- package/esm/array-iteration-8267bf22.js +0 -92
- package/esm/array-method-has-species-support-6c675094.js +0 -23
- package/esm/array-method-is-strict-d313436f.js +0 -14
- package/esm/array-species-create-1c67e297.js +0 -97
- package/esm/classof-d44bf093.js +0 -42
- package/esm/create-property-eb329361.js +0 -14
- package/esm/defineProperty-b85f2e0f.js +0 -42
- package/esm/does-not-exceed-safe-integer-de37ce28.js +0 -11
- package/esm/es.array.concat-99b85557.js +0 -69
- package/esm/es.array.find-1ded15d5.js +0 -28
- package/esm/es.array.includes-08e25019.js +0 -27
- package/esm/es.array.map-c56ebffd.js +0 -22
- package/esm/es.date.to-string-15eb9936.js +0 -23
- package/esm/es.function.name-6cafd747.js +0 -29
- package/esm/es.number.constructor-fb16fe05.js +0 -204
- package/esm/es.object.to-string-4b07c4d1.js +0 -24
- package/esm/es.string.includes-061e8272.js +0 -66
- package/esm/es.string.iterator-25db8cd2.js +0 -469
- package/esm/export-10c4adbc.js +0 -95
- package/esm/function-apply-e17cf65b.js +0 -14
- package/esm/fw-dropdown-6856e66e.js +0 -224
- package/esm/fw-image-aca2c61d.js +0 -296
- package/esm/fw-loading-bar-f5ca605c.js +0 -22
- package/esm/index-6758f755.js +0 -15797
- package/esm/index-bced3b35.js +0 -560
- package/esm/is-forced-7cb3ee8f.js +0 -927
- package/esm/object-create-51bf02dc.js +0 -125
- package/esm/regexp-flags-c09864e5.js +0 -50
- package/esm/vee-validate.esm-a17a23c3.js +0 -3192
- package/esm/web.timers-e406c8e6.js +0 -72
- /package/esm/{get-root-colours-865a52ba.js → get-root-colours-DYEoJPEb.js} +0 -0
- /package/esm/{index-0c5cae4f.js → index-BVcOAKar.js} +0 -0
- /package/esm/{style-inject.es-1f59c1d0.js → style-inject.es-tgCJW-Cu.js} +0 -0
- /package/esm/{uniqueId-fe08534a.js → uniqueId-DK6xzFd8.js} +0 -0
package/esm/fw-drawer.js
CHANGED
|
@@ -1,15 +1,10 @@
|
|
|
1
|
-
import './es.array.includes-08e25019.js';
|
|
2
1
|
import { defineComponent, ref, computed, onMounted, resolveComponent, openBlock, createBlock, Transition, withCtx, withDirectives, createElementVNode, normalizeClass, createElementBlock, renderSlot, createCommentVNode, createVNode, createTextVNode, toDisplayString, vShow } from 'vue';
|
|
3
|
-
import { s as script$1 } from './fw-button-
|
|
4
|
-
import { u as uniqueId } from './uniqueId-
|
|
5
|
-
import {
|
|
6
|
-
import { s as styleInject } from './style-inject.es-
|
|
7
|
-
import './
|
|
8
|
-
import './
|
|
9
|
-
import './add-to-unscopables-ee05b58f.js';
|
|
10
|
-
import './object-create-51bf02dc.js';
|
|
11
|
-
import './fw-loading-spinner-72d70258.js';
|
|
12
|
-
import './check-94a5917a.js';
|
|
2
|
+
import { s as script$1 } from './fw-button-4QLZlu0U.js';
|
|
3
|
+
import { u as uniqueId } from './uniqueId-DK6xzFd8.js';
|
|
4
|
+
import { b as render$1 } from './index-CUPvK0Aa.js';
|
|
5
|
+
import { s as styleInject } from './style-inject.es-tgCJW-Cu.js';
|
|
6
|
+
import './fw-loading-spinner-Dn52RI5h.js';
|
|
7
|
+
import './check--YD4Ts6g.js';
|
|
13
8
|
|
|
14
9
|
var script = defineComponent({
|
|
15
10
|
name: 'FwDrawer',
|
|
@@ -17,56 +12,58 @@ var script = defineComponent({
|
|
|
17
12
|
FwButton: script$1,
|
|
18
13
|
XMarkSvg: render$1
|
|
19
14
|
},
|
|
20
|
-
emits: ['update:modelValue',
|
|
15
|
+
emits: ['update:modelValue', /** Fired when cancel button is clicked */
|
|
16
|
+
'cancel', /** Fired when confirm button is clicked */
|
|
17
|
+
'confirm'],
|
|
21
18
|
props: {
|
|
22
|
-
/**
|
|
23
|
-
* The drawer's v-model. Controls the visibility of the drawer.
|
|
19
|
+
/**
|
|
20
|
+
* The drawer's v-model. Controls the visibility of the drawer.
|
|
24
21
|
*/
|
|
25
22
|
modelValue: {
|
|
26
23
|
type: Boolean
|
|
27
24
|
},
|
|
28
|
-
/**
|
|
29
|
-
* The header title of the drawer
|
|
25
|
+
/**
|
|
26
|
+
* The header title of the drawer
|
|
30
27
|
*/
|
|
31
28
|
header: {
|
|
32
29
|
type: String
|
|
33
30
|
},
|
|
34
|
-
/**
|
|
35
|
-
* The body description of the drawer
|
|
31
|
+
/**
|
|
32
|
+
* The body description of the drawer
|
|
36
33
|
*/
|
|
37
34
|
body: {
|
|
38
35
|
type: String
|
|
39
36
|
},
|
|
40
|
-
/**
|
|
41
|
-
* The aria role of the drawer container. Defaults to `dialog`
|
|
37
|
+
/**
|
|
38
|
+
* The aria role of the drawer container. Defaults to `dialog`
|
|
42
39
|
*/
|
|
43
40
|
role: {
|
|
44
41
|
type: String,
|
|
45
42
|
"default": 'dialog'
|
|
46
43
|
},
|
|
47
|
-
/**
|
|
48
|
-
* Whether to show the cancel button
|
|
44
|
+
/**
|
|
45
|
+
* Whether to show the cancel button
|
|
49
46
|
*/
|
|
50
47
|
showCancel: {
|
|
51
48
|
type: Boolean,
|
|
52
49
|
"default": false
|
|
53
50
|
},
|
|
54
|
-
/**
|
|
55
|
-
* Whether to show the confirm button
|
|
51
|
+
/**
|
|
52
|
+
* Whether to show the confirm button
|
|
56
53
|
*/
|
|
57
54
|
showConfirm: {
|
|
58
55
|
type: Boolean,
|
|
59
56
|
"default": true
|
|
60
57
|
},
|
|
61
|
-
/**
|
|
62
|
-
* Custom text for the cancel button
|
|
58
|
+
/**
|
|
59
|
+
* Custom text for the cancel button
|
|
63
60
|
*/
|
|
64
61
|
cancelButtonText: {
|
|
65
62
|
type: String,
|
|
66
63
|
"default": 'Cancel'
|
|
67
64
|
},
|
|
68
|
-
/**
|
|
69
|
-
* Button variant for the cancel button
|
|
65
|
+
/**
|
|
66
|
+
* Button variant for the cancel button
|
|
70
67
|
*/
|
|
71
68
|
cancelButtonType: {
|
|
72
69
|
type: String,
|
|
@@ -75,15 +72,15 @@ var script = defineComponent({
|
|
|
75
72
|
return ['primary', 'secondary', 'tertiary', 'error', 'success', 'link', 'text', 'transparent'].includes(value);
|
|
76
73
|
}
|
|
77
74
|
},
|
|
78
|
-
/**
|
|
79
|
-
* Custom text for the confirm button
|
|
75
|
+
/**
|
|
76
|
+
* Custom text for the confirm button
|
|
80
77
|
*/
|
|
81
78
|
confirmButtonText: {
|
|
82
79
|
type: String,
|
|
83
80
|
"default": 'Confirm'
|
|
84
81
|
},
|
|
85
|
-
/**
|
|
86
|
-
* Button variant for the confirm button
|
|
82
|
+
/**
|
|
83
|
+
* Button variant for the confirm button
|
|
87
84
|
*/
|
|
88
85
|
confirmButtonType: {
|
|
89
86
|
type: String,
|
|
@@ -214,8 +211,8 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
214
211
|
});
|
|
215
212
|
}
|
|
216
213
|
|
|
217
|
-
var css_248z = ".clip-top-shadow{-webkit-clip-path:inset(-4px 0 0 0);clip-path:inset(-4px 0 0 0)}.drawerSlideInOut-enter-active{-webkit-animation:drawerSlideInOut .4s;animation:drawerSlideInOut .4s;-webkit-transition:all .4s ease-in;transition:all .4s ease-in}.drawerSlideInOut-leave-active{animation:drawerSlideInOut .4s reverse;-webkit-transition:all .4s ease-in-out;transition:all .4s ease-in-out}@-webkit-keyframes drawerSlideInOut{0%{opacity:0;-webkit-transform:translateX(100%);transform:translateX(100%)}to{opacity:1;-webkit-transform:translateX(0);transform:translateX(0)}}@keyframes drawerSlideInOut{0%{opacity:0;-webkit-transform:translateX(100%);transform:translateX(100%)}to{opacity:1;-webkit-transform:translateX(0);transform:translateX(0)}}";
|
|
218
|
-
var stylesheet = ".clip-top-shadow{-webkit-clip-path:inset(-4px 0 0 0);clip-path:inset(-4px 0 0 0)}.drawerSlideInOut-enter-active{-webkit-animation:drawerSlideInOut .4s;animation:drawerSlideInOut .4s;-webkit-transition:all .4s ease-in;transition:all .4s ease-in}.drawerSlideInOut-leave-active{animation:drawerSlideInOut .4s reverse;-webkit-transition:all .4s ease-in-out;transition:all .4s ease-in-out}@-webkit-keyframes drawerSlideInOut{0%{opacity:0;-webkit-transform:translateX(100%);transform:translateX(100%)}to{opacity:1;-webkit-transform:translateX(0);transform:translateX(0)}}@keyframes drawerSlideInOut{0%{opacity:0;-webkit-transform:translateX(100%);transform:translateX(100%)}to{opacity:1;-webkit-transform:translateX(0);transform:translateX(0)}}";
|
|
214
|
+
var css_248z = ".clip-top-shadow{-webkit-clip-path:inset(-4px 0 0 0);clip-path:inset(-4px 0 0 0)}.drawerSlideInOut-enter-active{-webkit-animation:drawerSlideInOut .4s;-moz-animation:drawerSlideInOut .4s;animation:drawerSlideInOut .4s;-webkit-transition:all .4s ease-in;-moz-transition:all .4s ease-in;transition:all .4s ease-in}.drawerSlideInOut-leave-active{animation:drawerSlideInOut .4s reverse;-webkit-transition:all .4s ease-in-out;-moz-transition:all .4s ease-in-out;transition:all .4s ease-in-out}@-webkit-keyframes drawerSlideInOut{0%{opacity:0;-webkit-transform:translateX(100%);transform:translateX(100%)}to{opacity:1;-webkit-transform:translateX(0);transform:translateX(0)}}@-moz-keyframes drawerSlideInOut{0%{opacity:0;-moz-transform:translateX(100%);transform:translateX(100%)}to{opacity:1;-moz-transform:translateX(0);transform:translateX(0)}}@keyframes drawerSlideInOut{0%{opacity:0;-webkit-transform:translateX(100%);-moz-transform:translateX(100%);transform:translateX(100%)}to{opacity:1;-webkit-transform:translateX(0);-moz-transform:translateX(0);transform:translateX(0)}}";
|
|
215
|
+
var stylesheet = ".clip-top-shadow{-webkit-clip-path:inset(-4px 0 0 0);clip-path:inset(-4px 0 0 0)}.drawerSlideInOut-enter-active{-webkit-animation:drawerSlideInOut .4s;-moz-animation:drawerSlideInOut .4s;animation:drawerSlideInOut .4s;-webkit-transition:all .4s ease-in;-moz-transition:all .4s ease-in;transition:all .4s ease-in}.drawerSlideInOut-leave-active{animation:drawerSlideInOut .4s reverse;-webkit-transition:all .4s ease-in-out;-moz-transition:all .4s ease-in-out;transition:all .4s ease-in-out}@-webkit-keyframes drawerSlideInOut{0%{opacity:0;-webkit-transform:translateX(100%);transform:translateX(100%)}to{opacity:1;-webkit-transform:translateX(0);transform:translateX(0)}}@-moz-keyframes drawerSlideInOut{0%{opacity:0;-moz-transform:translateX(100%);transform:translateX(100%)}to{opacity:1;-moz-transform:translateX(0);transform:translateX(0)}}@keyframes drawerSlideInOut{0%{opacity:0;-webkit-transform:translateX(100%);-moz-transform:translateX(100%);transform:translateX(100%)}to{opacity:1;-webkit-transform:translateX(0);-moz-transform:translateX(0);transform:translateX(0)}}";
|
|
219
216
|
styleInject(css_248z);
|
|
220
217
|
|
|
221
218
|
script.render = render;
|
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
import { defineComponent, toRef, ref, computed, watch, onMounted, onBeforeUnmount, pushScopeId, popScopeId, resolveComponent, openBlock, createElementBlock, createTextVNode, toDisplayString, createCommentVNode, createElementVNode, normalizeClass, createBlock, renderSlot, createVNode, Transition, withCtx, withDirectives, Fragment, renderList, vShow } from 'vue';
|
|
2
|
+
import { u as useField } from './vee-validate.esm-3ptvCDR1.js';
|
|
3
|
+
import { r as render$1 } from './index-CUPvK0Aa.js';
|
|
4
|
+
import { s as script$1 } from './fw-image-DOgM8i8X.js';
|
|
5
|
+
import { s as styleInject } from './style-inject.es-tgCJW-Cu.js';
|
|
6
|
+
|
|
7
|
+
var script = defineComponent({
|
|
8
|
+
name: 'FwDropdown',
|
|
9
|
+
emits: ['update:modelValue'],
|
|
10
|
+
components: {
|
|
11
|
+
ChevronDownSvg: render$1,
|
|
12
|
+
FwImage: script$1
|
|
13
|
+
},
|
|
14
|
+
props: {
|
|
15
|
+
/**
|
|
16
|
+
* The select v-model
|
|
17
|
+
*/
|
|
18
|
+
modelValue: {
|
|
19
|
+
type: String
|
|
20
|
+
},
|
|
21
|
+
/**
|
|
22
|
+
* The name of the input field. Must be unique per form.
|
|
23
|
+
*/
|
|
24
|
+
name: {
|
|
25
|
+
type: String,
|
|
26
|
+
required: true
|
|
27
|
+
},
|
|
28
|
+
/**
|
|
29
|
+
* Label for the input. Also renders to an aria-label attribute
|
|
30
|
+
*/
|
|
31
|
+
label: {
|
|
32
|
+
type: String
|
|
33
|
+
},
|
|
34
|
+
/**
|
|
35
|
+
* Validation rules. Accepts an object, string schema or validation function.
|
|
36
|
+
*/
|
|
37
|
+
rules: {
|
|
38
|
+
type: [Object, String, Function]
|
|
39
|
+
},
|
|
40
|
+
/**
|
|
41
|
+
* An array of options for the dropdown menu.
|
|
42
|
+
*/
|
|
43
|
+
options: {
|
|
44
|
+
type: Array,
|
|
45
|
+
required: true
|
|
46
|
+
},
|
|
47
|
+
/**
|
|
48
|
+
* The hint text shown below the input
|
|
49
|
+
*/
|
|
50
|
+
hint: {
|
|
51
|
+
type: String
|
|
52
|
+
},
|
|
53
|
+
/**
|
|
54
|
+
* Custom placeholder text
|
|
55
|
+
*/
|
|
56
|
+
placeholder: {
|
|
57
|
+
type: String,
|
|
58
|
+
required: false,
|
|
59
|
+
"default": 'Select'
|
|
60
|
+
},
|
|
61
|
+
/**
|
|
62
|
+
* Enable the error section UI.
|
|
63
|
+
* Defaults to true
|
|
64
|
+
*/
|
|
65
|
+
enableErrors: {
|
|
66
|
+
type: Boolean,
|
|
67
|
+
"default": true
|
|
68
|
+
},
|
|
69
|
+
/**
|
|
70
|
+
* Enables the required asterisk. (UI only)
|
|
71
|
+
* Use the field validation rule to validate input.
|
|
72
|
+
*/
|
|
73
|
+
required: {
|
|
74
|
+
type: Boolean,
|
|
75
|
+
"default": false
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
setup: function setup(props, ctx) {
|
|
79
|
+
var menuButtonClass = "inline-flex w-full justify-between items-center rounded-md border-2 bg-white px-4 py-3\n shadow-sm focus:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2";
|
|
80
|
+
var menuClass = "absolute left-0 mt-1 w-full text-left z-10 origin-top-left rounded-md bg-grey-20 drop-shadow-lg\n ring-1 ring-black ring-opacity-5 focus:outline-none";
|
|
81
|
+
var menuItemClass = "block px-4 py-3 my-1 cursor-pointer hover:bg-white first:rounded-t-md last:rounded-b-md\n first:mt-0 last:mb-0";
|
|
82
|
+
var nameRef = toRef(props, 'name');
|
|
83
|
+
var _useField = useField(nameRef, props.rules),
|
|
84
|
+
errors = _useField.errors,
|
|
85
|
+
errorMessage = _useField.errorMessage,
|
|
86
|
+
meta = _useField.meta,
|
|
87
|
+
fieldVal = _useField.value;
|
|
88
|
+
var selectedOption = ref(null);
|
|
89
|
+
var selectValue = computed({
|
|
90
|
+
get: function get() {
|
|
91
|
+
return props.modelValue;
|
|
92
|
+
},
|
|
93
|
+
set: function set(state) {
|
|
94
|
+
fieldVal.value = state;
|
|
95
|
+
ctx.emit('update:modelValue', state);
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
var isOpen = ref(false);
|
|
99
|
+
var selectOption = function selectOption(option) {
|
|
100
|
+
selectValue.value = option.value;
|
|
101
|
+
selectedOption.value = option;
|
|
102
|
+
isOpen.value = false;
|
|
103
|
+
};
|
|
104
|
+
var onEscape = function onEscape(e) {
|
|
105
|
+
if (e.key === 'Esc' || e.key === 'Escape') {
|
|
106
|
+
isOpen.value = false;
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
var menuItemActiveClass = function menuItemActiveClass(option) {
|
|
110
|
+
var _selectedOption$value;
|
|
111
|
+
if (((_selectedOption$value = selectedOption.value) === null || _selectedOption$value === void 0 ? void 0 : _selectedOption$value.value) === option.value) {
|
|
112
|
+
return 'bg-white';
|
|
113
|
+
}
|
|
114
|
+
return 'bg-none';
|
|
115
|
+
};
|
|
116
|
+
watch(selectValue, function (newValue) {
|
|
117
|
+
if (newValue) {
|
|
118
|
+
var foundOption = props.options.find(function (option) {
|
|
119
|
+
return option.value === newValue;
|
|
120
|
+
});
|
|
121
|
+
if (foundOption) selectedOption.value = foundOption;
|
|
122
|
+
} else {
|
|
123
|
+
selectedOption.value = null;
|
|
124
|
+
}
|
|
125
|
+
}, {
|
|
126
|
+
immediate: true
|
|
127
|
+
});
|
|
128
|
+
onMounted(function () {
|
|
129
|
+
document.addEventListener('keydown', onEscape);
|
|
130
|
+
});
|
|
131
|
+
onBeforeUnmount(function () {
|
|
132
|
+
document.removeEventListener('keydown', onEscape);
|
|
133
|
+
});
|
|
134
|
+
return {
|
|
135
|
+
menuButtonClass: menuButtonClass,
|
|
136
|
+
menuClass: menuClass,
|
|
137
|
+
menuItemClass: menuItemClass,
|
|
138
|
+
menuItemActiveClass: menuItemActiveClass,
|
|
139
|
+
errors: errors,
|
|
140
|
+
errorMessage: errorMessage,
|
|
141
|
+
meta: meta,
|
|
142
|
+
fieldVal: fieldVal,
|
|
143
|
+
isOpen: isOpen,
|
|
144
|
+
selectValue: selectValue,
|
|
145
|
+
selectOption: selectOption,
|
|
146
|
+
selectedOption: selectedOption
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
var _withScopeId = function _withScopeId(n) {
|
|
152
|
+
return pushScopeId("data-v-72f0ebf0"), n = n(), popScopeId(), n;
|
|
153
|
+
};
|
|
154
|
+
var _hoisted_1 = {
|
|
155
|
+
"class": "fw-dropdown relative"
|
|
156
|
+
};
|
|
157
|
+
var _hoisted_2 = {
|
|
158
|
+
key: 0,
|
|
159
|
+
"class": "block mb-1 font-medium text-left"
|
|
160
|
+
};
|
|
161
|
+
var _hoisted_3 = {
|
|
162
|
+
key: 0,
|
|
163
|
+
"class": "text-error ml-0.5"
|
|
164
|
+
};
|
|
165
|
+
var _hoisted_4 = ["id", "aria-expanded"];
|
|
166
|
+
var _hoisted_5 = {
|
|
167
|
+
key: 0,
|
|
168
|
+
"class": "flex items-center gap-x-2"
|
|
169
|
+
};
|
|
170
|
+
var _hoisted_6 = {
|
|
171
|
+
"class": "flex flex-col text-left"
|
|
172
|
+
};
|
|
173
|
+
var _hoisted_7 = {
|
|
174
|
+
"class": "font-medium"
|
|
175
|
+
};
|
|
176
|
+
var _hoisted_8 = {
|
|
177
|
+
key: 0,
|
|
178
|
+
"class": "text-p-small"
|
|
179
|
+
};
|
|
180
|
+
var _hoisted_9 = {
|
|
181
|
+
key: 1,
|
|
182
|
+
"class": "flex flex-row items-center gap-x-2 text-grey-light"
|
|
183
|
+
};
|
|
184
|
+
var _hoisted_10 = {
|
|
185
|
+
"class": ""
|
|
186
|
+
};
|
|
187
|
+
var _hoisted_11 = ["aria-labelledby"];
|
|
188
|
+
var _hoisted_12 = ["onClick"];
|
|
189
|
+
var _hoisted_13 = {
|
|
190
|
+
"class": "flex items-center gap-x-2"
|
|
191
|
+
};
|
|
192
|
+
var _hoisted_14 = {
|
|
193
|
+
"class": "flex flex-col text-left"
|
|
194
|
+
};
|
|
195
|
+
var _hoisted_15 = {
|
|
196
|
+
key: 0,
|
|
197
|
+
"class": "text-p-small"
|
|
198
|
+
};
|
|
199
|
+
var _hoisted_16 = {
|
|
200
|
+
key: 1,
|
|
201
|
+
"class": "text-left text-sm min-h-[21px]"
|
|
202
|
+
};
|
|
203
|
+
var _hoisted_17 = {
|
|
204
|
+
key: 0,
|
|
205
|
+
"class": "text-error"
|
|
206
|
+
};
|
|
207
|
+
var _hoisted_18 = {
|
|
208
|
+
key: 1,
|
|
209
|
+
"class": "text-grey-base"
|
|
210
|
+
};
|
|
211
|
+
function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
212
|
+
var _ctx$selectedOption, _ctx$selectedOption2, _ctx$selectedOption3, _ctx$selectedOption4;
|
|
213
|
+
var _component_FwImage = resolveComponent("FwImage");
|
|
214
|
+
var _component_ChevronDownSvg = resolveComponent("ChevronDownSvg");
|
|
215
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [_ctx.label ? (openBlock(), createElementBlock("label", _hoisted_2, [createTextVNode(toDisplayString(_ctx.label) + " ", 1), _ctx.required ? (openBlock(), createElementBlock("span", _hoisted_3, "*")) : createCommentVNode("", true)])) : createCommentVNode("", true), createElementVNode("button", {
|
|
216
|
+
type: "button",
|
|
217
|
+
"class": normalizeClass([_ctx.menuButtonClass, _ctx.isOpen ? 'border-primary' : 'border-grey-40 hover:border-grey-60']),
|
|
218
|
+
onClick: _cache[0] || (_cache[0] = function ($event) {
|
|
219
|
+
return _ctx.isOpen = !_ctx.isOpen;
|
|
220
|
+
}),
|
|
221
|
+
id: "".concat(_ctx.name, "-fw-dropdown--button"),
|
|
222
|
+
"aria-expanded": _ctx.isOpen,
|
|
223
|
+
"aria-haspopup": "true"
|
|
224
|
+
}, [(_ctx$selectedOption = _ctx.selectedOption) !== null && _ctx$selectedOption !== void 0 && _ctx$selectedOption.label ? (openBlock(), createElementBlock("div", _hoisted_5, [_ctx.selectedOption.image_url ? (openBlock(), createBlock(_component_FwImage, {
|
|
225
|
+
key: 0,
|
|
226
|
+
src: _ctx.selectedOption.image_url,
|
|
227
|
+
"class": "w-6 h-6"
|
|
228
|
+
}, null, 8, ["src"])) : createCommentVNode("", true), createElementVNode("div", _hoisted_6, [createElementVNode("span", _hoisted_7, toDisplayString((_ctx$selectedOption2 = _ctx.selectedOption) === null || _ctx$selectedOption2 === void 0 ? void 0 : _ctx$selectedOption2.label), 1), (_ctx$selectedOption3 = _ctx.selectedOption) !== null && _ctx$selectedOption3 !== void 0 && _ctx$selectedOption3.description ? (openBlock(), createElementBlock("span", _hoisted_8, toDisplayString((_ctx$selectedOption4 = _ctx.selectedOption) === null || _ctx$selectedOption4 === void 0 ? void 0 : _ctx$selectedOption4.description), 1)) : createCommentVNode("", true)])])) : (openBlock(), createElementBlock("div", _hoisted_9, [_ctx.$slots.placeholderIcon ? renderSlot(_ctx.$slots, "placeholderIcon", {
|
|
229
|
+
key: 0
|
|
230
|
+
}) : createCommentVNode("", true), createElementVNode("span", _hoisted_10, toDisplayString(_ctx.placeholder), 1)])), createVNode(_component_ChevronDownSvg, {
|
|
231
|
+
"class": normalizeClass(["w-6 text-primary transition-transform duration-300", _ctx.isOpen ? 'rotate-180' : ''])
|
|
232
|
+
}, null, 8, ["class"])], 10, _hoisted_4), createVNode(Transition, {
|
|
233
|
+
name: "slideUpDown"
|
|
234
|
+
}, {
|
|
235
|
+
"default": withCtx(function () {
|
|
236
|
+
return [withDirectives(createElementVNode("ul", {
|
|
237
|
+
"class": normalizeClass(_ctx.menuClass),
|
|
238
|
+
role: "menu",
|
|
239
|
+
"aria-orientation": "vertical",
|
|
240
|
+
"aria-labelledby": "".concat(_ctx.name, "-fw-dropdown--button"),
|
|
241
|
+
tabindex: "-1"
|
|
242
|
+
}, [(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.options, function (option) {
|
|
243
|
+
return openBlock(), createElementBlock("li", {
|
|
244
|
+
key: option.value,
|
|
245
|
+
"class": normalizeClass([_ctx.menuItemClass, _ctx.menuItemActiveClass(option)]),
|
|
246
|
+
role: "menuitem",
|
|
247
|
+
tabindex: "0",
|
|
248
|
+
onClick: function onClick($event) {
|
|
249
|
+
return _ctx.selectOption(option);
|
|
250
|
+
}
|
|
251
|
+
}, [createElementVNode("div", _hoisted_13, [option.image_url ? (openBlock(), createBlock(_component_FwImage, {
|
|
252
|
+
key: 0,
|
|
253
|
+
src: option.image_url,
|
|
254
|
+
"class": "w-[20px] h-[20px]"
|
|
255
|
+
}, null, 8, ["src"])) : createCommentVNode("", true), createElementVNode("div", _hoisted_14, [createElementVNode("span", null, toDisplayString(option.label), 1), option.description ? (openBlock(), createElementBlock("span", _hoisted_15, toDisplayString(option.description), 1)) : createCommentVNode("", true)])])], 10, _hoisted_12);
|
|
256
|
+
}), 128))], 10, _hoisted_11), [[vShow, _ctx.isOpen]])];
|
|
257
|
+
}),
|
|
258
|
+
_: 1
|
|
259
|
+
}), _ctx.enableErrors ? (openBlock(), createElementBlock("div", _hoisted_16, [createVNode(Transition, {
|
|
260
|
+
name: "fwFadeIn",
|
|
261
|
+
mode: "out-in"
|
|
262
|
+
}, {
|
|
263
|
+
"default": withCtx(function () {
|
|
264
|
+
return [(_ctx.errorMessage || _ctx.errors[0]) && _ctx.meta.touched ? (openBlock(), createElementBlock("span", _hoisted_17, toDisplayString(_ctx.errorMessage || _ctx.errors[0]), 1)) : _ctx.hint ? (openBlock(), createElementBlock("span", _hoisted_18, toDisplayString(_ctx.hint), 1)) : createCommentVNode("", true)];
|
|
265
|
+
}),
|
|
266
|
+
_: 1
|
|
267
|
+
})])) : createCommentVNode("", true)]);
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
var css_248z = ".slideUpDown-enter-active[data-v-72f0ebf0]{-webkit-animation:slideUpDown-72f0ebf0 .3s;-moz-animation:slideUpDown-72f0ebf0 .3s;animation:slideUpDown-72f0ebf0 .3s;-webkit-transition:all .3s ease-in;-moz-transition:all .3s ease-in;transition:all .3s ease-in}.slideUpDown-leave-active[data-v-72f0ebf0]{animation:slideUpDown-72f0ebf0 .3s reverse;-webkit-transition:all .3s ease-in-out;-moz-transition:all .3s ease-in-out;transition:all .3s ease-in-out}@-webkit-keyframes slideUpDown-72f0ebf0{0%{opacity:0;-webkit-transform:translate3d(0,-3%,0);transform:translate3d(0,-3%,0)}to{opacity:1;-webkit-transform:translateZ(0);transform:translateZ(0)}}@-moz-keyframes slideUpDown-72f0ebf0{0%{opacity:0;-moz-transform:translate3d(0,-3%,0);transform:translate3d(0,-3%,0)}to{opacity:1;-moz-transform:translateZ(0);transform:translateZ(0)}}@keyframes slideUpDown-72f0ebf0{0%{opacity:0;-webkit-transform:translate3d(0,-3%,0);-moz-transform:translate3d(0,-3%,0);transform:translate3d(0,-3%,0)}to{opacity:1;-webkit-transform:translateZ(0);-moz-transform:translateZ(0);transform:translateZ(0)}}";
|
|
271
|
+
var stylesheet = ".slideUpDown-enter-active[data-v-72f0ebf0]{-webkit-animation:slideUpDown-72f0ebf0 .3s;-moz-animation:slideUpDown-72f0ebf0 .3s;animation:slideUpDown-72f0ebf0 .3s;-webkit-transition:all .3s ease-in;-moz-transition:all .3s ease-in;transition:all .3s ease-in}.slideUpDown-leave-active[data-v-72f0ebf0]{animation:slideUpDown-72f0ebf0 .3s reverse;-webkit-transition:all .3s ease-in-out;-moz-transition:all .3s ease-in-out;transition:all .3s ease-in-out}@-webkit-keyframes slideUpDown-72f0ebf0{0%{opacity:0;-webkit-transform:translate3d(0,-3%,0);transform:translate3d(0,-3%,0)}to{opacity:1;-webkit-transform:translateZ(0);transform:translateZ(0)}}@-moz-keyframes slideUpDown-72f0ebf0{0%{opacity:0;-moz-transform:translate3d(0,-3%,0);transform:translate3d(0,-3%,0)}to{opacity:1;-moz-transform:translateZ(0);transform:translateZ(0)}}@keyframes slideUpDown-72f0ebf0{0%{opacity:0;-webkit-transform:translate3d(0,-3%,0);-moz-transform:translate3d(0,-3%,0);transform:translate3d(0,-3%,0)}to{opacity:1;-webkit-transform:translateZ(0);-moz-transform:translateZ(0);transform:translateZ(0)}}";
|
|
272
|
+
styleInject(css_248z);
|
|
273
|
+
|
|
274
|
+
script.render = render;
|
|
275
|
+
script.__scopeId = "data-v-72f0ebf0";
|
|
276
|
+
|
|
277
|
+
export { script as s };
|
package/esm/fw-dropdown.js
CHANGED
|
@@ -1,16 +1,8 @@
|
|
|
1
|
-
export { s as FwDropdown } from './fw-dropdown-
|
|
2
|
-
import './es.array.find-1ded15d5.js';
|
|
3
|
-
import './is-forced-7cb3ee8f.js';
|
|
4
|
-
import './export-10c4adbc.js';
|
|
5
|
-
import './array-iteration-8267bf22.js';
|
|
6
|
-
import './array-species-create-1c67e297.js';
|
|
7
|
-
import './classof-d44bf093.js';
|
|
8
|
-
import './add-to-unscopables-ee05b58f.js';
|
|
9
|
-
import './object-create-51bf02dc.js';
|
|
10
|
-
import './es.object.to-string-4b07c4d1.js';
|
|
1
|
+
export { s as FwDropdown } from './fw-dropdown-nLtzu2fS.js';
|
|
11
2
|
import 'vue';
|
|
12
|
-
import './vee-validate.esm-
|
|
13
|
-
import './index-
|
|
14
|
-
import './check
|
|
15
|
-
import './
|
|
16
|
-
import './
|
|
3
|
+
import './vee-validate.esm-3ptvCDR1.js';
|
|
4
|
+
import './index-CUPvK0Aa.js';
|
|
5
|
+
import './check--YD4Ts6g.js';
|
|
6
|
+
import './fw-image-DOgM8i8X.js';
|
|
7
|
+
import './fw-loading-bar-DThRjdw1.js';
|
|
8
|
+
import './style-inject.es-tgCJW-Cu.js';
|
package/esm/fw-form.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { F as FwForm } from './vee-validate.esm-
|
|
1
|
+
export { F as FwForm } from './vee-validate.esm-3ptvCDR1.js';
|
|
2
2
|
import 'vue';
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
import { defineComponent, computed, ref, resolveComponent, resolveDirective, withDirectives, openBlock, createElementBlock, normalizeClass, withKeys, createElementVNode, createVNode, createBlock, createCommentVNode, renderSlot } from 'vue';
|
|
2
|
+
import { s as script$1 } from './fw-loading-bar-DThRjdw1.js';
|
|
3
|
+
import { k as render$1 } from './index-CUPvK0Aa.js';
|
|
4
|
+
import { s as styleInject } from './style-inject.es-tgCJW-Cu.js';
|
|
5
|
+
|
|
6
|
+
var handleIntersect = function handleIntersect(entries, observer) {
|
|
7
|
+
entries.forEach(function (entry) {
|
|
8
|
+
if (entry.isIntersecting) {
|
|
9
|
+
loadImage(entry.target);
|
|
10
|
+
observer.unobserve(entry.target);
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
};
|
|
14
|
+
var createObserver = function createObserver(el) {
|
|
15
|
+
var options = {
|
|
16
|
+
root: null,
|
|
17
|
+
threshold: Number(el.getAttribute('threshold')) || 0
|
|
18
|
+
};
|
|
19
|
+
var observer = new IntersectionObserver(handleIntersect, options);
|
|
20
|
+
observer.observe(el);
|
|
21
|
+
};
|
|
22
|
+
var loadImage = function loadImage(el) {
|
|
23
|
+
var imageElement = Array.from(el.children).find(function (element) {
|
|
24
|
+
return element.nodeName === 'IMG';
|
|
25
|
+
});
|
|
26
|
+
if (imageElement) {
|
|
27
|
+
var type = el.getAttribute('type');
|
|
28
|
+
var url = imageElement.dataset.url;
|
|
29
|
+
var setImgError = function setImgError() {
|
|
30
|
+
setTimeout(function () {
|
|
31
|
+
return el.classList.add('fw-image--loaded-error');
|
|
32
|
+
}, 100);
|
|
33
|
+
setTimeout(function () {
|
|
34
|
+
var _el$querySelector;
|
|
35
|
+
return (_el$querySelector = el.querySelector('.fw-image--loading')) === null || _el$querySelector === void 0 ? void 0 : _el$querySelector.remove();
|
|
36
|
+
}, 600);
|
|
37
|
+
};
|
|
38
|
+
if (url) {
|
|
39
|
+
imageElement.src = url;
|
|
40
|
+
} else {
|
|
41
|
+
setImgError();
|
|
42
|
+
}
|
|
43
|
+
imageElement.addEventListener('load', function () {
|
|
44
|
+
setTimeout(function () {
|
|
45
|
+
return el.classList.add('fw-image--loaded');
|
|
46
|
+
}, 100);
|
|
47
|
+
setTimeout(function () {
|
|
48
|
+
var _el$querySelector2;
|
|
49
|
+
return (_el$querySelector2 = el.querySelector('.fw-image--loading')) === null || _el$querySelector2 === void 0 ? void 0 : _el$querySelector2.remove();
|
|
50
|
+
}, 600);
|
|
51
|
+
});
|
|
52
|
+
imageElement.addEventListener('error', function () {
|
|
53
|
+
setImgError();
|
|
54
|
+
});
|
|
55
|
+
if (type === 'background') {
|
|
56
|
+
el.style.backgroundImage = "url('".concat(url, "')");
|
|
57
|
+
imageElement.classList.add('!invisible');
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
var lazyLoadDirective = {
|
|
62
|
+
mounted: function mounted(el) {
|
|
63
|
+
if (window.IntersectionObserver) {
|
|
64
|
+
createObserver(el);
|
|
65
|
+
} else {
|
|
66
|
+
loadImage(el);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
var script = defineComponent({
|
|
72
|
+
name: 'FwImage',
|
|
73
|
+
directives: {
|
|
74
|
+
lazyload: lazyLoadDirective
|
|
75
|
+
},
|
|
76
|
+
emits: ['click', 'mouseover', 'mouseout'],
|
|
77
|
+
components: {
|
|
78
|
+
FwLoadingBar: script$1,
|
|
79
|
+
FileExclamationSvg: render$1
|
|
80
|
+
},
|
|
81
|
+
props: {
|
|
82
|
+
/**
|
|
83
|
+
* The src attribute of the image
|
|
84
|
+
*/
|
|
85
|
+
src: String,
|
|
86
|
+
/**
|
|
87
|
+
* The alt attribute of the image
|
|
88
|
+
*/
|
|
89
|
+
alt: String,
|
|
90
|
+
/**
|
|
91
|
+
* The type of component. Accepts 'background' and defaults to the native html5 element.
|
|
92
|
+
*/
|
|
93
|
+
type: {
|
|
94
|
+
type: String,
|
|
95
|
+
"default": 'native',
|
|
96
|
+
validator: function validator(value) {
|
|
97
|
+
return ['native', 'background'].includes(value);
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
/**
|
|
101
|
+
* Whether the loading bar and error state are rounded.
|
|
102
|
+
*/
|
|
103
|
+
rounded: {
|
|
104
|
+
type: Boolean,
|
|
105
|
+
"default": false
|
|
106
|
+
},
|
|
107
|
+
/**
|
|
108
|
+
* The class for the native image element
|
|
109
|
+
*/
|
|
110
|
+
imageClass: {
|
|
111
|
+
type: String
|
|
112
|
+
},
|
|
113
|
+
/**
|
|
114
|
+
* Controls the threshold before the component triggers the src url.
|
|
115
|
+
*/
|
|
116
|
+
threshold: {
|
|
117
|
+
type: Number,
|
|
118
|
+
"default": 0
|
|
119
|
+
},
|
|
120
|
+
/**
|
|
121
|
+
* Controls the error UI when an image src is unavailable.
|
|
122
|
+
*/
|
|
123
|
+
enableErrors: {
|
|
124
|
+
type: Boolean,
|
|
125
|
+
"default": true
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
setup: function setup(props) {
|
|
129
|
+
var isBackground = computed(function () {
|
|
130
|
+
return props.type === 'background';
|
|
131
|
+
});
|
|
132
|
+
var fwImageRef = ref(null);
|
|
133
|
+
return {
|
|
134
|
+
fwImageRef: fwImageRef,
|
|
135
|
+
isBackground: isBackground
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
|
|
140
|
+
var _hoisted_1 = ["type", "threshold"];
|
|
141
|
+
var _hoisted_2 = ["data-url", "alt"];
|
|
142
|
+
var _hoisted_3 = {
|
|
143
|
+
"class": "fw-image--error-wrapper flex flex-col items-center justify-center"
|
|
144
|
+
};
|
|
145
|
+
function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
146
|
+
var _component_FwLoadingBar = resolveComponent("FwLoadingBar");
|
|
147
|
+
var _component_FileExclamationSvg = resolveComponent("FileExclamationSvg");
|
|
148
|
+
var _directive_lazyload = resolveDirective("lazyload");
|
|
149
|
+
return withDirectives((openBlock(), createElementBlock("div", {
|
|
150
|
+
ref: "fwImageRef",
|
|
151
|
+
type: _ctx.type,
|
|
152
|
+
threshold: _ctx.threshold,
|
|
153
|
+
"class": normalizeClass(["fw-image", {
|
|
154
|
+
'fw-image--background': _ctx.isBackground,
|
|
155
|
+
'rounded-full': _ctx.rounded
|
|
156
|
+
}]),
|
|
157
|
+
onClick: _cache[0] || (_cache[0] = function ($event) {
|
|
158
|
+
return _ctx.$emit('click', $event);
|
|
159
|
+
}),
|
|
160
|
+
onKeyup: _cache[1] || (_cache[1] = withKeys(function ($event) {
|
|
161
|
+
return _ctx.$emit('click', $event);
|
|
162
|
+
}, ["enter"])),
|
|
163
|
+
onMouseover: _cache[2] || (_cache[2] = function ($event) {
|
|
164
|
+
return _ctx.$emit('mouseover');
|
|
165
|
+
}),
|
|
166
|
+
onMouseout: _cache[3] || (_cache[3] = function ($event) {
|
|
167
|
+
return _ctx.$emit('mouseout');
|
|
168
|
+
}),
|
|
169
|
+
onFocusin: _cache[4] || (_cache[4] = function ($event) {
|
|
170
|
+
return _ctx.$emit('mouseover');
|
|
171
|
+
}),
|
|
172
|
+
onFocusout: _cache[5] || (_cache[5] = function ($event) {
|
|
173
|
+
return _ctx.$emit('mouseout');
|
|
174
|
+
})
|
|
175
|
+
}, [createElementVNode("img", {
|
|
176
|
+
"data-url": _ctx.src,
|
|
177
|
+
alt: _ctx.alt,
|
|
178
|
+
loading: "lazy",
|
|
179
|
+
"class": normalizeClass([_ctx.rounded ? 'rounded-full' : '', _ctx.imageClass])
|
|
180
|
+
}, null, 10, _hoisted_2), createVNode(_component_FwLoadingBar, {
|
|
181
|
+
"class": normalizeClass(["fw-image--loading w-full h-full", {
|
|
182
|
+
'rounded-full': _ctx.rounded
|
|
183
|
+
}])
|
|
184
|
+
}, null, 8, ["class"]), createElementVNode("div", {
|
|
185
|
+
"class": normalizeClass(["fw-image--error rounded bg-grey-20", {
|
|
186
|
+
'rounded-full': _ctx.rounded
|
|
187
|
+
}])
|
|
188
|
+
}, [createElementVNode("div", _hoisted_3, [_ctx.enableErrors ? (openBlock(), createBlock(_component_FileExclamationSvg, {
|
|
189
|
+
key: 0,
|
|
190
|
+
"class": "w-full h-full scale-[0.25] opacity-40 text-alert max-w-[150px]"
|
|
191
|
+
})) : createCommentVNode("", true)])], 2), renderSlot(_ctx.$slots, "default")], 42, _hoisted_1)), [[_directive_lazyload]]);
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
var css_248z = ".fw-image{position:relative}.fw-image img{-webkit-transition:all .5s ease-in-out;-moz-transition:all .5s ease-in-out;transition:all .5s ease-in-out}.fw-image img,.fw-image--error{opacity:0;visibility:hidden;width:100%}.fw-image--error{height:100%;left:0;position:relative;position:absolute;top:0;-webkit-transition:all .5s ease-in;-moz-transition:all .5s ease-in;transition:all .5s ease-in}.fw-image--error-wrapper{font-size:inherit;left:50%;position:absolute;text-align:center;top:50%;-webkit-transform:translate(-50%,-50%);-moz-transform:translate(-50%,-50%);-ms-transform:translate(-50%,-50%);transform:translate(-50%,-50%);width:100%}.fw-image--loading{height:100%;left:0;position:absolute!important;top:0;-webkit-transition:all .5s ease-in-out;-moz-transition:all .5s ease-in-out;transition:all .5s ease-in-out;width:100%}.fw-image--loaded img,.fw-image--loading{opacity:1;visibility:visible}.fw-image--loaded .fw-image--loading{opacity:0;visibility:hidden;width:100%}.fw-image--loaded-error img{display:none}.fw-image--loaded-error .fw-image--error{opacity:1;visibility:visible}.fw-image--background{background-position:50%;background-repeat:no-repeat;background-size:cover}";
|
|
195
|
+
var stylesheet = ".fw-image{position:relative}.fw-image img{-webkit-transition:all .5s ease-in-out;-moz-transition:all .5s ease-in-out;transition:all .5s ease-in-out}.fw-image img,.fw-image--error{opacity:0;visibility:hidden;width:100%}.fw-image--error{height:100%;left:0;position:relative;position:absolute;top:0;-webkit-transition:all .5s ease-in;-moz-transition:all .5s ease-in;transition:all .5s ease-in}.fw-image--error-wrapper{font-size:inherit;left:50%;position:absolute;text-align:center;top:50%;-webkit-transform:translate(-50%,-50%);-moz-transform:translate(-50%,-50%);-ms-transform:translate(-50%,-50%);transform:translate(-50%,-50%);width:100%}.fw-image--loading{height:100%;left:0;position:absolute!important;top:0;-webkit-transition:all .5s ease-in-out;-moz-transition:all .5s ease-in-out;transition:all .5s ease-in-out;width:100%}.fw-image--loaded img,.fw-image--loading{opacity:1;visibility:visible}.fw-image--loaded .fw-image--loading{opacity:0;visibility:hidden;width:100%}.fw-image--loaded-error img{display:none}.fw-image--loaded-error .fw-image--error{opacity:1;visibility:visible}.fw-image--background{background-position:50%;background-repeat:no-repeat;background-size:cover}";
|
|
196
|
+
styleInject(css_248z);
|
|
197
|
+
|
|
198
|
+
script.render = render;
|
|
199
|
+
|
|
200
|
+
export { script as s };
|
package/esm/fw-image.js
CHANGED
|
@@ -1,22 +1,6 @@
|
|
|
1
|
-
export { s as FwImage } from './fw-image-
|
|
2
|
-
import './es.array.includes-08e25019.js';
|
|
3
|
-
import './is-forced-7cb3ee8f.js';
|
|
4
|
-
import './export-10c4adbc.js';
|
|
5
|
-
import './add-to-unscopables-ee05b58f.js';
|
|
6
|
-
import './object-create-51bf02dc.js';
|
|
7
|
-
import './es.number.constructor-fb16fe05.js';
|
|
8
|
-
import './classof-d44bf093.js';
|
|
1
|
+
export { s as FwImage } from './fw-image-DOgM8i8X.js';
|
|
9
2
|
import 'vue';
|
|
10
|
-
import './
|
|
11
|
-
import './
|
|
12
|
-
import './
|
|
13
|
-
import './
|
|
14
|
-
import './es.array.find-1ded15d5.js';
|
|
15
|
-
import './es.string.iterator-25db8cd2.js';
|
|
16
|
-
import './create-property-eb329361.js';
|
|
17
|
-
import './web.timers-e406c8e6.js';
|
|
18
|
-
import './function-apply-e17cf65b.js';
|
|
19
|
-
import './fw-loading-bar-f5ca605c.js';
|
|
20
|
-
import './style-inject.es-1f59c1d0.js';
|
|
21
|
-
import './index-bced3b35.js';
|
|
22
|
-
import './check-94a5917a.js';
|
|
3
|
+
import './fw-loading-bar-DThRjdw1.js';
|
|
4
|
+
import './style-inject.es-tgCJW-Cu.js';
|
|
5
|
+
import './index-CUPvK0Aa.js';
|
|
6
|
+
import './check--YD4Ts6g.js';
|