fluekit 1.5.6 → 1.5.7

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,10 +1,10 @@
1
1
  import { CSSProperties } from 'vue';
2
2
  declare const BOX_CONSTRAINTS_SYMBOL: unique symbol;
3
3
  export interface BoxConstraintsProps {
4
- minWidth?: number;
5
- maxWidth?: number;
6
- minHeight?: number;
7
- maxHeight?: number;
4
+ minWidth?: number | string;
5
+ maxWidth?: number | string;
6
+ minHeight?: number | string;
7
+ maxHeight?: number | string;
8
8
  }
9
9
  export type BoxConstraints = BoxConstraintsProps & {
10
10
  [BOX_CONSTRAINTS_SYMBOL]?: true;
@@ -0,0 +1,38 @@
1
+ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
2
+ /**
3
+ * A function that acts as the `setup` function for this component.
4
+ * It can contain composition API calls (like `inject`, `useMediaQuery`)
5
+ * and should return a render function (returning VNodeChild).
6
+ *
7
+ * Example:
8
+ * ```ts
9
+ * () => {
10
+ * const mq = useMediaQuery();
11
+ * return () => h('div', mq.size.width);
12
+ * }
13
+ * ```
14
+ */
15
+ builder: {
16
+ type: FunctionConstructor;
17
+ required: true;
18
+ };
19
+ }>, any, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
20
+ /**
21
+ * A function that acts as the `setup` function for this component.
22
+ * It can contain composition API calls (like `inject`, `useMediaQuery`)
23
+ * and should return a render function (returning VNodeChild).
24
+ *
25
+ * Example:
26
+ * ```ts
27
+ * () => {
28
+ * const mq = useMediaQuery();
29
+ * return () => h('div', mq.size.width);
30
+ * }
31
+ * ```
32
+ */
33
+ builder: {
34
+ type: FunctionConstructor;
35
+ required: true;
36
+ };
37
+ }>> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
38
+ export default _default;
package/dist/Column.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { FlexBoxProps } from './FlexProps';
1
+ import { FlexBoxProps, MainAxisSize } from './FlexProps';
2
2
  declare function __VLS_template(): {
3
3
  attrs: Partial<{}>;
4
4
  slots: {
@@ -8,7 +8,9 @@ declare function __VLS_template(): {
8
8
  rootEl: any;
9
9
  };
10
10
  type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
11
- declare const __VLS_component: import('vue').DefineComponent<FlexBoxProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<FlexBoxProps> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
11
+ declare const __VLS_component: import('vue').DefineComponent<FlexBoxProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<FlexBoxProps> & Readonly<{}>, {
12
+ mainAxisSize: MainAxisSize;
13
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
12
14
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
13
15
  export default _default;
14
16
  type __VLS_WithTemplateSlots<T, S> = T & {
@@ -15,6 +15,7 @@ interface Props {
15
15
  transform?: string;
16
16
  transformAlignment?: Alignment;
17
17
  constraints?: BoxConstraints;
18
+ flex?: number | string;
18
19
  }
19
20
  declare function __VLS_template(): {
20
21
  attrs: Partial<{}>;
@@ -1,33 +1,33 @@
1
1
  declare const EDGE_INSETS_SYMBOL: unique symbol;
2
2
  export interface EdgeInsetsProps {
3
- top?: number;
4
- right?: number;
5
- bottom?: number;
6
- left?: number;
7
- horizontal?: number;
8
- vertical?: number;
3
+ top?: number | string;
4
+ right?: number | string;
5
+ bottom?: number | string;
6
+ left?: number | string;
7
+ horizontal?: number | string;
8
+ vertical?: number | string;
9
9
  }
10
10
  export type EdgeInsets = EdgeInsetsProps & {
11
11
  [EDGE_INSETS_SYMBOL]?: true;
12
12
  };
13
13
  export declare function EdgeInsets(edgeInsets: EdgeInsetsProps): EdgeInsets;
14
14
  export declare namespace EdgeInsets {
15
- var all: (value: number) => {
16
- top: number;
17
- right: number;
18
- bottom: number;
19
- left: number;
15
+ var all: (value: number | string) => {
16
+ top: string | number;
17
+ right: string | number;
18
+ bottom: string | number;
19
+ left: string | number;
20
20
  [EDGE_INSETS_SYMBOL]: true;
21
21
  };
22
- var symmetric: ({ vertical, horizontal }: {
23
- vertical?: number;
24
- horizontal?: number;
22
+ var symmetric: ({ vertical, horizontal, }: {
23
+ vertical?: number | string;
24
+ horizontal?: number | string;
25
25
  }) => EdgeInsets;
26
26
  var only: ({ top, right, bottom, left, }: {
27
- top?: number;
28
- right?: number;
29
- bottom?: number;
30
- left?: number;
27
+ top?: number | string;
28
+ right?: number | string;
29
+ bottom?: number | string;
30
+ left?: number | string;
31
31
  }) => EdgeInsets;
32
32
  var zero: EdgeInsets;
33
33
  }
package/dist/FlexBox.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { CrossAxisAlignment, FlexBoxProps, MainAxisAlignment } from './FlexProps';
1
+ import { CrossAxisAlignment, FlexBoxProps, MainAxisAlignment, MainAxisSize } from './FlexProps';
2
2
  declare function __VLS_template(): {
3
3
  attrs: Partial<{}>;
4
4
  slots: {
@@ -14,6 +14,7 @@ declare const __VLS_component: import('vue').DefineComponent<FlexBoxProps, {}, {
14
14
  direction: "row" | "column" | "row-reverse" | "column-reverse" | string;
15
15
  gap: number;
16
16
  mainAxisAlignment: MainAxisAlignment;
17
+ mainAxisSize: MainAxisSize;
17
18
  crossAxisAlignment: CrossAxisAlignment;
18
19
  as: string;
19
20
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
@@ -27,9 +27,19 @@ export declare const MainAxisAlignment: {
27
27
  readonly spaceEvenly: "space-evenly";
28
28
  };
29
29
  export type MainAxisAlignment = Valueof<typeof MainAxisAlignment> | string;
30
+ /**
31
+ * MainAxisSize
32
+ * 对应 Flutter 的 MainAxisSize
33
+ */
34
+ export declare const MainAxisSize: {
35
+ readonly min: "min";
36
+ readonly max: "max";
37
+ };
38
+ export type MainAxisSize = Valueof<typeof MainAxisSize> | string;
30
39
  export type FlexBoxProps = {
31
40
  direction?: "row" | "column" | "row-reverse" | "column-reverse" | string;
32
41
  mainAxisAlignment?: MainAxisAlignment;
42
+ mainAxisSize?: MainAxisSize;
33
43
  crossAxisAlignment?: CrossAxisAlignment;
34
44
  wrap?: boolean;
35
45
  gap?: number;
@@ -0,0 +1,24 @@
1
+ import { BoxConstraints } from './BoxConstraints';
2
+ declare function __VLS_template(): {
3
+ attrs: Partial<{}>;
4
+ slots: {
5
+ default?(_: {
6
+ constraints: BoxConstraints;
7
+ }): any;
8
+ };
9
+ refs: {
10
+ el: HTMLDivElement;
11
+ };
12
+ rootEl: HTMLDivElement;
13
+ };
14
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
15
+ declare const __VLS_component: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {
16
+ el: HTMLDivElement;
17
+ }, HTMLDivElement>;
18
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
19
+ export default _default;
20
+ type __VLS_WithTemplateSlots<T, S> = T & {
21
+ new (): {
22
+ $slots: S;
23
+ };
24
+ };
@@ -0,0 +1,21 @@
1
+ import { MediaQueryData } from './MediaQuery';
2
+ type __VLS_Props = {
3
+ data: MediaQueryData;
4
+ };
5
+ declare function __VLS_template(): {
6
+ attrs: Partial<{}>;
7
+ slots: {
8
+ default?(_: {}): any;
9
+ };
10
+ refs: {};
11
+ rootEl: any;
12
+ };
13
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
14
+ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
15
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
16
+ export default _default;
17
+ type __VLS_WithTemplateSlots<T, S> = T & {
18
+ new (): {
19
+ $slots: S;
20
+ };
21
+ };
package/dist/Row.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { FlexBoxProps } from './FlexProps';
1
+ import { FlexBoxProps, MainAxisSize } from './FlexProps';
2
2
  declare function __VLS_template(): {
3
3
  attrs: Partial<{}>;
4
4
  slots: {
@@ -12,6 +12,7 @@ declare const __VLS_component: import('vue').DefineComponent<FlexBoxProps, {}, {
12
12
  wrap: boolean;
13
13
  expanded: boolean;
14
14
  mainAxisAlignment: import('./FlexProps').MainAxisAlignment;
15
+ mainAxisSize: MainAxisSize;
15
16
  crossAxisAlignment: import('./FlexProps').CrossAxisAlignment;
16
17
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
17
18
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
@@ -1,17 +1,25 @@
1
1
  import { BoxDecoration } from './BoxDecoration';
2
2
  import { EdgeInsets } from './EdgeInsets';
3
+ import { TextStyle } from './TextStyle';
4
+ import { BorderRadius } from './BorderRadius';
3
5
  export interface SegmentedControlItem<T> {
4
6
  value: T;
5
7
  label: string;
8
+ disabled?: boolean;
6
9
  }
7
10
  export interface SegmentedControlProps<T> {
8
11
  modelValue: T;
9
12
  items: SegmentedControlItem<T>[];
10
13
  selectedColor?: string;
11
14
  unselectedColor?: string;
15
+ disabledColor?: string;
12
16
  borderColor?: string;
13
17
  padding?: EdgeInsets;
14
18
  decoration?: BoxDecoration;
19
+ selectedTextStyle?: TextStyle;
20
+ unselectedTextStyle?: TextStyle;
21
+ disabledTextStyle?: TextStyle;
22
+ borderRadius?: BorderRadius;
15
23
  }
16
24
  declare const _default: <T extends string | number | boolean>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
17
25
  props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
package/dist/Slider.d.ts CHANGED
@@ -14,9 +14,9 @@ declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, imp
14
14
  onChange?: ((value: number) => any) | undefined;
15
15
  "onUpdate:value"?: ((value: number) => any) | undefined;
16
16
  }>, {
17
- activeColor: string;
18
17
  min: number;
19
18
  max: number;
19
+ activeColor: string;
20
20
  inactiveColor: string;
21
21
  thumbColor: string;
22
22
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
package/dist/index.d.ts CHANGED
@@ -41,6 +41,9 @@ export { default as Slider } from './Slider';
41
41
  export { default as AlertDialog } from './AlertDialog';
42
42
  export { default as BottomSheet } from './BottomSheet';
43
43
  export { default as SegmentedControl } from './SegmentedControl';
44
+ export { default as Builder } from './Builder';
45
+ export { default as LayoutBuilder } from './LayoutBuilder';
46
+ export { default as MediaQuery } from './MediaQuery';
44
47
  export { SnackBar } from './SnackBar';
45
48
  export * from './Border';
46
49
  export * from './BoxConstraints';
@@ -49,6 +52,7 @@ export * from './BorderRadius';
49
52
  export * from './BoxShadow';
50
53
  export * from './ButtonStyle';
51
54
  export * from './EdgeInsets';
55
+ export * from './MediaQuery';
52
56
  export { Alignment as Alignment } from './FlexProps';
53
57
  export { StackFit, CrossAxisAlignment, MainAxisAlignment } from './FlexProps';
54
58
  export * from './Gradient';
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { Comment, Fragment, Text, cloneVNode, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createTextVNode, createVNode, defineComponent, h, inject, mergeProps, nextTick, normalizeClass, normalizeStyle, onBeforeUnmount, onMounted, onUnmounted, openBlock, provide, ref, render, renderList, renderSlot, resolveDynamicComponent, toDisplayString, unref, useAttrs, useSlots, warn, watch, withCtx, withModifiers } from "vue";
1
+ import { Comment, Fragment, Text, cloneVNode, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createTextVNode, createVNode, defineComponent, h, inject, mergeProps, nextTick, normalizeClass, normalizeStyle, onBeforeUnmount, onMounted, onUnmounted, openBlock, provide, reactive, ref, render, renderList, renderSlot, resolveDynamicComponent, shallowRef, toDisplayString, unref, useAttrs, useSlots, warn, watch, withCtx, withModifiers } from "vue";
2
2
  function isUndefined(e) {
3
3
  return e === void 0;
4
4
  }
@@ -37,7 +37,7 @@ var EXCLUDED_VALUES = [
37
37
  "-0%",
38
38
  "-0px",
39
39
  "+0px"
40
- ], nonTransform = (e) => e.endsWith("vw") || e.endsWith("%") || EXCLUDED_VALUES.includes(e);
40
+ ], nonTransform = (e) => e.endsWith("vw") || e.endsWith("%") || e.endsWith("PX") || EXCLUDED_VALUES.includes(e);
41
41
  function px2vw(e, C = DEFAULT_VW) {
42
42
  if (!canTransform) return isPureNumber(`${e}`) ? `${e}px` : e;
43
43
  if (!(e === void 0 || e == null || typeof e == "number" && !Number.isFinite(e))) {
@@ -198,7 +198,7 @@ var Align_default = /* @__PURE__ */ defineComponent({
198
198
  }
199
199
  }), BOX_CONSTRAINTS_SYMBOL = Symbol("boxConstraints"), toVal = (e) => e === Infinity ? void 0 : e;
200
200
  function BoxConstraints(e = {}) {
201
- let C = Math.max(0, e.minWidth ?? 0), w = Math.max(0, e.minHeight ?? 0), T = Math.max(C, e.maxWidth ?? Infinity), E = Math.max(w, e.maxHeight ?? Infinity);
201
+ let C = e.minWidth ?? 0, w = e.minHeight ?? 0, T = e.maxWidth ?? Infinity, E = e.maxHeight ?? Infinity;
202
202
  return {
203
203
  minWidth: toVal(C),
204
204
  maxWidth: toVal(T),
@@ -507,6 +507,9 @@ const paddingToStyle = (e) => edgeInsetsToStyle("padding", e), marginToStyle = (
507
507
  spaceBetween: "space-between",
508
508
  spaceAround: "space-around",
509
509
  spaceEvenly: "space-evenly"
510
+ }, MainAxisSize = {
511
+ min: "min",
512
+ max: "max"
510
513
  }, FlexBoxJustifyMap = {
511
514
  start: "flex-start",
512
515
  end: "flex-end",
@@ -820,7 +823,8 @@ var AnimatedContainer_default = /* @__PURE__ */ defineComponent({
820
823
  clipBehavior: { default: "none" },
821
824
  transform: {},
822
825
  transformAlignment: {},
823
- constraints: {}
826
+ constraints: {},
827
+ flex: {}
824
828
  },
825
829
  setup(e) {
826
830
  let C = useStyles(), w = useSafeAttrs(), T = useGestureEvents(), D = computed(() => C.value.pointerEvents == "none" ? w.value : {
@@ -839,7 +843,7 @@ var AnimatedContainer_default = /* @__PURE__ */ defineComponent({
839
843
  flexDirection: "column"
840
844
  }), Object.assign(e, alignmentToFlex(j.alignment, "column"))), Object.assign(e, sizeToStyle(j));
841
845
  let w = boxConstraintsToStyle(j.constraints);
842
- return isDefined(j.width) && (delete w.minWidth, delete w.maxWidth), isDefined(j.height) && (delete w.minHeight, delete w.maxHeight), Object.assign(e, w), Object.assign(e, paddingToStyle(j.padding)), Object.assign(e, marginToStyle(j.margin)), Object.assign(e, boxDecorationToStyle(j.decoration)), Object.assign(e, A), j.clipBehavior === "antiAlias" && (e.borderRadius = e.borderRadius || "inherit"), e;
846
+ return isDefined(j.width) && (delete w.minWidth, delete w.maxWidth), isDefined(j.height) && (delete w.minHeight, delete w.maxHeight), Object.assign(e, w), Object.assign(e, paddingToStyle(j.padding)), Object.assign(e, marginToStyle(j.margin)), Object.assign(e, boxDecorationToStyle(j.decoration)), Object.assign(e, A), j.flex !== void 0 && (typeof j.flex == "number" ? e.flex = `${j.flex} 1 0%` : e.flex = j.flex), j.clipBehavior === "antiAlias" && (e.borderRadius = e.borderRadius || "inherit"), e;
843
847
  }), N = computed(() => {
844
848
  let e = {
845
849
  position: "absolute",
@@ -949,7 +953,7 @@ var GestureDetector_default = defineComponent({
949
953
  inheritAttrs: !1,
950
954
  props: { behavior: {
951
955
  type: String,
952
- default: "deferToChild"
956
+ default: "opaque"
953
957
  } },
954
958
  emits: events,
955
959
  setup(e, { slots: C, emit: E }) {
@@ -1067,6 +1071,7 @@ var GestureDetector_default = defineComponent({
1067
1071
  props: {
1068
1072
  direction: { default: "row" },
1069
1073
  mainAxisAlignment: { default: MainAxisAlignment.start },
1074
+ mainAxisSize: { default: MainAxisSize.max },
1070
1075
  crossAxisAlignment: { default: CrossAxisAlignment.start },
1071
1076
  wrap: {
1072
1077
  type: Boolean,
@@ -1083,14 +1088,16 @@ var GestureDetector_default = defineComponent({
1083
1088
  setup(e) {
1084
1089
  let C = e, w = useSafeAttrs(), T = computed(() => {
1085
1090
  let e = ["flex-box", `flex-box-${C.direction}`];
1086
- return C.expanded && e.push("flex-expanded"), e.join(" ");
1091
+ return C.expanded && e.push("flex-expanded"), C.mainAxisSize === MainAxisSize.min && e.push("main-axis-min"), e.join(" ");
1087
1092
  }), O = computed(() => {
1088
1093
  let e = C.mainAxisAlignment, w = C.crossAxisAlignment, T = {
1089
1094
  display: "flex",
1090
1095
  flexDirection: C.direction,
1091
1096
  flexWrap: C.wrap ? "wrap" : "nowrap"
1092
1097
  };
1093
- return T.justifyContent = FlexBoxJustifyMap[e] || e, T.alignItems = FlexBoxAlignMap[w] || w, T.gap = px2vw(C.gap), C.expanded && (T.flex = "1", T.width = "100%", T.height = "100%"), C.constraints && Object.assign(T, boxConstraintsToStyle(C.constraints)), T;
1098
+ T.justifyContent = FlexBoxJustifyMap[e] || e, T.alignItems = FlexBoxAlignMap[w] || w, T.gap = px2vw(C.gap);
1099
+ let E = C.direction?.includes("row"), D = C.direction?.includes("column");
1100
+ return C.mainAxisSize === MainAxisSize.min ? (E && (T.width = "fit-content"), D && (T.height = "fit-content")) : (E && (T.width = "100%"), D && (T.height = "100%")), C.expanded && (T.flex = "1", T.width = "100%", T.height = "100%"), C.constraints && Object.assign(T, boxConstraintsToStyle(C.constraints)), T;
1094
1101
  });
1095
1102
  return (C, E) => (openBlock(), createBlock(resolveDynamicComponent(e.as), mergeProps({
1096
1103
  class: T.value,
@@ -1106,6 +1113,7 @@ var GestureDetector_default = defineComponent({
1106
1113
  props: {
1107
1114
  direction: {},
1108
1115
  mainAxisAlignment: {},
1116
+ mainAxisSize: { default: MainAxisSize.max },
1109
1117
  crossAxisAlignment: {},
1110
1118
  wrap: { type: Boolean },
1111
1119
  gap: {},
@@ -1117,6 +1125,7 @@ var GestureDetector_default = defineComponent({
1117
1125
  return (C, w) => (openBlock(), createBlock(FlexBox_default, {
1118
1126
  direction: "column",
1119
1127
  "main-axis-alignment": e.mainAxisAlignment,
1128
+ "main-axis-size": e.mainAxisSize,
1120
1129
  "cross-axis-alignment": e.crossAxisAlignment,
1121
1130
  wrap: e.wrap,
1122
1131
  gap: e.gap,
@@ -1126,6 +1135,7 @@ var GestureDetector_default = defineComponent({
1126
1135
  _: 3
1127
1136
  }, 8, [
1128
1137
  "main-axis-alignment",
1138
+ "main-axis-size",
1129
1139
  "cross-axis-alignment",
1130
1140
  "wrap",
1131
1141
  "gap",
@@ -1591,6 +1601,7 @@ var Positioned_default = /* @__PURE__ */ defineComponent({
1591
1601
  props: {
1592
1602
  direction: {},
1593
1603
  mainAxisAlignment: { default: "start" },
1604
+ mainAxisSize: { default: MainAxisSize.max },
1594
1605
  crossAxisAlignment: { default: "center" },
1595
1606
  wrap: {
1596
1607
  type: Boolean,
@@ -1608,6 +1619,7 @@ var Positioned_default = /* @__PURE__ */ defineComponent({
1608
1619
  return (C, w) => (openBlock(), createBlock(FlexBox_default, {
1609
1620
  direction: "row",
1610
1621
  "main-axis-alignment": e.mainAxisAlignment,
1622
+ "main-axis-size": e.mainAxisSize,
1611
1623
  "cross-axis-alignment": e.crossAxisAlignment,
1612
1624
  wrap: e.wrap,
1613
1625
  gap: e.gap,
@@ -1618,6 +1630,7 @@ var Positioned_default = /* @__PURE__ */ defineComponent({
1618
1630
  _: 3
1619
1631
  }, 8, [
1620
1632
  "main-axis-alignment",
1633
+ "main-axis-size",
1621
1634
  "cross-axis-alignment",
1622
1635
  "wrap",
1623
1636
  "gap",
@@ -2873,36 +2886,66 @@ var Transform_default = /* @__PURE__ */ __plugin_vue_export_helper_default(/* @_
2873
2886
  items: {},
2874
2887
  selectedColor: { default: "#007AFF" },
2875
2888
  unselectedColor: { default: "transparent" },
2889
+ disabledColor: { default: "#F5F5F5" },
2876
2890
  borderColor: { default: "#007AFF" },
2877
2891
  padding: { default: () => EdgeInsets.symmetric({
2878
2892
  vertical: 8,
2879
2893
  horizontal: 16
2880
2894
  }) },
2881
- decoration: {}
2895
+ decoration: {},
2896
+ selectedTextStyle: {},
2897
+ unselectedTextStyle: {},
2898
+ disabledTextStyle: {},
2899
+ borderRadius: { default: () => BorderRadius.circular(4) }
2882
2900
  },
2883
2901
  emits: ["update:modelValue", "change"],
2884
2902
  setup(e, { emit: w }) {
2885
2903
  let T = e, O = w, A = (e) => {
2886
- e !== T.modelValue && (O("update:modelValue", e), O("change", e));
2904
+ e.disabled || e.value !== T.modelValue && (O("update:modelValue", e.value), O("change", e.value));
2887
2905
  }, j = computed(() => T.decoration ? T.decoration : BoxDecoration({
2888
2906
  border: Border.all({
2889
2907
  color: T.borderColor,
2890
2908
  width: 1
2891
2909
  }),
2892
- borderRadius: BorderRadius.circular(4)
2910
+ borderRadius: T.borderRadius
2893
2911
  })), P = (e, C) => {
2894
- let w = e === T.modelValue, E = C === T.items.length - 1;
2895
- return BoxDecoration({
2896
- color: w ? T.selectedColor : T.unselectedColor,
2897
- border: E ? void 0 : Border.only({ right: BorderSide({
2898
- color: T.borderColor,
2912
+ let w = e.value === T.modelValue, E = C === T.items.length - 1, D = C === 0, O = BorderRadius.zero;
2913
+ D ? O = BorderRadius.only({
2914
+ topLeft: T.borderRadius.topLeft,
2915
+ bottomLeft: T.borderRadius.bottomLeft
2916
+ }) : E && (O = BorderRadius.only({
2917
+ topRight: T.borderRadius.topRight,
2918
+ bottomRight: T.borderRadius.bottomRight
2919
+ }));
2920
+ let k = w ? T.selectedColor : T.unselectedColor;
2921
+ return e.disabled && (k = T.disabledColor), BoxDecoration({
2922
+ color: k,
2923
+ borderRadius: O,
2924
+ border: Border.only({ right: BorderSide({
2925
+ color: E ? "transparent" : T.borderColor,
2899
2926
  width: 1
2900
2927
  }) })
2901
2928
  });
2902
- }, F = (e) => TextStyle({
2903
- color: e === T.modelValue ? "#FFFFFF" : T.borderColor,
2904
- fontSize: 13
2905
- });
2929
+ }, F = (e) => {
2930
+ let C = e.value === T.modelValue, w = e.disabled, E = TextStyle({
2931
+ color: C ? "#FFFFFF" : T.borderColor,
2932
+ fontSize: 13
2933
+ });
2934
+ return w ? T.disabledTextStyle ? {
2935
+ ...E,
2936
+ ...T.disabledTextStyle,
2937
+ color: "#999999"
2938
+ } : {
2939
+ ...E,
2940
+ color: "#999999"
2941
+ } : C && T.selectedTextStyle ? {
2942
+ ...E,
2943
+ ...T.selectedTextStyle
2944
+ } : !C && T.unselectedTextStyle ? {
2945
+ ...E,
2946
+ ...T.unselectedTextStyle
2947
+ } : E;
2948
+ };
2906
2949
  return (w, T) => (openBlock(), createBlock(Container_default, {
2907
2950
  decoration: j.value,
2908
2951
  "clip-behavior": "hardEdge"
@@ -2910,18 +2953,18 @@ var Transform_default = /* @__PURE__ */ __plugin_vue_export_helper_default(/* @_
2910
2953
  default: withCtx(() => [createVNode(Row_default, null, {
2911
2954
  default: withCtx(() => [(openBlock(!0), createElementBlock(Fragment, null, renderList(e.items, (C, T) => (openBlock(), createBlock(GestureDetector_default, {
2912
2955
  key: T,
2913
- onTap: (e) => A(C.value)
2956
+ onTap: (e) => A(C)
2914
2957
  }, {
2915
2958
  default: withCtx(() => [createVNode(Container_default, {
2916
2959
  padding: e.padding,
2917
- decoration: P(C.value, T),
2960
+ decoration: P(C, T),
2918
2961
  alignment: "center"
2919
2962
  }, {
2920
2963
  default: withCtx(() => [renderSlot(w.$slots, "label", {
2921
2964
  item: C,
2922
2965
  selected: C.value === e.modelValue,
2923
2966
  index: T
2924
- }, () => [createVNode(Text_default, { style: normalizeStyle(F(C.value)) }, {
2967
+ }, () => [createVNode(Text_default, { style: normalizeStyle(F(C)) }, {
2925
2968
  default: withCtx(() => [createTextVNode(toDisplayString(C.label), 1)]),
2926
2969
  _: 2
2927
2970
  }, 1032, ["style"])])]),
@@ -2934,6 +2977,88 @@ var Transform_default = /* @__PURE__ */ __plugin_vue_export_helper_default(/* @_
2934
2977
  _: 3
2935
2978
  }, 8, ["decoration"]));
2936
2979
  }
2980
+ }), Builder_default = defineComponent({
2981
+ name: "Builder",
2982
+ props: { builder: {
2983
+ type: Function,
2984
+ required: !0
2985
+ } },
2986
+ setup(e) {
2987
+ return e.builder();
2988
+ }
2989
+ }), LayoutBuilder_default = /* @__PURE__ */ defineComponent({
2990
+ __name: "LayoutBuilder",
2991
+ setup(e) {
2992
+ let C = ref(null), w = shallowRef(null), T = null, E = {
2993
+ width: "100%",
2994
+ height: "100%",
2995
+ display: "block"
2996
+ };
2997
+ return onMounted(() => {
2998
+ C.value && (T = new ResizeObserver((e) => {
2999
+ for (let C of e) {
3000
+ let e = C.contentRect.width, T = C.contentRect.height;
3001
+ w.value = BoxConstraints.tight({
3002
+ width: e,
3003
+ height: T
3004
+ });
3005
+ }
3006
+ }), T.observe(C.value));
3007
+ }), onUnmounted(() => {
3008
+ T?.disconnect();
3009
+ }), (e, T) => (openBlock(), createElementBlock("div", {
3010
+ ref_key: "el",
3011
+ ref: C,
3012
+ class: "fluekit-layout-builder",
3013
+ style: E
3014
+ }, [w.value ? renderSlot(e.$slots, "default", {
3015
+ key: 0,
3016
+ constraints: w.value
3017
+ }) : createCommentVNode("", !0)], 512));
3018
+ }
3019
+ });
3020
+ let Orientation = /* @__PURE__ */ function(e) {
3021
+ return e.portrait = "portrait", e.landscape = "landscape", e;
3022
+ }({});
3023
+ const MediaQueryKey = Symbol("MediaQuery");
3024
+ var globalState = reactive({
3025
+ size: {
3026
+ width: 0,
3027
+ height: 0
3028
+ },
3029
+ devicePixelRatio: 1,
3030
+ platformBrightness: "light",
3031
+ orientation: Orientation.portrait,
3032
+ disableAnimations: !1,
3033
+ highContrast: !1,
3034
+ padding: EdgeInsets.zero,
3035
+ viewInsets: EdgeInsets.zero
3036
+ }), listenersAttached = !1, updateGlobalState = () => {
3037
+ if (typeof window > "u") return;
3038
+ let e = window.innerWidth, C = window.innerHeight;
3039
+ globalState.size = {
3040
+ width: e,
3041
+ height: C
3042
+ }, globalState.devicePixelRatio = window.devicePixelRatio || 1, globalState.orientation = e > C ? Orientation.landscape : Orientation.portrait, globalState.platformBrightness = window.matchMedia?.("(prefers-color-scheme: dark)").matches ? "dark" : "light", globalState.disableAnimations = !!window.matchMedia?.("(prefers-reduced-motion: reduce)").matches, globalState.highContrast = !!window.matchMedia?.("(prefers-contrast: more)").matches;
3043
+ }, attachListeners = () => {
3044
+ typeof window > "u" || listenersAttached || (window.addEventListener("resize", updateGlobalState), [
3045
+ "(prefers-color-scheme: dark)",
3046
+ "(prefers-reduced-motion: reduce)",
3047
+ "(prefers-contrast: more)"
3048
+ ].forEach((e) => {
3049
+ let C = window.matchMedia?.(e);
3050
+ C?.addEventListener ? C.addEventListener("change", updateGlobalState) : C?.addListener && C.addListener(updateGlobalState);
3051
+ }), updateGlobalState(), listenersAttached = !0);
3052
+ };
3053
+ function useMediaQuery() {
3054
+ return attachListeners(), inject(MediaQueryKey, globalState);
3055
+ }
3056
+ var MediaQuery_default = /* @__PURE__ */ defineComponent({
3057
+ __name: "MediaQuery",
3058
+ props: { data: {} },
3059
+ setup(e) {
3060
+ return provide(MediaQueryKey, e.data), (e, C) => renderSlot(e.$slots, "default");
3061
+ }
2937
3062
  }), _hoisted_1 = { class: "snackbar-overlay" }, SnackBarComponent_default = /* @__PURE__ */ __plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
2938
3063
  __name: "SnackBarComponent",
2939
3064
  props: {
@@ -3027,4 +3152,4 @@ var Transform_default = /* @__PURE__ */ __plugin_vue_export_helper_default(/* @_
3027
3152
  }
3028
3153
  };
3029
3154
  setTransform(!1);
3030
- export { AlertDialog_default as AlertDialog, Align_default as Align, Alignment, AnimatedContainer_default as AnimatedContainer, AnimatedOpacity_default as AnimatedOpacity, AssetImage, BlurStyle, Border, BorderRadius, BorderSide, BottomSheet_default as BottomSheet, Box_default as Box, BoxAlignment, BoxConstraints, BoxDecoration, BoxFit, BoxShadow, BoxShape, Button_default as Button, ButtonStyle, Card_default as Card, Center_default as Center, Checkbox_default as Checkbox, Clip, ClipOval_default as ClipOval, ClipRRect_default as ClipRRect, Column_default as Column, Container_default as Container, CrossAxisAlignment, DecorationImage, Divider_default as Divider, EdgeInsets, Expanded_default as Expanded, Fixed_default as Fixed, FontStyle, FontWeight, GestureDetector_default as GestureDetector, GridView_default as GridView, IgnorePointer_default as IgnorePointer, Image_default as Image, InkWell_default as InkWell, LinearGradient, ListTile_default as ListTile, ListView_default as ListView, MainAxisAlignment, Matrix4, MemoryImage, NetworkImage, Opacity_default as Opacity, OutlineInputBorder, Padding_default as Padding, Positioned_default as Positioned, RadialGradient, Radio_default as Radio, Row_default as Row, SafeArea_default as SafeArea, ScrollView_default as ScrollView, SegmentedControl_default as SegmentedControl, Size, SizedBox_default as SizedBox, Slider_default as Slider, SnackBar, Spacer_default as Spacer, Stack_default as Stack, StackFit, Sticky_default as Sticky, Switch_default as Switch, Text_default as Text, TextAlign, TextArea_default as TextArea, TextBaseline, TextDecoration, TextDecorationStyle, TextDirection, TextField_default as TextField, TextOverflow, TextStyle, TileMode, Transform_default as Transform, UnderlineInputBorder, Wrap_default as Wrap, borderRadiusToStyle, borderSideToStyle, borderToStyle, boxConstraintsToStyle, boxDecorationToStyle, boxShadowToCSS, buttonStyleToStyle, createAssetImage, decorationImageToStyle, edgeInsetsToStyle, isBorderRadius, isBorderSide, isBorders, isBoxConstraints, isBoxDecoration, isBoxShadow, isEdgeInsets, isImageProvider, isTextStyle, marginToStyle, matrix4ToCSSStyle, normalizeSrc, paddingToStyle, px2vw, setAssetBaseURL, setBaseUrl, setDefaultVW, setTransform, sizeToStyle, toCSSStyle as textStyleToCSSStyle, toCSSStyle };
3155
+ export { AlertDialog_default as AlertDialog, Align_default as Align, Alignment, AnimatedContainer_default as AnimatedContainer, AnimatedOpacity_default as AnimatedOpacity, AssetImage, BlurStyle, Border, BorderRadius, BorderSide, BottomSheet_default as BottomSheet, Box_default as Box, BoxAlignment, BoxConstraints, BoxDecoration, BoxFit, BoxShadow, BoxShape, Builder_default as Builder, Button_default as Button, ButtonStyle, Card_default as Card, Center_default as Center, Checkbox_default as Checkbox, Clip, ClipOval_default as ClipOval, ClipRRect_default as ClipRRect, Column_default as Column, Container_default as Container, CrossAxisAlignment, DecorationImage, Divider_default as Divider, EdgeInsets, Expanded_default as Expanded, Fixed_default as Fixed, FontStyle, FontWeight, GestureDetector_default as GestureDetector, GridView_default as GridView, IgnorePointer_default as IgnorePointer, Image_default as Image, InkWell_default as InkWell, LayoutBuilder_default as LayoutBuilder, LinearGradient, ListTile_default as ListTile, ListView_default as ListView, MainAxisAlignment, Matrix4, MediaQuery_default as MediaQuery, MediaQueryKey, MemoryImage, NetworkImage, Opacity_default as Opacity, Orientation, OutlineInputBorder, Padding_default as Padding, Positioned_default as Positioned, RadialGradient, Radio_default as Radio, Row_default as Row, SafeArea_default as SafeArea, ScrollView_default as ScrollView, SegmentedControl_default as SegmentedControl, Size, SizedBox_default as SizedBox, Slider_default as Slider, SnackBar, Spacer_default as Spacer, Stack_default as Stack, StackFit, Sticky_default as Sticky, Switch_default as Switch, Text_default as Text, TextAlign, TextArea_default as TextArea, TextBaseline, TextDecoration, TextDecorationStyle, TextDirection, TextField_default as TextField, TextOverflow, TextStyle, TileMode, Transform_default as Transform, UnderlineInputBorder, Wrap_default as Wrap, borderRadiusToStyle, borderSideToStyle, borderToStyle, boxConstraintsToStyle, boxDecorationToStyle, boxShadowToCSS, buttonStyleToStyle, createAssetImage, decorationImageToStyle, edgeInsetsToStyle, isBorderRadius, isBorderSide, isBorders, isBoxConstraints, isBoxDecoration, isBoxShadow, isEdgeInsets, isImageProvider, isTextStyle, marginToStyle, matrix4ToCSSStyle, normalizeSrc, paddingToStyle, px2vw, setAssetBaseURL, setBaseUrl, setDefaultVW, setTransform, sizeToStyle, toCSSStyle as textStyleToCSSStyle, toCSSStyle, useMediaQuery };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fluekit",
3
- "version": "1.5.6",
3
+ "version": "1.5.7",
4
4
  "description": "A Flutter-style Layout UI kit for Vue",
5
5
  "homepage": "https://fi2zz.github.io/fluekit/",
6
6
  "repository": {
@@ -20,6 +20,10 @@
20
20
  "files": [
21
21
  "dist"
22
22
  ],
23
+ "scripts": {
24
+ "build": "vite build",
25
+ "test": "vitest"
26
+ },
23
27
  "peerDependencies": {
24
28
  "vue": "^3.5.0"
25
29
  },
@@ -33,9 +37,5 @@
33
37
  "vite-plugin-dts": "^4.5.4",
34
38
  "vitest": "^4.0.16",
35
39
  "vue-tsc": "^3.1.4"
36
- },
37
- "scripts": {
38
- "build": "vite build",
39
- "test": "vitest"
40
40
  }
41
- }
41
+ }