@frollo/frollo-web-ui 8.4.5 → 8.5.1

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.
@@ -0,0 +1,157 @@
1
+ import { a as _slicedToArray } from './_rollupPluginBabelHelpers-DpC_oIQV.js';
2
+ import { defineComponent, computed, watch, openBlock, createElementBlock, createElementVNode, normalizeStyle, toDisplayString, withDirectives, vModelText } from 'vue';
3
+ import { s as styleInject } from './style-inject.es-tgCJW-Cu.js';
4
+
5
+ var script = defineComponent({
6
+ name: 'FwSlider',
7
+ emits: ['update:minValue', 'update:maxValue'],
8
+ props: {
9
+ min: {
10
+ type: Number,
11
+ "default": -100
12
+ },
13
+ max: {
14
+ type: Number,
15
+ "default": 100
16
+ },
17
+ step: {
18
+ type: Number,
19
+ "default": 0.01
20
+ },
21
+ minValue: {
22
+ type: Number,
23
+ "default": null
24
+ },
25
+ maxValue: {
26
+ type: Number,
27
+ "default": null
28
+ }
29
+ },
30
+ setup: function setup(props, ctx) {
31
+ var minimumValue = computed({
32
+ get: function get() {
33
+ var _props$minValue;
34
+ return (_props$minValue = props.minValue) !== null && _props$minValue !== void 0 ? _props$minValue : props.min;
35
+ },
36
+ set: function set(state) {
37
+ return ctx.emit('update:minValue', state);
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 () {
51
+ return props.minValue;
52
+ }, function () {
53
+ return props.maxValue;
54
+ }], function (_ref, _ref2) {
55
+ var _ref3 = _slicedToArray(_ref, 2),
56
+ newMin = _ref3[0],
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
+ }
72
+ }, {
73
+ immediate: true
74
+ });
75
+ var minPercentage = computed(function () {
76
+ return (minimumValue.value - props.min) / (props.max - props.min) * 100;
77
+ });
78
+ var maxPercentage = computed(function () {
79
+ return (maximumValue.value - props.min) / (props.max - props.min) * 100;
80
+ });
81
+ var clippingPoint = computed(function () {
82
+ return maxPercentage.value - minPercentage.value >= 3;
83
+ });
84
+ return {
85
+ minimumValue: minimumValue,
86
+ maximumValue: maximumValue,
87
+ minPercentage: minPercentage,
88
+ maxPercentage: maxPercentage,
89
+ clippingPoint: clippingPoint
90
+ };
91
+ }
92
+ });
93
+
94
+ var _hoisted_1 = {
95
+ ref: "slider",
96
+ "class": "relative py-3"
97
+ };
98
+ var _hoisted_2 = ["min", "max", "step"];
99
+ var _hoisted_3 = ["min", "max", "step"];
100
+ function render(_ctx, _cache, $props, $setup, $data, $options) {
101
+ return openBlock(), createElementBlock("div", _hoisted_1, [createElementVNode("p", {
102
+ "class": "absolute -top-6 -translate-x-1/2 text-base text-[var(--colorButtonPrimary)] font-semibold",
103
+ style: normalizeStyle({
104
+ left: "".concat(_ctx.minPercentage, "%")
105
+ })
106
+ }, toDisplayString(_ctx.minimumValue) + "% ", 5), createElementVNode("p", {
107
+ "class": "absolute -top-6 -translate-x-1/2 text-base text-[var(--colorButtonPrimary)] font-semibold",
108
+ style: normalizeStyle({
109
+ left: "".concat(_ctx.maxPercentage, "%")
110
+ })
111
+ }, toDisplayString(_ctx.maximumValue) + "% ", 5), createElementVNode("div", {
112
+ "class": "h-1.5 rounded-full bg-grey-base-light [--fill:var(--colorButtonPrimary)]",
113
+ style: normalizeStyle({
114
+ background: "linear-gradient(to right,\n var(--track, #e5e7eb) 0%,\n var(--track, #e5e7eb) ".concat(_ctx.minPercentage, "%,\n var(--fill) ").concat(_ctx.minPercentage, "%,\n var(--fill) ").concat(_ctx.maxPercentage, "%,\n var(--track, #e5e7eb) ").concat(_ctx.maxPercentage, "%,\n var(--track, #e5e7eb) 100%)")
115
+ })
116
+ }, null, 4), withDirectives(createElementVNode("input", {
117
+ "class": "fw-slider absolute inset-0 w-full appearance-none bg-transparent pointer-events-none focus:outline-none",
118
+ type: "range",
119
+ name: "min",
120
+ id: "min",
121
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = function ($event) {
122
+ return _ctx.minimumValue = $event;
123
+ }),
124
+ min: _ctx.min,
125
+ max: _ctx.max,
126
+ step: _ctx.step,
127
+ style: normalizeStyle({
128
+ zIndex: _ctx.clippingPoint ? 20 : 30
129
+ })
130
+ }, null, 12, _hoisted_2), [[vModelText, _ctx.minimumValue, void 0, {
131
+ number: true
132
+ }]]), withDirectives(createElementVNode("input", {
133
+ "class": "fw-slider absolute inset-0 w-full appearance-none bg-transparent pointer-events-none focus:outline-none",
134
+ type: "range",
135
+ name: "max",
136
+ id: "max",
137
+ min: _ctx.min,
138
+ max: _ctx.max,
139
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = function ($event) {
140
+ return _ctx.maximumValue = $event;
141
+ }),
142
+ step: _ctx.step,
143
+ style: normalizeStyle({
144
+ zIndex: _ctx.clippingPoint ? 30 : 20
145
+ })
146
+ }, null, 12, _hoisted_3), [[vModelText, _ctx.maximumValue, void 0, {
147
+ number: true
148
+ }]])], 512);
149
+ }
150
+
151
+ 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}";
152
+ var stylesheet = ".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}";
153
+ styleInject(css_248z);
154
+
155
+ script.render = render;
156
+
157
+ export { script as FwSlider };
package/esm/index.js CHANGED
@@ -6,7 +6,7 @@ import './fw-dropdown.js';
6
6
  import './fw-card.js';
