ablok-components 0.3.143 → 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.
@@ -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 { Fragment as r, computed as i, createCommentVNode as a, createElementBlock as o, createElementVNode as s, createVNode as c, defineComponent as l, normalizeClass as u, normalizeStyle as d, openBlock as f, renderList as p, renderSlot as m, resolveComponent as h, vModelText as g, withCtx as _, withDirectives as v } from "vue";
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 y = ["id"], b = ["for", "innerHTML"], x = { class: "dropdown" }, S = ["title"], C = { 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" }, w = { class: "dropdown-menu input-gradient__menu" }, T = { class: "dropdown-item input-gradient__stop d-flex align-items-center" }, E = [
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
- ], D = { class: "dropdown-item input-gradient__footer" }, O = [
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
- ], k = "plus", A = /*@__PURE__*/ l({
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: l }) {
76
- let A = e, j = l, M = i(() => A.modelValue?.stops ?? []), N = i({
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 A.modelValue?.angle ?? 180;
85
+ return L.modelValue?.type ?? "linear";
79
86
  },
80
87
  set(e) {
81
- I({ angle: z(Number(e) || 0, 0, 360) });
88
+ G({ type: e });
82
89
  }
83
- }), P = i(() => {
84
- let e = M.value;
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 ? N.value : 180, n = e.slice().sort((e, t) => e.pct - t.pct).map((e) => `${e.color} ${z(e.pct, 0, 100)}%`);
87
- return `linear-gradient(${t}deg, ${e.length > 1 ? n.join(", ") : n.join(", ") || "transparent, transparent"})`;
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 F(e) {
90
- return A.lockFirstStop && e === 0;
103
+ function W(e) {
104
+ return L.lockFirstStop && e === 0;
91
105
  }
92
- function I(e = {}) {
93
- j("update:modelValue", {
94
- ...A.modelValue,
106
+ function G(e = {}) {
107
+ R("update:modelValue", {
108
+ ...L.modelValue,
95
109
  ...e,
96
- stops: (e.stops ?? M.value).map((e) => ({ ...e }))
110
+ stops: (e.stops ?? V.value).map((e) => ({ ...e }))
97
111
  });
98
112
  }
99
- function L() {
100
- if (M.value.length >= A.maxStops) return;
101
- let e = M.value.map((e) => ({ ...e })), t = e[e.length - 1], n = t ? z(t.pct + 10, 0, 100) : 100;
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
- }), I({ stops: e });
119
+ }), G({ stops: e });
106
120
  }
107
- function R(e) {
108
- F(e) || M.value.length < 2 || I({ stops: M.value.filter((t, n) => n !== e).map((e) => ({ ...e })) });
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 z(e, t, n) {
124
+ function J(e, t, n) {
111
125
  return Math.min(n, Math.max(t, e));
112
126
  }
113
- return (i, l) => {
114
- let A = h("svg-icon");
115
- return f(), o("div", {
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
- }, [m(i.$slots, "label", {}, () => [e.label ? (f(), o("label", {
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, b)) : a("", !0)]), s("div", x, [c(t, {
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: u(["btn input-gradient__toggle", { [`btn-${e.variant}`]: e.variant }]),
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: _(() => [s("span", {
148
+ default: v(() => [c("span", {
135
149
  class: "input-gradient__preview",
136
- style: d({ background: P.value }),
137
- title: P.value
138
- }, null, 12, S), s("span", C, [c(A, { symbol: "chevron-down" })])]),
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
- ]), s("ul", w, [(f(!0), o(r, null, p(M.value, (r, i) => (f(), o("li", { key: `${e.name}-stop-${i}` }, [s("div", T, [
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 || F(i),
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
- v(s("input", {
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 || F(i),
183
+ disabled: e.disabled || W(i),
170
184
  class: "form-control input-gradient__stop-pct"
171
- }, null, 8, E), [[
172
- g,
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 || F(i) || M.value.length < 2,
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) => R(i)
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)), s("li", null, [s("div", D, [v(s("input", {
193
- "onUpdate:modelValue": l[0] ||= (e) => N.value = e,
194
- type: "number",
195
- min: "0",
196
- max: "360",
197
- name: `${e.name}-angle`,
198
- id: `${e.name}-angle`,
199
- "aria-label": "Gradient angle",
200
- disabled: e.disabled || M.value.length < 2,
201
- class: "form-control input-gradient__angle"
202
- }, null, 8, O), [[
203
- g,
204
- N.value,
205
- void 0,
206
- { number: !0 }
207
- ]]), c(t, {
208
- type: "button",
209
- size: "small",
210
- color: "light",
211
- icon: k,
212
- disabled: e.disabled || M.value.length >= e.maxStops,
213
- "aria-label": "Add color stop",
214
- title: "Add color stop",
215
- class: "input-gradient__add btn btn-sm rounded-circle",
216
- onClick: L
217
- }, null, 8, ["disabled"])])])])])], 8, y);
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 { A as default };
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-gradient/input-gradient.js";
25
- import w from "./components/molecules/color-palette/color-palette.js";
26
- import T from "./components/molecules/input-dropdown/input-dropdown.js";
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, w 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, T as InputDropdown, v as InputFile, C 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 };
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 };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ablok-components",
3
3
  "private": false,
4
- "version": "0.3.143",
4
+ "version": "0.3.144",
5
5
  "type": "module",
6
6
  "dependencies": {
7
7
  "@tiptap/core": "^3.30.0",