ablok-components 0.3.143 → 0.3.145
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/ablok-components.css +1 -1
- package/dist/ablok-components.umd.js +1 -1
- package/dist/components/molecules/input-gradient/input-gradient.vue_vue_type_script_setup_true_lang.js +123 -88
- package/dist/components/organisms/asset-uploader/asset-uploader.vue.d.ts +1 -1
- package/dist/components/organisms/preset-uploader/preset-uploader.vue.d.ts +1 -1
- package/dist/index.js +4 -4
- package/package.json +1 -1
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
import { uniqueId as e } from "../../../utilities/helpers.js";
|
|
2
2
|
import t from "../../atoms/base-button/base-button.js";
|
|
3
3
|
import n from "../input-color/input-color.js";
|
|
4
|
-
import
|
|
4
|
+
import r from "../input-dropdown/input-dropdown.js";
|
|
5
|
+
import { Fragment as i, computed as a, createCommentVNode as o, createElementBlock as s, createElementVNode as c, createVNode as l, defineComponent as u, normalizeClass as d, normalizeStyle as f, openBlock as p, renderList as m, renderSlot as h, resolveComponent as g, vModelText as _, withCtx as v, withDirectives as y } from "vue";
|
|
5
6
|
//#region src/components/molecules/input-gradient/input-gradient.vue?vue&type=script&setup=true&lang.ts
|
|
6
|
-
var
|
|
7
|
-
"
|
|
7
|
+
var b = ["id"], x = ["for", "innerHTML"], S = { class: "dropdown" }, C = ["title"], w = { class: "input-gradient__toggle-icon position-absolute end-0 height-100 d-flex justify-content-center align-items-center bg-white bg-opacity-50 input-gradient__toggle-icon" }, T = { class: "dropdown-menu input-gradient__menu" }, E = { class: "input-gradient__stop d-flex align-items-center px-3 py-2" }, D = { class: "col-7" }, O = { class: "col" }, k = [
|
|
8
|
+
"value",
|
|
8
9
|
"name",
|
|
9
10
|
"id",
|
|
10
11
|
"aria-label",
|
|
11
|
-
"disabled"
|
|
12
|
-
|
|
12
|
+
"disabled",
|
|
13
|
+
"onInput"
|
|
14
|
+
], A = { class: "col-auto" }, j = { class: "input-gradient__footer px-3 py-2" }, M = { class: "col-7" }, N = { class: "col" }, P = [
|
|
13
15
|
"name",
|
|
14
16
|
"id",
|
|
15
17
|
"disabled"
|
|
16
|
-
],
|
|
18
|
+
], F = { class: "col-auto" }, I = "plus", L = /*@__PURE__*/ u({
|
|
17
19
|
__name: "input-gradient",
|
|
18
20
|
props: {
|
|
19
21
|
modelValue: {
|
|
@@ -72,70 +74,89 @@ var y = ["id"], b = ["for", "innerHTML"], x = { class: "dropdown" }, S = ["title
|
|
|
72
74
|
}
|
|
73
75
|
},
|
|
74
76
|
emits: ["update:modelValue"],
|
|
75
|
-
setup(e, { emit:
|
|
76
|
-
let
|
|
77
|
+
setup(e, { emit: u }) {
|
|
78
|
+
let L = e, R = u, z = [{
|
|
79
|
+
text: "Linear",
|
|
80
|
+
value: "linear"
|
|
81
|
+
}, {
|
|
82
|
+
text: "Radial",
|
|
83
|
+
value: "radial"
|
|
84
|
+
}], B = a({
|
|
85
|
+
get() {
|
|
86
|
+
return L.modelValue?.type ?? "linear";
|
|
87
|
+
},
|
|
88
|
+
set(e) {
|
|
89
|
+
K({ type: e });
|
|
90
|
+
}
|
|
91
|
+
}), V = a(() => L.modelValue?.stops ?? []), H = a({
|
|
77
92
|
get() {
|
|
78
|
-
return
|
|
93
|
+
return L.modelValue?.angle ?? 180;
|
|
79
94
|
},
|
|
80
95
|
set(e) {
|
|
81
|
-
|
|
96
|
+
K({ angle: Y(Number(e) || 0, 0, 360) });
|
|
82
97
|
}
|
|
83
|
-
}),
|
|
84
|
-
let e =
|
|
98
|
+
}), U = a(() => {
|
|
99
|
+
let e = V.value;
|
|
85
100
|
if (!e.length) return "transparent";
|
|
86
|
-
let t = e.length > 1 ?
|
|
87
|
-
return
|
|
101
|
+
let t = e.length > 1 ? H.value : 180, n = e.slice().sort((e, t) => e.pct - t.pct).map((e) => `${e.color} ${Y(e.pct, 0, 100)}%`);
|
|
102
|
+
return `${B.value === "radial" ? "radial-gradient" : B.value === "conic" ? "conic-gradient" : "linear-gradient"}(${B.value === "radial" ? "circle at center" : B.value === "conic" ? `from ${t}deg` : `${t}deg`}, ${e.length > 1 ? n.join(", ") : n.join(", ") || "transparent, transparent"})`;
|
|
88
103
|
});
|
|
89
|
-
function
|
|
90
|
-
return
|
|
104
|
+
function W(e) {
|
|
105
|
+
return L.lockFirstStop && e === 0;
|
|
106
|
+
}
|
|
107
|
+
function G(e, t) {
|
|
108
|
+
W(e) || K({ stops: V.value.map((n, r) => r === e ? {
|
|
109
|
+
...n,
|
|
110
|
+
...t
|
|
111
|
+
} : { ...n }) });
|
|
91
112
|
}
|
|
92
|
-
function
|
|
93
|
-
|
|
94
|
-
...
|
|
113
|
+
function K(e = {}) {
|
|
114
|
+
R("update:modelValue", {
|
|
115
|
+
...L.modelValue,
|
|
95
116
|
...e,
|
|
96
|
-
stops: (e.stops ??
|
|
117
|
+
stops: (e.stops ?? V.value).map((e) => ({ ...e }))
|
|
97
118
|
});
|
|
98
119
|
}
|
|
99
|
-
function
|
|
100
|
-
if (
|
|
101
|
-
let e =
|
|
120
|
+
function q() {
|
|
121
|
+
if (V.value.length >= L.maxStops) return;
|
|
122
|
+
let e = V.value.map((e) => ({ ...e })), t = e[e.length - 1], n = t ? Y(t.pct + 10, 0, 100) : 100;
|
|
102
123
|
e.push({
|
|
103
124
|
color: "#000000ff",
|
|
104
125
|
pct: n
|
|
105
|
-
}),
|
|
126
|
+
}), K({ stops: e });
|
|
106
127
|
}
|
|
107
|
-
function
|
|
108
|
-
|
|
128
|
+
function J(e) {
|
|
129
|
+
W(e) || V.value.length < 2 || K({ stops: V.value.filter((t, n) => n !== e).map((e) => ({ ...e })) });
|
|
109
130
|
}
|
|
110
|
-
function
|
|
131
|
+
function Y(e, t, n) {
|
|
111
132
|
return Math.min(n, Math.max(t, e));
|
|
112
133
|
}
|
|
113
|
-
return (
|
|
114
|
-
let
|
|
115
|
-
return
|
|
134
|
+
return (a, u) => {
|
|
135
|
+
let L = g("svg-icon");
|
|
136
|
+
return p(), s("div", {
|
|
116
137
|
class: "input-gradient",
|
|
117
138
|
id: e.id || e.name
|
|
118
|
-
}, [
|
|
139
|
+
}, [h(a.$slots, "label", {}, () => [e.label ? (p(), s("label", {
|
|
119
140
|
key: 0,
|
|
120
141
|
for: `${e.id || e.name}--dropdown-toggle`,
|
|
121
142
|
class: "input__label",
|
|
122
143
|
innerHTML: `${e.label}${e.required ? " *" : ""}`
|
|
123
|
-
}, null, 8,
|
|
144
|
+
}, null, 8, x)) : o("", !0)]), c("div", S, [l(t, {
|
|
124
145
|
id: `${e.id || e.name}--dropdown-toggle`,
|
|
125
146
|
"data-bs-toggle": "dropdown",
|
|
126
147
|
"data-bs-auto-close": "outside",
|
|
127
148
|
role: "button",
|
|
128
149
|
type: "button",
|
|
129
|
-
class:
|
|
150
|
+
class: d(["btn input-gradient__toggle", { [`btn-${e.variant}`]: e.variant }]),
|
|
130
151
|
color: e.color,
|
|
131
152
|
disabled: e.disabled,
|
|
132
153
|
"aria-label": e.label || "Gradient"
|
|
133
154
|
}, {
|
|
134
|
-
default:
|
|
155
|
+
default: v(() => [c("span", {
|
|
135
156
|
class: "input-gradient__preview",
|
|
136
|
-
style:
|
|
137
|
-
title:
|
|
138
|
-
}, null, 12,
|
|
157
|
+
style: f({ background: U.value }),
|
|
158
|
+
title: U.value
|
|
159
|
+
}, null, 12, C), c("span", w, [l(L, { symbol: "chevron-down" })])]),
|
|
139
160
|
_: 1
|
|
140
161
|
}, 8, [
|
|
141
162
|
"id",
|
|
@@ -143,80 +164,94 @@ var y = ["id"], b = ["for", "innerHTML"], x = { class: "dropdown" }, S = ["title
|
|
|
143
164
|
"color",
|
|
144
165
|
"disabled",
|
|
145
166
|
"aria-label"
|
|
146
|
-
]),
|
|
147
|
-
c(n, {
|
|
148
|
-
|
|
149
|
-
"onUpdate:modelValue": (e) => r.color = e,
|
|
167
|
+
]), c("ul", T, [(p(!0), s(i, null, m(V.value, (r, i) => (p(), s("li", { key: `${e.name}-stop-${i}` }, [c("div", E, [
|
|
168
|
+
c("div", D, [l(n, {
|
|
169
|
+
"model-value": r.color,
|
|
150
170
|
name: `${e.name}-stop-${i}-color`,
|
|
151
171
|
id: `${e.name}-stop-${i}-color`,
|
|
152
|
-
disabled: e.disabled ||
|
|
153
|
-
class: "input-gradient__stop-color"
|
|
172
|
+
disabled: e.disabled || W(i),
|
|
173
|
+
class: "input-gradient__stop-color",
|
|
174
|
+
"onUpdate:modelValue": (e) => G(i, { color: e })
|
|
154
175
|
}, null, 8, [
|
|
155
|
-
"
|
|
156
|
-
"onUpdate:modelValue",
|
|
176
|
+
"model-value",
|
|
157
177
|
"name",
|
|
158
178
|
"id",
|
|
159
|
-
"disabled"
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
179
|
+
"disabled",
|
|
180
|
+
"onUpdate:modelValue"
|
|
181
|
+
])]),
|
|
182
|
+
c("div", O, [c("input", {
|
|
183
|
+
value: r.pct,
|
|
163
184
|
type: "number",
|
|
164
185
|
min: "0",
|
|
165
186
|
max: "100",
|
|
166
187
|
name: `${e.name}-stop-${i}-pct`,
|
|
167
188
|
id: `${e.name}-stop-${i}-pct`,
|
|
168
189
|
"aria-label": `Stop ${i + 1} position`,
|
|
169
|
-
disabled: e.disabled ||
|
|
170
|
-
class: "form-control input-gradient__stop-pct"
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
void 0,
|
|
175
|
-
{ number: !0 }
|
|
176
|
-
]]),
|
|
177
|
-
c(t, {
|
|
190
|
+
disabled: e.disabled || W(i),
|
|
191
|
+
class: "form-control input-gradient__stop-pct",
|
|
192
|
+
onInput: (e) => G(i, { pct: Y(Number(e.target.value) || 0, 0, 100) })
|
|
193
|
+
}, null, 40, k)]),
|
|
194
|
+
c("div", A, [l(t, {
|
|
178
195
|
type: "button",
|
|
179
196
|
icon: "x",
|
|
180
197
|
color: "light",
|
|
181
|
-
disabled: e.disabled ||
|
|
198
|
+
disabled: e.disabled || W(i) || V.value.length < 2,
|
|
182
199
|
"aria-label": `Remove stop ${i + 1}`,
|
|
183
200
|
title: `Remove stop ${i + 1}`,
|
|
184
201
|
class: "input-gradient__stop-remove btn btn-sm rounded-circle",
|
|
185
|
-
onClick: (e) =>
|
|
202
|
+
onClick: (e) => J(i)
|
|
186
203
|
}, null, 8, [
|
|
187
204
|
"disabled",
|
|
188
205
|
"aria-label",
|
|
189
206
|
"title",
|
|
190
207
|
"onClick"
|
|
191
|
-
])
|
|
192
|
-
])]))), 128)),
|
|
193
|
-
"
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
208
|
+
])])
|
|
209
|
+
])]))), 128)), c("li", null, [c("div", j, [
|
|
210
|
+
c("div", M, [l(r, {
|
|
211
|
+
modelValue: B.value,
|
|
212
|
+
"onUpdate:modelValue": u[0] ||= (e) => B.value = e,
|
|
213
|
+
options: z,
|
|
214
|
+
name: `${e.name}-type`,
|
|
215
|
+
id: `${e.name}-type`,
|
|
216
|
+
"aria-label": "Gradient type",
|
|
217
|
+
disabled: e.disabled || V.value.length < 2,
|
|
218
|
+
class: "input-gradient__type"
|
|
219
|
+
}, null, 8, [
|
|
220
|
+
"modelValue",
|
|
221
|
+
"name",
|
|
222
|
+
"id",
|
|
223
|
+
"disabled"
|
|
224
|
+
])]),
|
|
225
|
+
c("div", N, [y(c("input", {
|
|
226
|
+
"onUpdate:modelValue": u[1] ||= (e) => H.value = e,
|
|
227
|
+
type: "number",
|
|
228
|
+
min: "0",
|
|
229
|
+
max: "360",
|
|
230
|
+
name: `${e.name}-angle`,
|
|
231
|
+
id: `${e.name}-angle`,
|
|
232
|
+
"aria-label": "Gradient angle",
|
|
233
|
+
disabled: e.disabled || V.value.length < 2 || B.value !== "linear",
|
|
234
|
+
class: "form-control input-gradient__angle"
|
|
235
|
+
}, null, 8, P), [[
|
|
236
|
+
_,
|
|
237
|
+
H.value,
|
|
238
|
+
void 0,
|
|
239
|
+
{ number: !0 }
|
|
240
|
+
]])]),
|
|
241
|
+
c("div", F, [l(t, {
|
|
242
|
+
type: "button",
|
|
243
|
+
size: "small",
|
|
244
|
+
color: "light",
|
|
245
|
+
icon: I,
|
|
246
|
+
disabled: e.disabled || V.value.length >= e.maxStops,
|
|
247
|
+
"aria-label": "Add color stop",
|
|
248
|
+
title: "Add color stop",
|
|
249
|
+
class: "input-gradient__add btn btn-sm rounded-circle",
|
|
250
|
+
onClick: q
|
|
251
|
+
}, null, 8, ["disabled"])])
|
|
252
|
+
])])])])], 8, b);
|
|
218
253
|
};
|
|
219
254
|
}
|
|
220
255
|
});
|
|
221
256
|
//#endregion
|
|
222
|
-
export {
|
|
257
|
+
export { L as default };
|
|
@@ -247,6 +247,7 @@ declare const __VLS_export: import('../../../../vue/dist/vue.esm-bundler.js').De
|
|
|
247
247
|
name: string;
|
|
248
248
|
disabled: boolean;
|
|
249
249
|
maxFileSize: number;
|
|
250
|
+
typeOptions: string[];
|
|
250
251
|
endpoint: string;
|
|
251
252
|
authToken: string;
|
|
252
253
|
baseResponsePath: string;
|
|
@@ -255,5 +256,4 @@ declare const __VLS_export: import('../../../../vue/dist/vue.esm-bundler.js').De
|
|
|
255
256
|
useImageUpload: boolean;
|
|
256
257
|
mediaTypeMap: Record<string, any>;
|
|
257
258
|
showTypeDropdown: boolean;
|
|
258
|
-
typeOptions: string[];
|
|
259
259
|
}, {}, {}, {}, string, import('../../../../vue/dist/vue.esm-bundler.js').ComponentProvideOptions, true, {}, any>;
|
|
@@ -244,6 +244,7 @@ declare const __VLS_export: import('../../../../vue/dist/vue.esm-bundler.js').De
|
|
|
244
244
|
name: string;
|
|
245
245
|
disabled: boolean;
|
|
246
246
|
maxFileSize: number;
|
|
247
|
+
typeOptions: string[];
|
|
247
248
|
endpoint: string;
|
|
248
249
|
authToken: string;
|
|
249
250
|
baseResponsePath: string;
|
|
@@ -252,7 +253,6 @@ declare const __VLS_export: import('../../../../vue/dist/vue.esm-bundler.js').De
|
|
|
252
253
|
useImageUpload: boolean;
|
|
253
254
|
mediaTypeMap: Record<string, any>;
|
|
254
255
|
showTypeDropdown: boolean;
|
|
255
|
-
typeOptions: string[];
|
|
256
256
|
}, {}, {}, {}, string, import('../../../../vue/dist/vue.esm-bundler.js').ComponentProvideOptions, true, {}, any>;
|
|
257
257
|
declare const _default: typeof __VLS_export;
|
|
258
258
|
export default _default;
|
package/dist/index.js
CHANGED
|
@@ -21,9 +21,9 @@ import y from "./components/atoms/custom-html/custom-html.js";
|
|
|
21
21
|
import b from "./components/molecules/select-media/select-media.js";
|
|
22
22
|
import x from "./components/molecules/rte-editor/rte-editor.js";
|
|
23
23
|
import S from "./components/molecules/input-color/input-color.js";
|
|
24
|
-
import C from "./components/molecules/input-
|
|
25
|
-
import w from "./components/molecules/
|
|
26
|
-
import T from "./components/molecules/
|
|
24
|
+
import C from "./components/molecules/input-dropdown/input-dropdown.js";
|
|
25
|
+
import w from "./components/molecules/input-gradient/input-gradient.js";
|
|
26
|
+
import T from "./components/molecules/color-palette/color-palette.js";
|
|
27
27
|
import E from "./components/molecules/auto-suggest/auto-suggest.js";
|
|
28
28
|
import D from "./components/molecules/base-camera/base-camera.js";
|
|
29
29
|
import O from "./components/molecules/base-map/base-map.js";
|
|
@@ -58,4 +58,4 @@ import ne from "./components/templates/touch-wrapper/touch-wrapper.js";
|
|
|
58
58
|
import re from "./components/atoms/canvas-confetti/canvas-confetti.js";
|
|
59
59
|
import ie from "./components/molecules/image-zoom/image-zoom.js";
|
|
60
60
|
import { useCameraFilter as ae } from "./composables/useCameraFilter.js";
|
|
61
|
-
export { o as Accordion, a as AccordionItem, z as AssetUploader, E as AutoSuggest, s as BaseButton, D as BaseCamera, K as BaseCarousel, te as BaseForm, r as BaseHeadline, n as BaseImage, c as BaseInput, O as BaseMap, i as BaseParagraph, j as BulkUpload, re as CanvasConfetti, h as CheckGroup,
|
|
61
|
+
export { o as Accordion, a as AccordionItem, z as AssetUploader, E as AutoSuggest, s as BaseButton, D as BaseCamera, K as BaseCarousel, te as BaseForm, r as BaseHeadline, n as BaseImage, c as BaseInput, O as BaseMap, i as BaseParagraph, j as BulkUpload, re as CanvasConfetti, h as CheckGroup, T as ColorPalette, y as CustomHtml, Q as DomRenderer, A as FileUpload, Y as HintSystem, P as ImageCrop, F as ImageCropResize, N as ImageResize, L as ImageUpload, ie as ImageZoom, u as InputCheckbox, S as InputColor, f as InputDatepicker, d as InputDatetime, C as InputDropdown, v as InputFile, w as InputGradient, m as InputPasscode, p as InputPassword, l as InputTextarea, ee as LinkSharing, t as LoadingSpinner, G as LocationFinder, k as LocationList, q as MediaThumbnails, I as ModalDialog, B as PopoverDialog, Z as PopoverNotifications, X as PopoverTooltip, V as PresetUploader, J as ProgressSteps, $ as QrCode, _ as RadioButtons, g as RadioGroup, x as RteEditor, b as SelectMedia, M as SortableList, e as SvgIcon, ne as TouchWrapper, R as UploadGroup, ae as useCameraFilter, H as useDirections, U as useGeocoding, W as useGeolocation };
|