7
7
  import './fw-button.js';
8
8
  import { FwNavigationMenu as script$e } from './fw-navigation-menu.js';
9
- import { FwTab as script$j, FwTabs as script$m } from './fw-tabs.js';
9
+ import { FwTab as script$k, FwTabs as script$n } from './fw-tabs.js';
10
10
  import { FwModal as script$d } from './fw-modal.js';
11
11
  import { FwProgressBar as script$g } from './fw-progress-bar.js';
12
12
  import './fw-tag.js';
@@ -14,8 +14,8 @@ import './fw-table.js';
14
14
  import { FwAccordion as __default__ } from './fw-accordion.js';
15
15
  import './fw-image.js';
16
16
  import { FwLoadingCard as script$9, FwLoadingTable as script$b } from './fw-loading.js';
17
- import { FwToast as script$n } from './fw-toast.js';
18
- import { FwTransactionsCard as script$o } from './fw-transactions-card.js';
17
+ import { FwToast as script$o } from './fw-toast.js';
18
+ import { FwTransactionsCard as script$p } from './fw-transactions-card.js';
19
19
  import { FwBarChart as script } from './fw-bar-chart.js';
20
20
  import { FwSidebarMenu as script$i } from './fw-sidebar-menu.js';
21
21
  import { FwDrawer as script$4 } from './fw-drawer.js';
@@ -24,6 +24,7 @@ import { FwDatePicker as __default__$1 } from './fw-date-picker.js';
24
24
  import { FwPopover as __default__$3 } from './fw-popover.js';
25
25
  import { FwPeriodSelector as script$f } from './fw-period-selector.js';
26
26
  import { FwMediaPicker as script$c } from './fw-media-picker.js';
27
+ import { FwSlider as script$j } from './fw-slider.js';
27
28
  import { FwEmailPulse as __default__$2, FwSuccessPulse as __default__$4 } from './fw-animations.js';
28
29
  import { F as Form } from './vee-validate.esm-3ptvCDR1.js';
29
30
  import { s as script$7 } from './fw-input-XeI-IKly.js';
@@ -31,7 +32,7 @@ import { s as script$5 } from './fw-dropdown-ClttctHK.js';
31
32
  import { s as script$2 } from './fw-card-bsYbpPmW.js';
