@vizejs/fresco 0.716.0 → 0.717.0

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,4 +1,4 @@
1
- import { i as useInput, r as useMouse, s as useIsScreenReaderEnabled, t as createVirtualViewport } from "./useVirtualViewport-pPZWmwUC.mjs";
1
+ import { i as useInput, r as useMouse, s as useIsScreenReaderEnabled, t as createVirtualViewport } from "./useVirtualViewport-DYuUlTxU.mjs";
2
2
  import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, h, mergeProps, normalizeStyle, onMounted, onUnmounted, openBlock, ref, renderList, renderSlot, toDisplayString, unref, useSlots, watch, withCtx } from "vue";
3
3
  //#region src/components/Box.ts
4
4
  /**
@@ -164,56 +164,78 @@ var FrescoSpacer_default = /* @__PURE__ */ defineComponent({
164
164
  }
165
165
  });
166
166
  //#endregion
167
- //#region src/components/Divider.ts
168
- /**
169
- * Divider Component - Horizontal or vertical divider line
170
- */
171
- const Divider = defineComponent({
172
- name: "Divider",
167
+ //#region src/components/FrescoDivider.vue?vue&type=script&setup=true&lang.ts
168
+ const _hoisted_1$10 = ["fg"];
169
+ const _hoisted_2$8 = ["fg"];
170
+ const _hoisted_3$7 = ["fg"];
171
+ const _hoisted_4$3 = ["fg"];
172
+ const _hoisted_5$2 = ["fg"];
173
+ //#endregion
174
+ //#region src/components/FrescoDivider.vue
175
+ var FrescoDivider_default = /* @__PURE__ */ defineComponent({
176
+ name: "FrescoDivider",
177
+ __name: "FrescoDivider",
173
178
  props: {
174
179
  direction: {
175
180
  type: String,
181
+ required: false,
176
182
  default: "horizontal"
177
183
  },
178
- char: String,
179
- title: String,
184
+ char: {
185
+ type: String,
186
+ required: false
187
+ },
188
+ title: {
189
+ type: String,
190
+ required: false
191
+ },
180
192
  fg: {
181
193
  type: String,
194
+ required: false,
182
195
  default: "gray"
183
196
  },
184
- titleFg: String
197
+ titleFg: {
198
+ type: String,
199
+ required: false
200
+ }
185
201
  },
186
- setup(props) {
187
- return () => {
188
- const dividerChar = props.char ?? (props.direction === "horizontal" ? "─" : "│");
189
- if (props.direction === "vertical") return h("text", { fg: props.fg }, dividerChar);
190
- if (props.title) return h("box", { style: {
191
- flex_direction: "row",
192
- align_items: "center"
193
- } }, [
194
- h("text", { fg: props.fg }, dividerChar.repeat(3)),
195
- h("text", {
196
- fg: props.titleFg ?? props.fg,
202
+ setup(__props) {
203
+ const dividerChar = computed(() => __props.char ?? (__props.direction === "horizontal" ? "─" : "│"));
204
+ const titleLabel = computed(() => ` ${__props.title} `);
205
+ const titleRowStyle = {
206
+ flexDirection: "row",
207
+ alignItems: "center"
208
+ };
209
+ return (_ctx, _cache) => {
210
+ return __props.direction === "vertical" ? (openBlock(), createElementBlock("text", {
211
+ key: 0,
212
+ fg: __props.fg
213
+ }, toDisplayString(dividerChar.value), 9, _hoisted_1$10)) : __props.title ? (openBlock(), createElementBlock("div", {
214
+ key: 1,
215
+ style: titleRowStyle
216
+ }, [
217
+ createElementVNode("text", { fg: __props.fg }, toDisplayString(dividerChar.value.repeat(3)), 9, _hoisted_2$8),
218
+ createElementVNode("text", {
219
+ fg: __props.titleFg ?? __props.fg,
197
220
  bold: true
198
- }, ` ${props.title} `),
199
- h("text", { fg: props.fg }, dividerChar.repeat(3))
200
- ]);
201
- return h("text", { fg: props.fg }, dividerChar.repeat(40));
221
+ }, toDisplayString(titleLabel.value), 9, _hoisted_3$7),
222
+ createElementVNode("text", { fg: __props.fg }, toDisplayString(dividerChar.value.repeat(3)), 9, _hoisted_4$3)
223
+ ])) : (openBlock(), createElementBlock("text", {
224
+ key: 2,
225
+ fg: __props.fg
226
+ }, toDisplayString(dividerChar.value.repeat(40)), 9, _hoisted_5$2));
202
227
  };
203
228
  }
204
229
  });
205
230
  //#endregion
206
- //#region src/components/Stack.ts
207
- /**
208
- * Stack Component - Horizontal/Vertical stack layout helper
209
- */
210
- const ALIGN_MAP = {
231
+ //#region src/components/layout-primitive-types.ts
232
+ const stackAlignValues = {
211
233
  start: "flex-start",
212
234
  center: "center",
213
235
  end: "flex-end",
214
236
  stretch: "stretch"
215
237
  };
216
- const JUSTIFY_MAP = {
238
+ const stackJustifyValues = {
217
239
  start: "flex-start",
218
240
  center: "center",
219
241
  end: "flex-end",
@@ -221,74 +243,125 @@ const JUSTIFY_MAP = {
221
243
  around: "space-around",
222
244
  evenly: "space-evenly"
223
245
  };
224
- const Stack = defineComponent({
225
- name: "Stack",
246
+ //#endregion
247
+ //#region src/components/FrescoStack.vue
248
+ var FrescoStack_default = /* @__PURE__ */ defineComponent({
249
+ name: "FrescoStack",
250
+ __name: "FrescoStack",
226
251
  props: {
227
252
  direction: {
228
253
  type: String,
254
+ required: false,
229
255
  default: "vertical"
230
256
  },
231
257
  gap: {
232
258
  type: Number,
259
+ required: false,
233
260
  default: 0
234
261
  },
235
262
  align: {
236
263
  type: String,
264
+ required: false,
237
265
  default: "stretch"
238
266
  },
239
267
  justify: {
240
268
  type: String,
269
+ required: false,
241
270
  default: "start"
242
271
  },
243
272
  wrap: {
244
273
  type: Boolean,
274
+ required: false,
245
275
  default: false
246
276
  }
247
277
  },
248
- setup(props, { slots }) {
249
- return () => {
250
- return h("box", { style: {
251
- flex_direction: props.direction === "horizontal" ? "row" : "column",
252
- gap: props.gap,
253
- align_items: ALIGN_MAP[props.align ?? "stretch"],
254
- justify_content: JUSTIFY_MAP[props.justify ?? "start"],
255
- flex_wrap: props.wrap ? "wrap" : "nowrap"
256
- } }, slots.default?.());
278
+ setup(__props) {
279
+ const stackStyle = computed(() => ({
280
+ flexDirection: __props.direction === "horizontal" ? "row" : "column",
281
+ gap: __props.gap,
282
+ alignItems: stackAlignValues[__props.align],
283
+ justifyContent: stackJustifyValues[__props.justify],
284
+ flexWrap: __props.wrap ? "wrap" : "nowrap"
285
+ }));
286
+ return (_ctx, _cache) => {
287
+ return openBlock(), createElementBlock("div", { style: normalizeStyle(stackStyle.value) }, [renderSlot(_ctx.$slots, "default")], 4);
257
288
  };
258
289
  }
259
290
  });
260
- const HStack = defineComponent({
261
- name: "HStack",
291
+ //#endregion
292
+ //#region src/components/FrescoHStack.vue
293
+ var FrescoHStack_default = /* @__PURE__ */ defineComponent({
294
+ name: "FrescoHStack",
295
+ __name: "FrescoHStack",
262
296
  props: {
263
297
  gap: {
264
298
  type: Number,
299
+ required: false,
265
300
  default: 1
266
301
  },
267
- align: String,
268
- justify: String
302
+ align: {
303
+ type: String,
304
+ required: false
305
+ },
306
+ justify: {
307
+ type: String,
308
+ required: false
309
+ }
269
310
  },
270
- setup(props, { slots }) {
271
- return () => h(Stack, {
272
- direction: "horizontal",
273
- ...props
274
- }, slots.default);
311
+ setup(__props) {
312
+ return (_ctx, _cache) => {
313
+ return openBlock(), createBlock(FrescoStack_default, {
314
+ direction: "horizontal",
315
+ gap: __props.gap,
316
+ align: __props.align,
317
+ justify: __props.justify
318
+ }, {
319
+ default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
320
+ _: 3
321
+ }, 8, [
322
+ "gap",
323
+ "align",
324
+ "justify"
325
+ ]);
326
+ };
275
327
  }
276
328
  });
277
- const VStack = defineComponent({
278
- name: "VStack",
329
+ //#endregion
330
+ //#region src/components/FrescoVStack.vue
331
+ var FrescoVStack_default = /* @__PURE__ */ defineComponent({
332
+ name: "FrescoVStack",
333
+ __name: "FrescoVStack",
279
334
  props: {
280
335
  gap: {
281
336
  type: Number,
337
+ required: false,
282
338
  default: 0
283
339
  },
284
- align: String,
285
- justify: String
340
+ align: {
341
+ type: String,
342
+ required: false
343
+ },
344
+ justify: {
345
+ type: String,
346
+ required: false
347
+ }
286
348
  },
287
- setup(props, { slots }) {
288
- return () => h(Stack, {
289
- direction: "vertical",
290
- ...props
291
- }, slots.default);
349
+ setup(__props) {
350
+ return (_ctx, _cache) => {
351
+ return openBlock(), createBlock(FrescoStack_default, {
352
+ direction: "vertical",
353
+ gap: __props.gap,
354
+ align: __props.align,
355
+ justify: __props.justify
356
+ }, {
357
+ default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
358
+ _: 3
359
+ }, 8, [
360
+ "gap",
361
+ "align",
362
+ "justify"
363
+ ]);
364
+ };
292
365
  }
293
366
  });
294
367
  //#endregion
@@ -1090,7 +1163,6 @@ var FrescoLink_default = /* @__PURE__ */ defineComponent({
1090
1163
  default: false
1091
1164
  }
1092
1165
  },
1093
- emits: ["click"],
1094
1166
  setup(__props) {
1095
1167
  const rowStyle = { flexDirection: "row" };
1096
1168
  return (_ctx, _cache) => {
@@ -1908,9 +1980,12 @@ var FrescoSpinner_default = /* @__PURE__ */ defineComponent({
1908
1980
  },
1909
1981
  setup(__props) {
1910
1982
  const frameIndex = ref(0);
1911
- const frames = computed(() => __props.frames ?? spinnerTypes[__props.type] ?? spinnerTypes.dots);
1983
+ const frames = computed(() => {
1984
+ const selectedFrames = __props.frames ?? spinnerTypes[__props.type] ?? spinnerTypes.dots;
1985
+ return selectedFrames.length > 0 ? selectedFrames : spinnerTypes.dots;
1986
+ });
1912
1987
  const content = computed(() => {
1913
- const frame = frames.value[frameIndex.value];
1988
+ const frame = frames.value[frameIndex.value % frames.value.length];
1914
1989
  return __props.label ? `${frame} ${__props.label}` : frame;
1915
1990
  });
1916
1991
  let timer = null;
@@ -3326,6 +3401,6 @@ var FrescoAvatar_default = /* @__PURE__ */ defineComponent({
3326
3401
  }
3327
3402
  });
3328
3403
  //#endregion
3329
- export { FrescoNewline_default as A, FrescoSpacer_default as B, Select as C, Code as D, FrescoLink_default as E, Grid as F, HStack as I, Stack as L, ScrollBar_default as M, Text as N, FrescoTransform_default as O, FrescoCard_default as P, VStack as R, Checkbox as S, TextInput as T, Box as V, ProgressBar as _, Modal as a, Confirm as b, Tabs as c, Table as d, List as f, FrescoAlert_default as g, FrescoBadge_default as h, StatusBar as i, ScrollBox_default as j, FrescoStatic_default as k, Menu as l, Timer as m, KeyHint as n, Stepper as o, FrescoTooltip_default as p, FrescoHeader_default as r, FrescoBreadcrumb_default as s, FrescoAvatar_default as t, Tree as u, FrescoSpinner_default as v, TextArea as w, RadioGroup as x, Form as y, Divider as z };
3404
+ export { FrescoNewline_default as A, FrescoSpacer_default as B, Select as C, Code as D, FrescoLink_default as E, Grid as F, FrescoVStack_default as I, FrescoHStack_default as L, ScrollBar_default as M, Text as N, FrescoTransform_default as O, FrescoCard_default as P, FrescoStack_default as R, Checkbox as S, TextInput as T, Box as V, ProgressBar as _, Modal as a, Confirm as b, Tabs as c, Table as d, List as f, FrescoAlert_default as g, FrescoBadge_default as h, StatusBar as i, ScrollBox_default as j, FrescoStatic_default as k, Menu as l, Timer as m, KeyHint as n, Stepper as o, FrescoTooltip_default as p, FrescoHeader_default as r, FrescoBreadcrumb_default as s, FrescoAvatar_default as t, Tree as u, FrescoSpinner_default as v, TextArea as w, RadioGroup as x, Form as y, FrescoDivider_default as z };
3330
3405
 
3331
- //# sourceMappingURL=components-D9SeB0Be.mjs.map
3406
+ //# sourceMappingURL=components-C57eT1BL.mjs.map