ablok-components 0.3.142 → 0.3.144
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-color/input-color.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/molecules/input-gradient/input-gradient.vue_vue_type_script_setup_true_lang.js +107 -75
- 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
package/dist/components/molecules/input-color/input-color.vue_vue_type_script_setup_true_lang.js
CHANGED
|
@@ -2,7 +2,7 @@ import { uniqueId as e } from "../../../utilities/helpers.js";
|
|
|
2
2
|
import t from "../../atoms/base-input/base-input.js";
|
|
3
3
|
import { computed as n, createElementBlock as r, createElementVNode as i, createVNode as a, defineComponent as o, openBlock as s, vModelText as c, withCtx as l, withDirectives as u } from "vue";
|
|
4
4
|
//#region src/components/molecules/input-color/input-color.vue?vue&type=script&setup=true&lang.ts
|
|
5
|
-
var d = { class: "input-color" }, f = { class: "
|
|
5
|
+
var d = { class: "input-color" }, f = { class: "input-color__color-swatch" }, p = [
|
|
6
6
|
"name",
|
|
7
7
|
"id",
|
|
8
8
|
"disabled",
|
|
@@ -1,19 +1,20 @@
|
|
|
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
|
+
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 = [
|
|
7
8
|
"onUpdate:modelValue",
|
|
8
9
|
"name",
|
|
9
10
|
"id",
|
|
10
11
|
"aria-label",
|
|
11
12
|
"disabled"
|
|
12
|
-
],
|
|
13
|
+
], A = { class: "col-auto" }, j = { class: "input-gradient__footer px-3 py-2" }, M = { class: "col-7" }, N = { class: "col" }, P = [
|
|
13
14
|
"name",
|
|
14
15
|
"id",
|
|
15
16
|
"disabled"
|
|
16
|
-
],
|
|
17
|
+
], F = { class: "col-auto" }, I = "plus", L = /*@__PURE__*/ u({
|
|
17
18
|
__name: "input-gradient",
|
|
18
19
|
props: {
|
|
19
20
|
modelValue: {
|
|
@@ -72,70 +73,83 @@ var y = ["id"], b = ["for", "innerHTML"], x = { class: "dropdown" }, S = ["title
|
|
|
72
73
|
}
|
|
73
74
|
},
|
|
74
75
|
emits: ["update:modelValue"],
|
|
75
|
-
setup(e, { emit:
|
|
76
|
-
let
|
|
76
|
+
setup(e, { emit: u }) {
|
|
77
|
+
let L = e, R = u, z = [{
|
|
78
|
+
text: "Linear",
|
|
79
|
+
value: "linear"
|
|
80
|
+
}, {
|
|
81
|
+
text: "Radial",
|
|
82
|
+
value: "radial"
|
|
83
|
+
}], B = a({
|
|
77
84
|
get() {
|
|
78
|
-
return
|
|
85
|
+
return L.modelValue?.type ?? "linear";
|
|
79
86
|
},
|
|
80
87
|
set(e) {
|
|
81
|
-
|
|
88
|
+
G({ type: e });
|
|
82
89
|
}
|
|
83
|
-
}),
|
|
84
|
-
|
|
90
|
+
}), V = a(() => L.modelValue?.stops ?? []), H = a({
|
|
91
|
+
get() {
|
|
92
|
+
return L.modelValue?.angle ?? 180;
|
|
93
|
+
},
|
|
94
|
+
set(e) {
|
|
95
|
+
G({ angle: J(Number(e) || 0, 0, 360) });
|
|
96
|
+
}
|
|
97
|
+
}), U = a(() => {
|
|
98
|
+
let e = V.value;
|
|
85
99
|
if (!e.length) return "transparent";
|
|
86
|
-
let t = e.length > 1 ?
|
|
87
|
-
return
|
|
100
|
+
let t = e.length > 1 ? H.value : 180, n = e.slice().sort((e, t) => e.pct - t.pct).map((e) => `${e.color} ${J(e.pct, 0, 100)}%`);
|
|
101
|
+
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
102
|
});
|
|
89
|
-
function
|
|
90
|
-
return
|
|
103
|
+
function W(e) {
|
|
104
|
+
return L.lockFirstStop && e === 0;
|
|
91
105
|
}
|
|
92
|
-
function
|
|
93
|
-
|
|
94
|
-
...
|
|
106
|
+
function G(e = {}) {
|
|
107
|
+
R("update:modelValue", {
|
|
108
|
+
...L.modelValue,
|
|
95
109
|
...e,
|
|
96
|
-
stops: (e.stops ??
|
|
110
|
+
stops: (e.stops ?? V.value).map((e) => ({ ...e }))
|
|
97
111
|
});
|
|
98
112
|
}
|
|
99
|
-
function
|
|
100
|
-
if (
|
|
101
|
-
let e =
|
|
113
|
+
function K() {
|
|
114
|
+
if (V.value.length >= L.maxStops) return;
|
|
115
|
+
let e = V.value.map((e) => ({ ...e })), t = e[e.length - 1], n = t ? J(t.pct + 10, 0, 100) : 100;
|
|
102
116
|
e.push({
|
|
103
117
|
color: "#000000ff",
|
|
104
118
|
pct: n
|
|
105
|
-
}),
|
|
119
|
+
}), G({ stops: e });
|
|
106
120
|
}
|
|
107
|
-
function
|
|
108
|
-
|
|
121
|
+
function q(e) {
|
|
122
|
+
W(e) || V.value.length < 2 || G({ stops: V.value.filter((t, n) => n !== e).map((e) => ({ ...e })) });
|
|
109
123
|
}
|
|
110
|
-
function
|
|
124
|
+
function J(e, t, n) {
|
|
111
125
|
return Math.min(n, Math.max(t, e));
|
|
112
126
|
}
|
|
113
|
-
return (
|
|
114
|
-
let
|
|
115
|
-
return
|
|
127
|
+
return (a, u) => {
|
|
128
|
+
let L = g("svg-icon");
|
|
129
|
+
return p(), s("div", {
|
|
116
130
|
class: "input-gradient",
|
|
117
131
|
id: e.id || e.name
|
|
118
|
-
}, [
|
|
132
|
+
}, [h(a.$slots, "label", {}, () => [e.label ? (p(), s("label", {
|
|
119
133
|
key: 0,
|
|
120
134
|
for: `${e.id || e.name}--dropdown-toggle`,
|
|
121
135
|
class: "input__label",
|
|
122
136
|
innerHTML: `${e.label}${e.required ? " *" : ""}`
|
|
123
|
-
}, null, 8,
|
|
137
|
+
}, null, 8, x)) : o("", !0)]), c("div", S, [l(t, {
|
|
124
138
|
id: `${e.id || e.name}--dropdown-toggle`,
|
|
125
139
|
"data-bs-toggle": "dropdown",
|
|
126
140
|
"data-bs-auto-close": "outside",
|
|
127
141
|
role: "button",
|
|
128
142
|
type: "button",
|
|
129
|
-
class:
|
|
143
|
+
class: d(["btn input-gradient__toggle", { [`btn-${e.variant}`]: e.variant }]),
|
|
130
144
|
color: e.color,
|
|
131
145
|
disabled: e.disabled,
|
|
132
146
|
"aria-label": e.label || "Gradient"
|
|
133
147
|
}, {
|
|
134
|
-
default:
|
|
148
|
+
default: v(() => [c("span", {
|
|
135
149
|
class: "input-gradient__preview",
|
|
136
|
-
style:
|
|
137
|
-
title:
|
|
138
|
-
}, null, 12,
|
|
150
|
+
style: f({ background: U.value }),
|
|
151
|
+
title: U.value
|
|
152
|
+
}, null, 12, C), c("span", w, [l(L, { symbol: "chevron-down" })])]),
|
|
139
153
|
_: 1
|
|
140
154
|
}, 8, [
|
|
141
155
|
"id",
|
|
@@ -143,13 +157,13 @@ var y = ["id"], b = ["for", "innerHTML"], x = { class: "dropdown" }, S = ["title
|
|
|
143
157
|
"color",
|
|
144
158
|
"disabled",
|
|
145
159
|
"aria-label"
|
|
146
|
-
]),
|
|
147
|
-
c(n, {
|
|
160
|
+
]), c("ul", T, [(p(!0), s(i, null, m(V.value, (r, i) => (p(), s("li", { key: `${e.name}-stop-${i}` }, [c("div", E, [
|
|
161
|
+
c("div", D, [l(n, {
|
|
148
162
|
modelValue: r.color,
|
|
149
163
|
"onUpdate:modelValue": (e) => r.color = e,
|
|
150
164
|
name: `${e.name}-stop-${i}-color`,
|
|
151
165
|
id: `${e.name}-stop-${i}-color`,
|
|
152
|
-
disabled: e.disabled ||
|
|
166
|
+
disabled: e.disabled || W(i),
|
|
153
167
|
class: "input-gradient__stop-color"
|
|
154
168
|
}, null, 8, [
|
|
155
169
|
"modelValue",
|
|
@@ -157,8 +171,8 @@ var y = ["id"], b = ["for", "innerHTML"], x = { class: "dropdown" }, S = ["title
|
|
|
157
171
|
"name",
|
|
158
172
|
"id",
|
|
159
173
|
"disabled"
|
|
160
|
-
]),
|
|
161
|
-
|
|
174
|
+
])]),
|
|
175
|
+
c("div", O, [y(c("input", {
|
|
162
176
|
"onUpdate:modelValue": (e) => r.pct = e,
|
|
163
177
|
type: "number",
|
|
164
178
|
min: "0",
|
|
@@ -166,57 +180,75 @@ var y = ["id"], b = ["for", "innerHTML"], x = { class: "dropdown" }, S = ["title
|
|
|
166
180
|
name: `${e.name}-stop-${i}-pct`,
|
|
167
181
|
id: `${e.name}-stop-${i}-pct`,
|
|
168
182
|
"aria-label": `Stop ${i + 1} position`,
|
|
169
|
-
disabled: e.disabled ||
|
|
183
|
+
disabled: e.disabled || W(i),
|
|
170
184
|
class: "form-control input-gradient__stop-pct"
|
|
171
|
-
}, null, 8,
|
|
172
|
-
|
|
185
|
+
}, null, 8, k), [[
|
|
186
|
+
_,
|
|
173
187
|
r.pct,
|
|
174
188
|
void 0,
|
|
175
189
|
{ number: !0 }
|
|
176
|
-
]]),
|
|
177
|
-
c(t, {
|
|
190
|
+
]])]),
|
|
191
|
+
c("div", A, [l(t, {
|
|
178
192
|
type: "button",
|
|
179
193
|
icon: "x",
|
|
180
194
|
color: "light",
|
|
181
|
-
disabled: e.disabled ||
|
|
195
|
+
disabled: e.disabled || W(i) || V.value.length < 2,
|
|
182
196
|
"aria-label": `Remove stop ${i + 1}`,
|
|
183
197
|
title: `Remove stop ${i + 1}`,
|
|
184
198
|
class: "input-gradient__stop-remove btn btn-sm rounded-circle",
|
|
185
|
-
onClick: (e) =>
|
|
199
|
+
onClick: (e) => q(i)
|
|
186
200
|
}, null, 8, [
|
|
187
201
|
"disabled",
|
|
188
202
|
"aria-label",
|
|
189
203
|
"title",
|
|
190
204
|
"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
|
-
|
|
205
|
+
])])
|
|
206
|
+
])]))), 128)), c("li", null, [c("div", j, [
|
|
207
|
+
c("div", M, [l(r, {
|
|
208
|
+
modelValue: B.value,
|
|
209
|
+
"onUpdate:modelValue": u[0] ||= (e) => B.value = e,
|
|
210
|
+
options: z,
|
|
211
|
+
name: `${e.name}-type`,
|
|
212
|
+
id: `${e.name}-type`,
|
|
213
|
+
"aria-label": "Gradient type",
|
|
214
|
+
disabled: e.disabled || V.value.length < 2,
|
|
215
|
+
class: "input-gradient__type"
|
|
216
|
+
}, null, 8, [
|
|
217
|
+
"modelValue",
|
|
218
|
+
"name",
|
|
219
|
+
"id",
|
|
220
|
+
"disabled"
|
|
221
|
+
])]),
|
|
222
|
+
c("div", N, [y(c("input", {
|
|
223
|
+
"onUpdate:modelValue": u[1] ||= (e) => H.value = e,
|
|
224
|
+
type: "number",
|
|
225
|
+
min: "0",
|
|
226
|
+
max: "360",
|
|
227
|
+
name: `${e.name}-angle`,
|
|
228
|
+
id: `${e.name}-angle`,
|
|
229
|
+
"aria-label": "Gradient angle",
|
|
230
|
+
disabled: e.disabled || V.value.length < 2 || B.value !== "linear",
|
|
231
|
+
class: "form-control input-gradient__angle"
|
|
232
|
+
}, null, 8, P), [[
|
|
233
|
+
_,
|
|
234
|
+
H.value,
|
|
235
|
+
void 0,
|
|
236
|
+
{ number: !0 }
|
|
237
|
+
]])]),
|
|
238
|
+
c("div", F, [l(t, {
|
|
239
|
+
type: "button",
|
|
240
|
+
size: "small",
|
|
241
|
+
color: "light",
|
|
242
|
+
icon: I,
|
|
243
|
+
disabled: e.disabled || V.value.length >= e.maxStops,
|
|
244
|
+
"aria-label": "Add color stop",
|
|
245
|
+
title: "Add color stop",
|
|
246
|
+
class: "input-gradient__add btn btn-sm rounded-circle",
|
|
247
|
+
onClick: K
|
|
248
|
+
}, null, 8, ["disabled"])])
|
|
249
|
+
])])])])], 8, b);
|
|
218
250
|
};
|
|
219
251
|
}
|
|
220
252
|
});
|
|
221
253
|
//#endregion
|
|
222
|
-
export {
|
|
254
|
+
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 };
|