32
33
  import { s as script$1 } from './fw-button-BhZXMN8a.js';
33
34
  import { _ as __default__$6 } from './fw-tag-DgsnsY7O.js';
34
- import { _ as __default__$5, s as script$k, a as script$l } from './fw-table-row-BlpxQ10C.js';
35
+ import { _ as __default__$5, s as script$l, a as script$m } from './fw-table-row-BlpxQ10C.js';
35
36
  import { s as script$6 } from './fw-image-6o3ZOSCW.js';
36
37
  import { s as script$8 } from './fw-loading-bar-DThRjdw1.js';
37
38
  import { s as script$a } from './fw-loading-spinner-CFFbujSq.js';
@@ -71,15 +72,16 @@ var components = /*#__PURE__*/Object.freeze({
71
72
  FwProgressBar: script$g,
72
73
  FwProviderList: script$h,
73
74
  FwSidebarMenu: script$i,
75
+ FwSlider: script$j,
74
76
  FwSuccessPulse: __default__$4,
75
- FwTab: script$j,
77
+ FwTab: script$k,
76
78
  FwTable: __default__$5,
77
- FwTableHead: script$k,
78
- FwTableRow: script$l,
79
- FwTabs: script$m,
79
+ FwTableHead: script$l,
80
+ FwTableRow: script$m,
81
+ FwTabs: script$n,
80
82
  FwTag: __default__$6,
81
- FwToast: script$n,
82
- FwTransactionsCard: script$o
83
+ FwToast: script$o,
84
+ FwTransactionsCard: script$p
83
85
  });
84
86
 
85
87
  var modalService = function modalService(options) {
@@ -113,7 +115,7 @@ var toastService = function toastService() {
113
115
  }));
114
116
  createApp({
115
117
  render: function render() {
116
- return h(script$n, props);
118
+ return h(script$o, props);
117
119
  }
118
120
  }).mount(elementToMount);
119
121
  };
@@ -142,4 +144,4 @@ var install = function install(app) {
142
144
  });
143
145
  };
144
146
 
145
- export { __default__ as FwAccordion, script as FwBarChart, script$1 as FwButton, script$2 as FwCard, script$3 as FwCheckbox, __default__$1 as FwDatePicker, script$4 as FwDrawer, script$5 as FwDropdown, __default__$2 as FwEmailPulse, Form as FwForm, script$6 as FwImage, script$7 as FwInput, script$8 as FwLoadingBar, script$9 as FwLoadingCard, script$a as FwLoadingSpinner, script$b as FwLoadingTable, script$c as FwMediaPicker, script$d as FwModal, script$e as FwNavigationMenu, script$f as FwPeriodSelector, __default__$3 as FwPopover, script$g as FwProgressBar, script$h as FwProviderList, script$i as FwSidebarMenu, __default__$4 as FwSuccessPulse, script$j as FwTab, __default__$5 as FwTable, script$k as FwTableHead, script$l as FwTableRow, script$m as FwTabs, __default__$6 as FwTag, script$n as FwToast, script$o as FwTransactionsCard, install as default, modalService, toastService };
147
+ export { __default__ as FwAccordion, script as FwBarChart, script$1 as FwButton, script$2 as FwCard, script$3 as FwCheckbox, __default__$1 as FwDatePicker, script$4 as FwDrawer, script$5 as FwDropdown, __default__$2 as FwEmailPulse, Form as FwForm, script$6 as FwImage, script$7 as FwInput, script$8 as FwLoadingBar, script$9 as FwLoadingCard, script$a as FwLoadingSpinner, script$b as FwLoadingTable, script$c as FwMediaPicker, script$d as FwModal, script$e as FwNavigationMenu, script$f as FwPeriodSelector, __default__$3 as FwPopover, script$g as FwProgressBar, script$h as FwProviderList, script$i as FwSidebarMenu, script$j as FwSlider, __default__$4 as FwSuccessPulse, script$k as FwTab, __default__$5 as FwTable, script$l as FwTableHead, script$m as FwTableRow, script$n as FwTabs, __default__$6 as FwTag, script$o as FwToast, script$p as FwTransactionsCard, install as default, modalService, toastService };