fluekit 1.5.6 → 1.5.71

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 { InjectionKey } from 'vue';
2
+ import { EdgeInsets } from './EdgeInsets';
3
+ export declare enum Orientation {
4
+ portrait = "portrait",
5
+ landscape = "landscape"
6
+ }
7
+ export interface MediaQueryData {
8
+ size: {
9
+ width: number;
10
+ height: number;
11
+ };
12
+ devicePixelRatio: number;
13
+ platformBrightness: "light" | "dark";
14
+ orientation: Orientation;
15
+ disableAnimations: boolean;
16
+ highContrast: boolean;
17
+ padding: EdgeInsets;
18
+ viewInsets: EdgeInsets;
19
+ }
20
+ export declare const MediaQueryKey: InjectionKey<MediaQueryData>;
21
+ export declare function useMediaQuery(): MediaQueryData;
@@ -1,5 +1,4 @@
1
1
  import { Props } from './usePosition';
2
- type __VLS_Props = Omit<Props, "zIndex">;
3
2
  declare function __VLS_template(): {
4
3
  attrs: Partial<{}>;
5
4
  slots: {
@@ -9,7 +8,7 @@ declare function __VLS_template(): {
9
8
  rootEl: any;
10
9
  };
11
10
  type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
12
- 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>;
11
+ declare const __VLS_component: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
13
12
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
14
13
  export default _default;
15
14
  type __VLS_WithTemplateSlots<T, S> = T & {
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",
@@ -1572,7 +1582,8 @@ var Positioned_default = /* @__PURE__ */ defineComponent({
1572
1582
  left: {},
1573
1583
  right: {},
1574
1584
  width: {},
1575
- height: {}
1585
+ height: {},
1586
+ zIndex: {}
1576
1587
  },
1577
1588
  setup(e) {
1578
1589
  let C = e, w = useStackContext();
@@ -1591,6 +1602,7 @@ var Positioned_default = /* @__PURE__ */ defineComponent({
1591
1602
  props: {
1592
1603
  direction: {},
1593
1604
  mainAxisAlignment: { default: "start" },
1605
+ mainAxisSize: { default: MainAxisSize.max },
1594
1606
  crossAxisAlignment: { default: "center" },
1595
1607
  wrap: {
1596
1608
  type: Boolean,
@@ -1608,6 +1620,7 @@ var Positioned_default = /* @__PURE__ */ defineComponent({
1608
1620
  return (C, w) => (openBlock(), createBlock(FlexBox_default, {
1609
1621
  direction: "row",
1610
1622
  "main-axis-alignment": e.mainAxisAlignment,
1623
+ "main-axis-size": e.mainAxisSize,
1611
1624
  "cross-axis-alignment": e.crossAxisAlignment,
1612
1625
  wrap: e.wrap,
1613
1626
  gap: e.gap,
@@ -1618,6 +1631,7 @@ var Positioned_default = /* @__PURE__ */ defineComponent({
1618
1631
  _: 3
1619
1632
  }, 8, [
1620
1633
  "main-axis-alignment",
1634
+ "main-axis-size",
1621
1635
  "cross-axis-alignment",
1622
1636
  "wrap",
1623
1637
  "gap",
@@ -2873,36 +2887,66 @@ var Transform_default = /* @__PURE__ */ __plugin_vue_export_helper_default(/* @_
2873
2887
  items: {},
2874
2888
  selectedColor: { default: "#007AFF" },
2875
2889
  unselectedColor: { default: "transparent" },
2890
+ disabledColor: { default: "#F5F5F5" },
2876
2891
  borderColor: { default: "#007AFF" },
2877
2892
  padding: { default: () => EdgeInsets.symmetric({
2878
2893
  vertical: 8,
2879
2894
  horizontal: 16
2880
2895
  }) },
2881
- decoration: {}
2896
+ decoration: {},
2897
+ selectedTextStyle: {},
2898
+ unselectedTextStyle: {},
2899
+ disabledTextStyle: {},
2900
+ borderRadius: { default: () => BorderRadius.circular(4) }
2882
2901
  },
2883
2902
  emits: ["update:modelValue", "change"],
2884
2903
  setup(e, { emit: w }) {
2885
2904
  let T = e, O = w, A = (e) => {
2886
- e !== T.modelValue && (O("update:modelValue", e), O("change", e));
2905
+ e.disabled || e.value !== T.modelValue && (O("update:modelValue", e.value), O("change", e.value));
2887
2906
  }, j = computed(() => T.decoration ? T.decoration : BoxDecoration({
2888
2907
  border: Border.all({
2889
2908
  color: T.borderColor,
2890
2909
  width: 1
2891
2910
  }),
2892
- borderRadius: BorderRadius.circular(4)
2911
+ borderRadius: T.borderRadius
2893
2912
  })), 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,
2913
+ let w = e.value === T.modelValue, E = C === T.items.length - 1, D = C === 0, O = BorderRadius.zero;
2914
+ D ? O = BorderRadius.only({
2915
+ topLeft: T.borderRadius.topLeft,
2916
+ bottomLeft: T.borderRadius.bottomLeft
2917
+ }) : E && (O = BorderRadius.only({
2918
+ topRight: T.borderRadius.topRight,
2919
+ bottomRight: T.borderRadius.bottomRight
2920
+ }));
2921
+ let k = w ? T.selectedColor : T.unselectedColor;
2922
+ return e.disabled && (k = T.disabledColor), BoxDecoration({
2923
+ color: k,
2924
+ borderRadius: O,
2925
+ border: Border.only({ right: BorderSide({
2926
+ color: E ? "transparent" : T.borderColor,
2899
2927
  width: 1
2900
2928
  }) })
2901
2929
  });
2902
- }, F = (e) => TextStyle({
2903
- color: e === T.modelValue ? "#FFFFFF" : T.borderColor,
2904
- fontSize: 13
2905
- });
2930
+ }, F = (e) => {
2931
+ let C = e.value === T.modelValue, w = e.disabled, E = TextStyle({
2932
+ color: C ? "#FFFFFF" : T.borderColor,
2933
+ fontSize: 13
2934
+ });
2935
+ return w ? T.disabledTextStyle ? {
2936
+ ...E,
2937
+ ...T.disabledTextStyle,
2938
+ color: "#999999"
2939
+ } : {
2940
+ ...E,
2941
+ color: "#999999"
2942
+ } : C && T.selectedTextStyle ? {
2943
+ ...E,
2944
+ ...T.selectedTextStyle
2945
+ } : !C && T.unselectedTextStyle ? {
2946
+ ...E,
2947
+ ...T.unselectedTextStyle
2948
+ } : E;
2949
+ };
2906
2950
  return (w, T) => (openBlock(), createBlock(Container_default, {
2907
2951
  decoration: j.value,
2908
2952
  "clip-behavior": "hardEdge"
@@ -2910,18 +2954,18 @@ var Transform_default = /* @__PURE__ */ __plugin_vue_export_helper_default(/* @_
2910
2954
  default: withCtx(() => [createVNode(Row_default, null, {
2911
2955
  default: withCtx(() => [(openBlock(!0), createElementBlock(Fragment, null, renderList(e.items, (C, T) => (openBlock(), createBlock(GestureDetector_default, {
2912
2956
  key: T,
2913
- onTap: (e) => A(C.value)
2957
+ onTap: (e) => A(C)
2914
2958
  }, {
2915
2959
  default: withCtx(() => [createVNode(Container_default, {
2916
2960
  padding: e.padding,
2917
- decoration: P(C.value, T),
2961
+ decoration: P(C, T),
2918
2962
  alignment: "center"
2919
2963
  }, {
2920
2964
  default: withCtx(() => [renderSlot(w.$slots, "label", {
2921
2965
  item: C,
2922
2966
  selected: C.value === e.modelValue,
2923
2967
  index: T
2924
- }, () => [createVNode(Text_default, { style: normalizeStyle(F(C.value)) }, {
2968
+ }, () => [createVNode(Text_default, { style: normalizeStyle(F(C)) }, {
2925
2969
  default: withCtx(() => [createTextVNode(toDisplayString(C.label), 1)]),
2926
2970
  _: 2
2927
2971
  }, 1032, ["style"])])]),
@@ -2934,6 +2978,88 @@ var Transform_default = /* @__PURE__ */ __plugin_vue_export_helper_default(/* @_
2934
2978
  _: 3
2935
2979
  }, 8, ["decoration"]));
2936
2980
  }
2981
+ }), Builder_default = defineComponent({
2982
+ name: "Builder",
2983
+ props: { builder: {
2984
+ type: Function,
2985
+ required: !0
2986
+ } },
2987
+ setup(e) {
2988
+ return e.builder();
2989
+ }
2990
+ }), LayoutBuilder_default = /* @__PURE__ */ defineComponent({
2991
+ __name: "LayoutBuilder",
2992
+ setup(e) {
2993
+ let C = ref(null), w = shallowRef(null), T = null, E = {
2994
+ width: "100%",
2995
+ height: "100%",
2996
+ display: "block"
2997
+ };
2998
+ return onMounted(() => {
2999
+ C.value && (T = new ResizeObserver((e) => {
3000
+ for (let C of e) {
3001
+ let e = C.contentRect.width, T = C.contentRect.height;
3002
+ w.value = BoxConstraints.tight({
3003
+ width: e,
3004
+ height: T
3005
+ });
3006
+ }
3007
+ }), T.observe(C.value));
3008
+ }), onUnmounted(() => {
3009
+ T?.disconnect();
3010
+ }), (e, T) => (openBlock(), createElementBlock("div", {
3011
+ ref_key: "el",
3012
+ ref: C,
3013
+ class: "fluekit-layout-builder",
3014
+ style: E
3015
+ }, [w.value ? renderSlot(e.$slots, "default", {
3016
+ key: 0,
3017
+ constraints: w.value
3018
+ }) : createCommentVNode("", !0)], 512));
3019
+ }
3020
+ });
3021
+ let Orientation = /* @__PURE__ */ function(e) {
3022
+ return e.portrait = "portrait", e.landscape = "landscape", e;
3023
+ }({});
3024
+ const MediaQueryKey = Symbol("MediaQuery");
3025
+ var globalState = reactive({
3026
+ size: {
3027
+ width: 0,
3028
+ height: 0
3029
+ },
3030
+ devicePixelRatio: 1,
3031
+ platformBrightness: "light",
3032
+ orientation: Orientation.portrait,
3033
+ disableAnimations: !1,
3034
+ highContrast: !1,
3035
+ padding: EdgeInsets.zero,
3036
+ viewInsets: EdgeInsets.zero
3037
+ }), listenersAttached = !1, updateGlobalState = () => {
3038
+ if (typeof window > "u") return;
3039
+ let e = window.innerWidth, C = window.innerHeight;
3040
+ globalState.size = {
3041
+ width: e,
3042
+ height: C
3043
+ }, 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;
3044
+ }, attachListeners = () => {
3045
+ typeof window > "u" || listenersAttached || (window.addEventListener("resize", updateGlobalState), [
3046
+ "(prefers-color-scheme: dark)",
3047
+ "(prefers-reduced-motion: reduce)",
3048
+ "(prefers-contrast: more)"
3049
+ ].forEach((e) => {
3050
+ let C = window.matchMedia?.(e);
3051
+ C?.addEventListener ? C.addEventListener("change", updateGlobalState) : C?.addListener && C.addListener(updateGlobalState);
3052
+ }), updateGlobalState(), listenersAttached = !0);
3053
+ };
3054
+ function useMediaQuery() {
3055
+ return attachListeners(), inject(MediaQueryKey, globalState);
3056
+ }
3057
+ var MediaQuery_default = /* @__PURE__ */ defineComponent({
3058
+ __name: "MediaQuery",
3059
+ props: { data: {} },
3060
+ setup(e) {
3061
+ return provide(MediaQueryKey, e.data), (e, C) => renderSlot(e.$slots, "default");
3062
+ }
2937
3063
  }), _hoisted_1 = { class: "snackbar-overlay" }, SnackBarComponent_default = /* @__PURE__ */ __plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
2938
3064
  __name: "SnackBarComponent",
2939
3065
  props: {
@@ -3027,4 +3153,4 @@ var Transform_default = /* @__PURE__ */ __plugin_vue_export_helper_default(/* @_
3027
3153
  }
3028
3154
  };
3029
3155
  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 };
3156
+ 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 };
@@ -15,5 +15,4 @@ export interface Props {
15
15
  /** z-index 层级 */
16
16
  zIndex?: number;
17
17
  }
18
- export declare function positionToStyle(props: Props, position?: "absolute" | "fixed" | "sticky" | "relative"): CSSProperties;
19
18
  export declare function usePositionStyle(props: Props, position?: "absolute" | "fixed" | "sticky" | "relative"): import('vue').ComputedRef<CSSProperties>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fluekit",
3
- "version": "1.5.6",
3
+ "version": "1.5.71",
4
4
  "description": "A Flutter-style Layout UI kit for Vue",
5
5
  "homepage": "https://fi2zz.github.io/fluekit/",
6
6
  "repository": {