@frollo/frollo-web-ui 9.0.1 → 9.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/cjs/index.js +10733 -3060
- package/esm/{_rollupPluginBabelHelpers-DODWUb5N.js → _rollupPluginBabelHelpers-BKlDnZ7n.js} +1 -1
- package/esm/fw-accordion.js +15 -18
- package/esm/fw-alert.js +32 -25
- package/esm/fw-bar-chart.js +265 -93
- package/esm/fw-button-DZTHZLjk.js +318 -0
- package/esm/fw-button.js +2 -2
- package/esm/{fw-card-D45R4kN-.js → fw-card-XGtsK2bM.js} +7 -10
- package/esm/fw-card.js +2 -2
- package/esm/fw-checkbox.js +8 -11
- package/esm/fw-date-picker.js +85 -49
- package/esm/fw-drawer.js +8 -8
- package/esm/{fw-dropdown-58wyuzsW.js → fw-dropdown-CSmYTm5O.js} +11 -14
- package/esm/fw-dropdown.js +7 -6
- package/esm/fw-form.js +1 -1
- package/esm/fw-icons.js +11 -12
- package/esm/fw-image-A2lXYs0u.js +325 -0
- package/esm/fw-image.js +5 -4
- package/esm/{fw-input-C2-cZ-BY.js → fw-input-BiPWWfK3.js} +12 -19
- package/esm/fw-input.js +3 -3
- package/esm/fw-loading-bar-3x4tkF1B.js +37 -0
- package/esm/fw-loading.js +89 -40
- package/esm/fw-media-picker.js +10 -653
- package/esm/fw-modal.js +11 -10
- package/esm/fw-navigation-menu.js +36 -41
- package/esm/fw-popover-BZ-zqUme.js +330 -0
- package/esm/fw-popover.js +2 -3
- package/esm/fw-progress-bar.js +1 -1
- package/esm/fw-provider-list.js +109 -87
- package/esm/fw-sidebar-menu.js +58 -51
- package/esm/fw-slider.js +64 -61
- package/esm/fw-switch.js +76 -49
- package/esm/fw-table-row-D6FdCJMs.js +447 -0
- package/esm/fw-table.js +5 -6
- package/esm/fw-tabs.js +87 -35
- package/esm/fw-tag-BRxPc4zc.js +199 -0
- package/esm/fw-tag.js +4 -4
- package/esm/fw-toast.js +58 -76
- package/esm/fw-transactions-card.js +20 -20
- package/esm/{get-root-colours-DCjlYelc.js → get-root-colours-DCCAnRF4.js} +3 -1
- package/esm/index-C8z11jcJ.js +7583 -0
- package/esm/index-DHyRsKsZ.js +843 -0
- package/esm/index-eP2GMSdQ.js +755 -0
- package/esm/index.js +54 -61
- package/esm/{uniqueId-DZdGzBh8.js → uniqueId-DK6xzFd8.js} +1 -1
- package/esm/{vee-validate.esm-3ptvCDR1.js → vee-validate-0dtT5GSQ.js} +182 -305
- package/frollo-web-ui.esm.js +10790 -3115
- package/icons/circle-check.svg +4 -0
- package/index.d.ts +1522 -586
- package/package.json +11 -11
- package/types/components/fw-accordion/fw-accordion.vue.d.ts +9 -7
- package/types/components/fw-alert/fw-alert.vue.d.ts +11 -6
- package/types/components/fw-bar-chart/fw-bar-chart.vue.d.ts +15 -64
- package/types/components/fw-button/fw-button.vue.d.ts +11 -7
- package/types/components/fw-card/fw-card.vue.d.ts +6 -6
- package/types/components/fw-checkbox/fw-checkbox.vue.d.ts +365 -5
- package/types/components/fw-date-picker/fw-date-picker.vue.d.ts +3 -242
- package/types/components/fw-drawer/fw-drawer.vue.d.ts +11 -8
- package/types/components/fw-dropdown/fw-dropdown.vue.d.ts +20 -12
- package/types/components/fw-icons/fw-success-animation.vue.d.ts +1 -1
- package/types/components/fw-image/fw-image.vue.d.ts +33 -7
- package/types/components/fw-input/fw-input.vue.d.ts +368 -10
- package/types/components/fw-loading/fw-loading-bar.vue.d.ts +7 -5
- package/types/components/fw-loading/fw-loading-card.vue.d.ts +3 -1
- package/types/components/fw-loading/fw-loading-dots.vue.d.ts +8 -1
- package/types/components/fw-loading/fw-loading-table.vue.d.ts +11 -6
- package/types/components/fw-media-picker/fw-media-picker.vue.d.ts +27 -18
- package/types/components/fw-modal/fw-modal.vue.d.ts +11 -7
- package/types/components/fw-navigation-menu/fw-navigation-menu.vue.d.ts +12 -8
- package/types/components/fw-popover/fw-popover.vue.d.ts +16 -21
- package/types/components/fw-progress-bar/fw-progress-bar.vue.d.ts +6 -4
- package/types/components/fw-provider-list/fw-provider-list.vue.d.ts +20 -45
- package/types/components/fw-sidebar-menu/fw-sidebar-menu.vue.d.ts +13 -7
- package/types/components/fw-slider/fw-slider.vue.d.ts +11 -8
- package/types/components/fw-switch/fw-switch.vue.d.ts +383 -9
- package/types/components/fw-switch/index.types.d.ts +1 -0
- package/types/components/fw-table/fw-table-head.vue.d.ts +1 -1
- package/types/components/fw-table/fw-table-row.vue.d.ts +1 -1
- package/types/components/fw-table/fw-table.vue.d.ts +40 -19
- package/types/components/fw-table/index.types.d.ts +36 -2
- package/types/components/fw-tabs/fw-tab.vue.d.ts +4 -8
- package/types/components/fw-tabs/fw-tabs.vue.d.ts +11 -8
- package/types/components/fw-tabs/index.types.d.ts +14 -4
- package/types/components/fw-tag/fw-tag.vue.d.ts +14 -8
- package/types/components/fw-toast/fw-toast.vue.d.ts +17 -22
- package/types/components/fw-transactions-card/fw-transactions-card.vue.d.ts +6 -3
- package/types/directives/lazy-loader.d.ts +11 -2
- package/types/helpers/get-root-colours.d.ts +1 -0
- package/web-components/index.js +16793 -7700
- package/esm/fw-button-YMoW4x4c.js +0 -296
- package/esm/fw-image-D-OHafdw.js +0 -217
- package/esm/fw-loading-bar-DecYSBC_.js +0 -45
- package/esm/fw-popover-B4bsfuxm.js +0 -620
- package/esm/fw-table-row-Cgi8871h.js +0 -389
- package/esm/fw-tag-fDo50Nw7.js +0 -177
- package/esm/index-BsEH8YYr.js +0 -979
package/esm/fw-slider.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { defineComponent, computed, watch, createElementBlock, openBlock, createElementVNode, withDirectives, normalizeStyle, toDisplayString, vModelText } from 'vue';
|
|
1
|
+
import { defineComponent, ref, watch, computed, createElementBlock, openBlock, createElementVNode, withDirectives, normalizeStyle, toDisplayString, vModelText } from 'vue';
|
|
3
2
|
import { s as styleInject } from './style-inject.es-tgCJW-Cu.js';
|
|
4
3
|
|
|
4
|
+
var clamp = function clamp(v, lo, hi) {
|
|
5
|
+
return Math.min(Math.max(v, lo), hi);
|
|
6
|
+
};
|
|
5
7
|
var script = defineComponent({
|
|
6
8
|
name: 'FwSlider',
|
|
7
9
|
emits: ['update:minValue', 'update:maxValue'],
|
|
@@ -27,72 +29,75 @@ var script = defineComponent({
|
|
|
27
29
|
"default": null
|
|
28
30
|
}
|
|
29
31
|
},
|
|
30
|
-
setup: function setup(props,
|
|
31
|
-
var
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}
|
|
39
|
-
});
|
|
40
|
-
var maximumValue = computed({
|
|
41
|
-
get: function get() {
|
|
42
|
-
var _props$maxValue;
|
|
43
|
-
return (_props$maxValue = props.maxValue) !== null && _props$maxValue !== void 0 ? _props$maxValue : props.max;
|
|
44
|
-
},
|
|
45
|
-
set: function set(state) {
|
|
46
|
-
return ctx.emit('update:maxValue', state);
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
// stop the thumbs from pushing each other around
|
|
50
|
-
watch([function () {
|
|
32
|
+
setup: function setup(props, _ref) {
|
|
33
|
+
var _props$minValue, _props$maxValue;
|
|
34
|
+
var emit = _ref.emit;
|
|
35
|
+
// Internal thumbs
|
|
36
|
+
var minLocal = ref((_props$minValue = props.minValue) !== null && _props$minValue !== void 0 ? _props$minValue : props.min);
|
|
37
|
+
var maxLocal = ref((_props$maxValue = props.maxValue) !== null && _props$maxValue !== void 0 ? _props$maxValue : props.max);
|
|
38
|
+
// --- Sync from props -> local (when parent updates) ---
|
|
39
|
+
watch(function () {
|
|
51
40
|
return props.minValue;
|
|
52
|
-
}, function () {
|
|
41
|
+
}, function (v) {
|
|
42
|
+
if (v == null) return;
|
|
43
|
+
minLocal.value = clamp(+v, props.min, maxLocal.value);
|
|
44
|
+
}, {
|
|
45
|
+
immediate: true
|
|
46
|
+
});
|
|
47
|
+
watch(function () {
|
|
53
48
|
return props.maxValue;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
newMax = _ref3[1];
|
|
58
|
-
var _ref4 = _slicedToArray(_ref2, 2),
|
|
59
|
-
oldMin = _ref4[0],
|
|
60
|
-
oldMax = _ref4[1];
|
|
61
|
-
if (newMin !== oldMin) {
|
|
62
|
-
if (newMin != null) {
|
|
63
|
-
minimumValue.value = Math.min(Math.max(Number(newMin), props.min), maximumValue.value);
|
|
64
|
-
}
|
|
65
|
-
return;
|
|
66
|
-
}
|
|
67
|
-
if (newMax !== oldMax) {
|
|
68
|
-
if (newMax != null) {
|
|
69
|
-
maximumValue.value = Math.max(Math.min(Number(newMax), props.max), minimumValue.value);
|
|
70
|
-
}
|
|
71
|
-
}
|
|
49
|
+
}, function (v) {
|
|
50
|
+
if (v == null) return;
|
|
51
|
+
maxLocal.value = clamp(+v, minLocal.value, props.max);
|
|
72
52
|
}, {
|
|
73
53
|
immediate: true
|
|
74
54
|
});
|
|
55
|
+
// --- Clamp + emit local -> parent (when user drags) ---
|
|
56
|
+
watch(minLocal, function (v, old) {
|
|
57
|
+
var _props$minValue2;
|
|
58
|
+
var clamped = clamp(v, props.min, maxLocal.value);
|
|
59
|
+
if (clamped !== v) minLocal.value = clamped;
|
|
60
|
+
if (clamped !== ((_props$minValue2 = props.minValue) !== null && _props$minValue2 !== void 0 ? _props$minValue2 : props.min) && clamped !== old) {
|
|
61
|
+
emit('update:minValue', clamped);
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
watch(maxLocal, function (v, old) {
|
|
65
|
+
var _props$maxValue2;
|
|
66
|
+
var clamped = clamp(v, minLocal.value, props.max);
|
|
67
|
+
if (clamped !== v) maxLocal.value = clamped;
|
|
68
|
+
if (clamped !== ((_props$maxValue2 = props.maxValue) !== null && _props$maxValue2 !== void 0 ? _props$maxValue2 : props.max) && clamped !== old) {
|
|
69
|
+
emit('update:maxValue', clamped);
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
var range = computed(function () {
|
|
73
|
+
return props.max - props.min || 1;
|
|
74
|
+
});
|
|
75
75
|
var minPercentage = computed(function () {
|
|
76
|
-
return (
|
|
76
|
+
return (minLocal.value - props.min) / range.value * 100;
|
|
77
77
|
});
|
|
78
78
|
var maxPercentage = computed(function () {
|
|
79
|
-
return (
|
|
79
|
+
return (maxLocal.value - props.min) / range.value * 100;
|
|
80
80
|
});
|
|
81
81
|
var clippingPoint = computed(function () {
|
|
82
82
|
return maxPercentage.value - minPercentage.value >= 3;
|
|
83
83
|
});
|
|
84
|
+
var trackStyle = computed(function () {
|
|
85
|
+
return {
|
|
86
|
+
background: "linear-gradient(to right,\n var(--track, #ffffff) 0%,\n var(--track, #ffffff) ".concat(minPercentage.value, "%,\n var(--fill) ").concat(minPercentage.value, "%,\n var(--fill) ").concat(maxPercentage.value, "%,\n var(--track, #ffffff) ").concat(maxPercentage.value, "%,\n var(--track, #ffffff) 100%)")
|
|
87
|
+
};
|
|
88
|
+
});
|
|
84
89
|
return {
|
|
85
|
-
|
|
86
|
-
|
|
90
|
+
minLocal: minLocal,
|
|
91
|
+
maxLocal: maxLocal,
|
|
87
92
|
minPercentage: minPercentage,
|
|
88
93
|
maxPercentage: maxPercentage,
|
|
89
|
-
clippingPoint: clippingPoint
|
|
94
|
+
clippingPoint: clippingPoint,
|
|
95
|
+
trackStyle: trackStyle
|
|
90
96
|
};
|
|
91
97
|
}
|
|
92
98
|
});
|
|
93
99
|
|
|
94
100
|
var _hoisted_1 = {
|
|
95
|
-
ref: "slider",
|
|
96
101
|
"class": "relative py-3"
|
|
97
102
|
};
|
|
98
103
|
var _hoisted_2 = ["min", "max", "step"];
|
|
@@ -103,31 +108,29 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
103
108
|
style: normalizeStyle({
|
|
104
109
|
left: "".concat(_ctx.minPercentage, "%")
|
|
105
110
|
})
|
|
106
|
-
}, toDisplayString(_ctx.
|
|
111
|
+
}, toDisplayString(_ctx.minLocal) + "% ", 5), createElementVNode("p", {
|
|
107
112
|
"class": "absolute -top-6 -translate-x-1/2 text-base text-[var(--colorButtonPrimary)] font-semibold",
|
|
108
113
|
style: normalizeStyle({
|
|
109
114
|
left: "".concat(_ctx.maxPercentage, "%")
|
|
110
115
|
})
|
|
111
|
-
}, toDisplayString(_ctx.
|
|
116
|
+
}, toDisplayString(_ctx.maxLocal) + "% ", 5), createElementVNode("div", {
|
|
112
117
|
"class": "h-1.5 rounded-full bg-white shadow-card [--fill:var(--colorButtonPrimary)]",
|
|
113
|
-
style: normalizeStyle(
|
|
114
|
-
background: "linear-gradient(to right,\n var(--track, #ffffff) 0%,\n var(--track, #ffffff) ".concat(_ctx.minPercentage, "%,\n var(--fill) ").concat(_ctx.minPercentage, "%,\n var(--fill) ").concat(_ctx.maxPercentage, "%,\n var(--track, #ffffff) ").concat(_ctx.maxPercentage, "%,\n var(--track, #ffffff) 100%)")
|
|
115
|
-
})
|
|
118
|
+
style: normalizeStyle(_ctx.trackStyle)
|
|
116
119
|
}, null, 4), withDirectives(createElementVNode("input", {
|
|
117
120
|
"class": "fw-slider absolute inset-0 w-full appearance-none bg-transparent pointer-events-none focus:outline-none",
|
|
118
121
|
type: "range",
|
|
119
122
|
name: "min",
|
|
120
123
|
id: "min",
|
|
121
|
-
"onUpdate:modelValue": _cache[0] || (_cache[0] = function ($event) {
|
|
122
|
-
return _ctx.minimumValue = $event;
|
|
123
|
-
}),
|
|
124
124
|
min: _ctx.min,
|
|
125
125
|
max: _ctx.max,
|
|
126
126
|
step: _ctx.step,
|
|
127
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = function ($event) {
|
|
128
|
+
return _ctx.minLocal = $event;
|
|
129
|
+
}),
|
|
127
130
|
style: normalizeStyle({
|
|
128
131
|
zIndex: _ctx.clippingPoint ? 20 : 30
|
|
129
132
|
})
|
|
130
|
-
}, null, 12, _hoisted_2), [[vModelText, _ctx.
|
|
133
|
+
}, null, 12, _hoisted_2), [[vModelText, _ctx.minLocal, void 0, {
|
|
131
134
|
number: true
|
|
132
135
|
}]]), withDirectives(createElementVNode("input", {
|
|
133
136
|
"class": "fw-slider absolute inset-0 w-full appearance-none bg-transparent pointer-events-none focus:outline-none",
|
|
@@ -136,16 +139,16 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
136
139
|
id: "max",
|
|
137
140
|
min: _ctx.min,
|
|
138
141
|
max: _ctx.max,
|
|
142
|
+
step: _ctx.step,
|
|
139
143
|
"onUpdate:modelValue": _cache[1] || (_cache[1] = function ($event) {
|
|
140
|
-
return _ctx.
|
|
144
|
+
return _ctx.maxLocal = $event;
|
|
141
145
|
}),
|
|
142
|
-
step: _ctx.step,
|
|
143
146
|
style: normalizeStyle({
|
|
144
147
|
zIndex: _ctx.clippingPoint ? 30 : 20
|
|
145
148
|
})
|
|
146
|
-
}, null, 12, _hoisted_3), [[vModelText, _ctx.
|
|
149
|
+
}, null, 12, _hoisted_3), [[vModelText, _ctx.maxLocal, void 0, {
|
|
147
150
|
number: true
|
|
148
|
-
}]])]
|
|
151
|
+
}]])]);
|
|
149
152
|
}
|
|
150
153
|
|
|
151
154
|
var css_248z = ".fw-slider::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;background:var(--colorButtonPrimary);border:2px solid var(--colorButtonPrimary);border-radius:9999px;-webkit-box-shadow:var(--tw-shadow);box-shadow:var(--tw-shadow);cursor:pointer;height:1.5rem;pointer-events:auto;width:1.5rem}.fw-slider::-moz-range-thumb{background:var(--colorButtonPrimary);border:2px solid var(--colorButtonPrimary);border-radius:9999px;box-shadow:var(--tw-shadow);cursor:pointer;height:1.5rem;pointer-events:auto;width:1.5rem}";
|
package/esm/fw-switch.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { defineComponent, ref,
|
|
2
|
-
import { a as Field } from './vee-validate
|
|
3
|
-
import { u as uniqueId } from './uniqueId-DZdGzBh8.js';
|
|
1
|
+
import { defineComponent, ref, watch, computed, resolveComponent, createBlock, openBlock, withCtx, createElementVNode, createElementBlock, createCommentVNode, mergeProps, normalizeClass, createVNode, Transition, toDisplayString } from 'vue';
|
|
2
|
+
import { a as Field } from './vee-validate-0dtT5GSQ.js';
|
|
4
3
|
import { s as styleInject } from './style-inject.es-tgCJW-Cu.js';
|
|
5
4
|
|
|
6
5
|
var script = defineComponent({
|
|
@@ -43,6 +42,11 @@ var script = defineComponent({
|
|
|
43
42
|
type: Boolean,
|
|
44
43
|
"default": true
|
|
45
44
|
},
|
|
45
|
+
/** v-model If provided, it is the source of truth. */
|
|
46
|
+
modelValue: {
|
|
47
|
+
type: Boolean,
|
|
48
|
+
required: false
|
|
49
|
+
},
|
|
46
50
|
/**
|
|
47
51
|
* Progmatically set the checked state of the input.
|
|
48
52
|
* Used outside a FwForm element
|
|
@@ -53,57 +57,72 @@ var script = defineComponent({
|
|
|
53
57
|
"default": false
|
|
54
58
|
}
|
|
55
59
|
},
|
|
56
|
-
emits: ['change'],
|
|
60
|
+
emits: ['change', 'update:modelValue', 'update:isChecked'],
|
|
57
61
|
setup: function setup(props, ctx) {
|
|
58
|
-
var
|
|
59
|
-
var
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
62
|
+
var _props$modelValue;
|
|
63
|
+
var localChecked = ref((_props$modelValue = props.modelValue) !== null && _props$modelValue !== void 0 ? _props$modelValue : props.isChecked);
|
|
64
|
+
watch(function () {
|
|
65
|
+
return props.modelValue;
|
|
66
|
+
}, function (val) {
|
|
67
|
+
if (val && val !== localChecked.value) {
|
|
68
|
+
localChecked.value = val;
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
watch(function () {
|
|
72
|
+
return props.isChecked;
|
|
73
|
+
}, function (val) {
|
|
74
|
+
if (props.modelValue && val !== localChecked.value) {
|
|
75
|
+
localChecked.value = val;
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
var checked = computed(function () {
|
|
79
|
+
return localChecked.value;
|
|
80
|
+
});
|
|
81
|
+
var resolvedValue = computed(function () {
|
|
82
|
+
var _props$value;
|
|
83
|
+
return (_props$value = props.value) !== null && _props$value !== void 0 ? _props$value : props.name;
|
|
84
|
+
});
|
|
85
|
+
var inputId = "fw-switch-".concat(props.name, "-").concat(Math.random().toString(36).slice(2));
|
|
86
|
+
var onNativeChange = function onNativeChange(e) {
|
|
87
|
+
var next = e.target.checked;
|
|
88
|
+
localChecked.value = next;
|
|
89
|
+
// always emit change
|
|
90
|
+
ctx.emit('change', next);
|
|
91
|
+
// if using v-model, update it
|
|
92
|
+
ctx.emit('update:modelValue', next);
|
|
93
|
+
// keep legacy API in sync too
|
|
94
|
+
ctx.emit('update:isChecked', next);
|
|
63
95
|
};
|
|
64
96
|
return {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
97
|
+
checked: checked,
|
|
98
|
+
onNativeChange: onNativeChange,
|
|
99
|
+
inputId: inputId,
|
|
100
|
+
resolvedValue: resolvedValue
|
|
68
101
|
};
|
|
69
102
|
}
|
|
70
103
|
});
|
|
71
104
|
|
|
72
|
-
var _withScopeId = function _withScopeId(n) {
|
|
73
|
-
return pushScopeId("data-v-0adb13d4"), n = n(), popScopeId(), n;
|
|
74
|
-
};
|
|
75
105
|
var _hoisted_1 = {
|
|
76
|
-
"class": "flex flex-col"
|
|
106
|
+
"class": "flex flex-col w-fit"
|
|
77
107
|
};
|
|
78
|
-
var _hoisted_2 =
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
}, null, -1);
|
|
82
|
-
});
|
|
83
|
-
var _hoisted_3 = [_hoisted_2];
|
|
84
|
-
var _hoisted_4 = ["for"];
|
|
85
|
-
var _hoisted_5 = ["id", "value", "name", "checked"];
|
|
86
|
-
var _hoisted_6 = {
|
|
108
|
+
var _hoisted_2 = ["for"];
|
|
109
|
+
var _hoisted_3 = ["name", "id", "aria-label", "aria-invalid", "checked", "value"];
|
|
110
|
+
var _hoisted_4 = {
|
|
87
111
|
key: 0,
|
|
88
112
|
"class": "italic text-sm font-medium min-h-[21px]"
|
|
89
113
|
};
|
|
90
|
-
var
|
|
114
|
+
var _hoisted_5 = {
|
|
91
115
|
key: 0,
|
|
92
116
|
"class": "text-brand-error-text"
|
|
93
117
|
};
|
|
94
|
-
var
|
|
118
|
+
var _hoisted_6 = {
|
|
95
119
|
key: 1
|
|
96
120
|
};
|
|
97
121
|
function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
98
122
|
var _component_InputField = resolveComponent("InputField");
|
|
99
|
-
return openBlock(),
|
|
100
|
-
"class": "fw-switch rounded-full ring-primary ring-offset-1 focus:outline-0 focus:ring-none focus-visible:outline-0 focus-visible:ring-2",
|
|
101
|
-
onClick: _cache[0] || (_cache[0] = function ($event) {
|
|
102
|
-
return _ctx.toggleSwitch();
|
|
103
|
-
})
|
|
104
|
-
}, [createVNode(_component_InputField, {
|
|
123
|
+
return openBlock(), createBlock(_component_InputField, {
|
|
105
124
|
name: _ctx.name,
|
|
106
|
-
value: _ctx.
|
|
125
|
+
value: _ctx.resolvedValue,
|
|
107
126
|
type: "checkbox",
|
|
108
127
|
rules: _ctx.rules
|
|
109
128
|
}, {
|
|
@@ -112,36 +131,44 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
112
131
|
errors = _ref.errors,
|
|
113
132
|
errorMessage = _ref.errorMessage,
|
|
114
133
|
meta = _ref.meta;
|
|
115
|
-
return [createElementVNode("div", _hoisted_1, [createElementVNode("
|
|
116
|
-
"
|
|
117
|
-
|
|
118
|
-
"for": "fw-switch-".concat(_ctx.name, "-").concat(_ctx.uuid),
|
|
119
|
-
"class": "hidden"
|
|
134
|
+
return [createElementVNode("div", _hoisted_1, [createElementVNode("label", {
|
|
135
|
+
"for": _ctx.inputId,
|
|
136
|
+
"class": "fw-switch !ring-0 hover:brightness-90"
|
|
120
137
|
}, [createElementVNode("input", mergeProps(field, {
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
138
|
+
name: _ctx.inputId,
|
|
139
|
+
id: _ctx.inputId,
|
|
140
|
+
"class": "sr-only",
|
|
141
|
+
"aria-label": "Checkbox for ".concat(_ctx.inputId),
|
|
142
|
+
"aria-invalid": !!((errorMessage || errors[0]) && meta.touched),
|
|
124
143
|
type: "checkbox",
|
|
125
|
-
checked: _ctx.
|
|
126
|
-
|
|
144
|
+
checked: _ctx.checked,
|
|
145
|
+
value: _ctx.resolvedValue,
|
|
146
|
+
onChange: _cache[0] || (_cache[0] = function () {
|
|
147
|
+
return _ctx.onNativeChange && _ctx.onNativeChange.apply(_ctx, arguments);
|
|
148
|
+
})
|
|
149
|
+
}), null, 16, _hoisted_3), createElementVNode("span", {
|
|
150
|
+
"class": normalizeClass(["track w-[40px] h-[24px] rounded-[20px] relative transition-colors duration-200 ease-out !ring-0 outline-none", _ctx.checked ? 'bg-brand-success-new' : 'bg-brand-text2'])
|
|
151
|
+
}, [createElementVNode("span", {
|
|
152
|
+
"class": normalizeClass(["thumb size-4 rounded-full bg-white absolute top-1 left-1 transition-transform duration-200 ease-out will-change-transform", _ctx.checked ? 'translate-x-4' : 'translate-x-0'])
|
|
153
|
+
}, null, 2)], 2)], 8, _hoisted_2), _ctx.enableErrors ? (openBlock(), createElementBlock("div", _hoisted_4, [createVNode(Transition, {
|
|
127
154
|
name: "fwFadeIn",
|
|
128
155
|
mode: "out-in"
|
|
129
156
|
}, {
|
|
130
157
|
"default": withCtx(function () {
|
|
131
|
-
return [(errorMessage || errors[0]) && meta.touched ? (openBlock(), createElementBlock("span",
|
|
158
|
+
return [(errorMessage || errors[0]) && meta.touched ? (openBlock(), createElementBlock("span", _hoisted_5, toDisplayString(errorMessage || errors[0]), 1)) : _ctx.hint ? (openBlock(), createElementBlock("span", _hoisted_6, toDisplayString(_ctx.hint), 1)) : createCommentVNode("", true)];
|
|
132
159
|
}),
|
|
133
160
|
_: 2
|
|
134
161
|
}, 1024)])) : createCommentVNode("", true)])];
|
|
135
162
|
}),
|
|
136
163
|
_: 1
|
|
137
|
-
}, 8, ["name", "value", "rules"])
|
|
164
|
+
}, 8, ["name", "value", "rules"]);
|
|
138
165
|
}
|
|
139
166
|
|
|
140
|
-
var css_248z = ".fwFadeIn-enter-active[data-v-
|
|
141
|
-
var stylesheet = ".fwFadeIn-enter-active[data-v-
|
|
167
|
+
var css_248z = ".fw-switch[data-v-472a39bf]{-webkit-box-align:center;-moz-box-align:center;-ms-flex-align:center;-webkit-align-items:center;align-items:center;border-radius:9999px;cursor:pointer;display:-webkit-inline-box;display:-webkit-inline-flex;display:-moz-inline-box;display:-ms-inline-flexbox;display:inline-flex}.fwFadeIn-enter-active[data-v-472a39bf]{-webkit-animation:fwFadeIn-472a39bf .35s;-moz-animation:fwFadeIn-472a39bf .35s;animation:fwFadeIn-472a39bf .35s;-webkit-transition:opacity .35s ease-in;-moz-transition:opacity .35s ease-in;transition:opacity .35s ease-in}.fwFadeIn-leave-active[data-v-472a39bf]{animation:fwFadeIn-472a39bf .35s reverse;-webkit-transition:opacity .35s ease-out;-moz-transition:opacity .35s ease-out;transition:opacity .35s ease-out}@-webkit-keyframes fwFadeIn-472a39bf{0%{opacity:0}to{opacity:1}}@-moz-keyframes fwFadeIn-472a39bf{0%{opacity:0}to{opacity:1}}@keyframes fwFadeIn-472a39bf{0%{opacity:0}to{opacity:1}}@media (prefers-reduced-motion:reduce){.thumb[data-v-472a39bf],.track[data-v-472a39bf]{-webkit-animation-duration:0ms!important;-moz-animation-duration:0ms!important;animation-duration:0ms!important;-webkit-transition-duration:0ms!important;-moz-transition-duration:0ms!important;transition-duration:0ms!important}}";
|
|
168
|
+
var stylesheet = ".fw-switch[data-v-472a39bf]{-webkit-box-align:center;-moz-box-align:center;-ms-flex-align:center;-webkit-align-items:center;align-items:center;border-radius:9999px;cursor:pointer;display:-webkit-inline-box;display:-webkit-inline-flex;display:-moz-inline-box;display:-ms-inline-flexbox;display:inline-flex}.fwFadeIn-enter-active[data-v-472a39bf]{-webkit-animation:fwFadeIn-472a39bf .35s;-moz-animation:fwFadeIn-472a39bf .35s;animation:fwFadeIn-472a39bf .35s;-webkit-transition:opacity .35s ease-in;-moz-transition:opacity .35s ease-in;transition:opacity .35s ease-in}.fwFadeIn-leave-active[data-v-472a39bf]{animation:fwFadeIn-472a39bf .35s reverse;-webkit-transition:opacity .35s ease-out;-moz-transition:opacity .35s ease-out;transition:opacity .35s ease-out}@-webkit-keyframes fwFadeIn-472a39bf{0%{opacity:0}to{opacity:1}}@-moz-keyframes fwFadeIn-472a39bf{0%{opacity:0}to{opacity:1}}@keyframes fwFadeIn-472a39bf{0%{opacity:0}to{opacity:1}}@media (prefers-reduced-motion:reduce){.thumb[data-v-472a39bf],.track[data-v-472a39bf]{-webkit-animation-duration:0ms!important;-moz-animation-duration:0ms!important;animation-duration:0ms!important;-webkit-transition-duration:0ms!important;-moz-transition-duration:0ms!important;transition-duration:0ms!important}}";
|
|
142
169
|
styleInject(css_248z);
|
|
143
170
|
|
|
144
171
|
script.render = render;
|
|
145
|
-
script.__scopeId = "data-v-
|
|
172
|
+
script.__scopeId = "data-v-472a39bf";
|
|
146
173
|
|
|
147
174
|
export { script as FwSwitch };
|