@plexui/vue 0.31.0 → 0.33.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.
- package/dist/es/components/DatePicker/Calendar.js +16 -2
- package/dist/es/components/DatePicker/Calendar.js.map +1 -1
- package/dist/es/components/DateRangePicker/Calendar.js +16 -2
- package/dist/es/components/DateRangePicker/Calendar.js.map +1 -1
- package/dist/es/components/Dialog/Dialog.js +7 -2
- package/dist/es/components/Dialog/Dialog.js.map +1 -1
- package/dist/es/components/Field/Field.js +40 -1
- package/dist/es/components/Field/Field.js.map +1 -1
- package/dist/es/components/SwipeActions/SwipeActions.js +222 -20
- package/dist/es/components/SwipeActions/SwipeActions.js.map +1 -1
- package/dist/es/components/SwipeActions/index.js +1 -1
- package/dist/es/components/SwipeActions/index.js.map +1 -1
- package/dist/es/lib/calendarFit.js +80 -0
- package/dist/es/lib/calendarFit.js.map +1 -0
- package/dist/types/components/SwipeActions/SwipeActions.d.ts +8 -0
- package/dist/types/components/SwipeActions/index.d.ts +1 -1
- package/dist/types/lib/calendarFit.d.ts +9 -0
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SwipeActions.js","sourceRoot":"","sources":["../../../../src/components/SwipeActions/SwipeActions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,CAAC,EAAE,eAAe,EAAE,SAAS,EAAE,SAAS,EAAE,GAAG,EAAE,KAAK,EAAiC,MAAM,KAAK,CAAA;AACpI,OAAO,CAAC,MAAM,gEAAgE,CAAA;AA8B9E,gGAAgG;AAChG,MAAM,IAAI,GAAG,EAAE,CAAA;AAEf,uGAAuG;AACvG,MAAM,UAAU,GAA0B,EAAE,GAAG,EAAE,YAAY,EAAE,CAAA;AAE/D,uDAAuD;AACvD,MAAM,QAAQ,GAAG,4FAA4F,CAAA;AAgB7G,iFAAiF;AACjF,IAAI,YAAY,GAAwB,IAAI,CAAA;AA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AAK,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS;YAC1C,eAAe,EAAE,QAAQ,CAAC,KAAK;YAC/B,cAAc,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS;YAC9C,WAAW,EAAE,aAAa;YAC1B,YAAY,EAAE,cAAc;SAC7B,EAAE;YACD,UAAU,CAAC,SAAS,EAAE,KAAK,CAAC,OAAO,CAAC;YACpC,CAAC,CAAC,KAAK,EAAE;gBACP,OAAO,EAAE,CAAC,CAAC,OAAO;gBAClB,oBAAoB,EAAE,EAAE;gBACxB,OAAO,EAAE,MAAM,CAAC,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,wBAAwB,EAAE,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,CAAC,SAAS;gBACvH,eAAe,EAAE,iBAAiB;gBAClC,eAAe,EAAE,iBAAiB;gBAClC,sBAAsB,EAAE,wBAAwB;gBAChD,gBAAgB,EAAE,kBAAkB;aACrC,EAAE,KAAK,CAAC,OAAO,EAAE,EAAE,CAAC;YACrB,UAAU,CAAC,UAAU,EAAE,KAAK,CAAC,QAAQ,CAAC;SACvC,CAAC,CAAA;IACJ,CAAC;CACF,CAAC,CAAA;AAOF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,qBAAqB,CAAA","sourcesContent":["import { computed, defineComponent, h, onBeforeUnmount, onMounted, onUpdated, ref, watch, type Component, type PropType } from \"vue\"\nimport s from \"@plexui/styles/components/SwipeActions/SwipeActions.module.css\"\n\n// Vue port of packages/ui/src/components/SwipeActions/SwipeActions.tsx: the same row, sides, gesture, full swipe,\n// keys and focus. The content of the row is the default slot; an action's `Icon` is a component, as in Select.\n\nexport type SwipeActionColor =\n | \"primary\"\n | \"secondary\"\n | \"danger\"\n | \"success\"\n | \"info\"\n | \"discovery\"\n | \"caution\"\n | \"warning\"\n\nexport type SwipeAction = {\n /** Unique ID of the action within its side */\n id: string\n /** Name of the action: shown with `labelPlacement` `\"inside\"` or `\"below\"` (and on an action without an icon), and its accessible name always */\n label: string\n /** Icon of the action */\n Icon?: Component\n /** Solid color of the action. @default \"secondary\" */\n color?: SwipeActionColor\n /** Called when the action is pressed, or by a full swipe when it is the first action of its side */\n onSelect?: () => void\n}\n\nexport type SwipeActionsSide = \"leading\" | \"trailing\"\n\n/** A finger has to travel this far, and farther across than down, before the row follows it. */\nconst SLOP = 10\n\n/** The width an open row moves by is the border box of its actions, edge and content gaps included. */\nconst BORDER_BOX: ResizeObserverOptions = { box: \"border-box\" }\n\n/** Controls that take a horizontal drag themselves. */\nconst OWN_DRAG = 'input, textarea, select, [contenteditable]:not([contenteditable=\"false\"]), [role=\"slider\"]'\n\ntype Gesture = {\n pointerId: number\n x: number\n y: number\n start: number\n /** Undecided while within the slop, then a swipe (true) or a scroll (false). */\n swiping: boolean | undefined\n rtl: boolean\n widths: Record<SwipeActionsSide, number>\n rowWidth: number\n /** Removes the listeners for the end of the gesture. */\n detach: () => void\n}\n\n/** The open row: opening another one closes it, as a list keeps one row open. */\nlet closeOpenRow: (() => void) | null = null\n\n/** The row keeps the finger past its edges; a pointer that is no longer active (it lifted between events) cannot be held. */\nconst capture = (element: Element, pointerId: number) => {\n try {\n element.setPointerCapture?.(pointerId)\n } catch {\n // The swipe goes on with the events the row still gets.\n }\n}\n\nconst sideOf = (offset: number): SwipeActionsSide | undefined =>\n offset > 0 ? \"leading\" : offset < 0 ? \"trailing\" : undefined\n\n/**\n * Where the content goes for a swipe of `raw` px toward the trailing edge (negative: toward the leading edge), and\n * whether that is a full swipe. A side without actions stays shut. Past its actions the content follows the finger\n * where a full swipe is allowed, and a third as fast where it is not; past the middle between the open actions and\n * the far edge of the row the swipe is full.\n */\nexport const swipeActionsOffset = (\n raw: number,\n widths: Record<SwipeActionsSide, number>,\n rowWidth: number,\n fullSwipe: boolean,\n): { offset: number; full: boolean } => {\n const side = sideOf(raw)\n const width = side ? widths[side] : 0\n if (!side || !(width > 0)) return { offset: 0, full: false }\n const sign = Math.sign(raw)\n const distance = Math.abs(raw)\n if (distance <= width) return { offset: raw, full: false }\n if (!fullSwipe) return { offset: sign * (width + (distance - width) / 3), full: false }\n const travel = Math.min(distance, Math.max(width, rowWidth))\n return { offset: sign * travel, full: travel >= (width + rowWidth) / 2 }\n}\n\nconst SwipeActionsComponent = defineComponent({\n name: \"SwipeActions\",\n inheritAttrs: false,\n props: {\n /** Actions revealed by a swipe toward the trailing edge, the first one at the leading edge */\n leading: { type: Array as PropType<SwipeAction[]>, default: () => [] },\n /** Actions revealed by a swipe toward the leading edge, the first one at the trailing edge */\n trailing: { type: Array as PropType<SwipeAction[]>, default: () => [] },\n /** Where the actions show their labels: `\"hidden\"` (symbols only), `\"inside\"` the capsule, or `\"below\"` it (for rows of 60px and taller, as iOS sets them). @default \"hidden\" */\n labelPlacement: { type: String as PropType<\"hidden\" | \"inside\" | \"below\">, default: \"hidden\" },\n /** A swipe past the middle between the open actions and the far edge runs the first action of that side. @default true */\n fullSwipe: { type: Boolean, default: true },\n },\n setup(props, { attrs, slots }) {\n const offset = ref(0)\n const full = ref(false)\n const swiping = ref(false)\n const rtl = ref(false)\n const round = ref(false)\n const root = ref<HTMLElement | null>(null)\n const sides: Record<SwipeActionsSide, HTMLElement | null> = { leading: null, trailing: null }\n let gesture: Gesture | null = null\n let suppressClick = false\n let observer: ResizeObserver | null = null\n const revealed = computed(() => sideOf(offset.value))\n\n const widthOf = (side: SwipeActionsSide) => sides[side]?.getBoundingClientRect().width ?? 0\n\n const isRtl = () => !!root.value && getComputedStyle(root.value).direction === \"rtl\"\n\n const move = (next: number, nextFull = false) => {\n offset.value = next\n full.value = nextFull\n }\n\n /** Lets go of the gesture: the listeners for its end go, and the row no longer follows the finger. */\n const release = () => {\n const state = gesture\n gesture = null\n state?.detach()\n return state\n }\n\n const close = () => {\n if (closeOpenRow === closer) closeOpenRow = null\n move(0)\n }\n\n /** One function for the life of the row, so the list knows which row is open; another row that opens ends this one's gesture too. */\n const closer = () => {\n const state = release()\n if (state) {\n swiping.value = false\n // The finger of the ended swipe still lifts over this row: its click is not a click on the content.\n if (state.swiping) suppressClick = true\n }\n close()\n }\n\n /** This row takes the place of the open one. */\n const claim = () => {\n if (closeOpenRow && closeOpenRow !== closer) closeOpenRow()\n closeOpenRow = closer\n }\n\n /** Shows a side as wide as its actions (`width` when known), or closes the row when that side has none (any more). */\n const open = (side: SwipeActionsSide, width = widthOf(side)) => {\n if (!(width > 0)) return close()\n claim()\n rtl.value = isRtl()\n move(side === \"leading\" ? width : -width)\n }\n\n /** An open row follows its actions: more of them, other labels or another width move it to their new width. */\n const sync = () => {\n const side = sideOf(offset.value)\n if (!side || gesture?.swiping || full.value) return\n const width = widthOf(side)\n if (!(width > 0)) return close()\n const target = side === \"leading\" ? width : -width\n if (target !== offset.value) move(target)\n }\n\n /**\n * A symbol that has grown as tall as its circle (its max-height) is one, as iOS draws a circle from there. The\n * measure is a capsule that is laid out: a full swipe hides all but the first action of its side, and while none\n * is laid out the shape stays.\n */\n const fit = () => {\n const capsules = [...(root.value?.querySelectorAll<HTMLElement>('[data-shape=\"symbol\"] > :first-child') ?? [])]\n if (capsules.length < 1) {\n round.value = false\n return\n }\n const capsule = capsules.find((element) => element.getBoundingClientRect().height > 0)\n if (!capsule) return\n const max = parseFloat(getComputedStyle(capsule).maxHeight)\n round.value = max > 0 && capsule.getBoundingClientRect().height >= max - 0.5\n }\n\n // After each render, and whenever the actions change size, an open row takes their width and a symbol its shape.\n const observeSides = () => {\n for (const element of [sides.leading, sides.trailing]) if (element) observer?.observe(element, BORDER_BOX)\n }\n onMounted(() => {\n if (typeof ResizeObserver !== \"undefined\") observer = new ResizeObserver(() => {\n fit()\n sync()\n })\n fit()\n observeSides()\n })\n onUpdated(() => {\n fit()\n sync()\n observeSides()\n })\n\n // A press anywhere outside the open row closes it.\n const handleOutsidePointerDown = (event: PointerEvent) => {\n if (event.target instanceof Node && root.value?.contains(event.target)) return\n close()\n }\n watch([revealed, swiping], ([side, moving]) => {\n document.removeEventListener(\"pointerdown\", handleOutsidePointerDown, true)\n if (side && !moving) document.addEventListener(\"pointerdown\", handleOutsidePointerDown, true)\n })\n\n // The open row lets go of the list, and of the finger, when it goes away.\n onBeforeUnmount(() => {\n document.removeEventListener(\"pointerdown\", handleOutsidePointerDown, true)\n observer?.disconnect()\n observer = null\n release()\n if (closeOpenRow === closer) closeOpenRow = null\n })\n\n const settle = (state: Gesture) => {\n const side = sideOf(offset.value)\n if (!side) return close()\n if (full.value) {\n (side === \"leading\" ? props.leading : props.trailing)[0]?.onSelect?.()\n return close()\n }\n // The widths from the start of the swipe: a full swipe may have stretched the actions since.\n if (Math.abs(offset.value) >= state.widths[side] / 2) open(side, state.widths[side])\n else close()\n }\n\n /** The finger lifted (anywhere): a swipe settles, a press on an open row closes it. */\n const finish = () => {\n const state = release()\n if (!state) return\n if (state.swiping) {\n suppressClick = true\n swiping.value = false\n settle(state)\n } else if (state.start !== 0) {\n if (state.swiping === undefined) suppressClick = true\n close()\n }\n }\n\n /** The browser took the gesture (a scroll) or the row lost the finger: the row goes back to where it was. */\n const cancel = () => {\n const state = release()\n if (!state) return\n swiping.value = false\n const side = sideOf(state.start)\n if (state.swiping && side) open(side, state.widths[side])\n else close()\n }\n\n const handlePointerDown = (event: PointerEvent) => {\n if (event.button !== 0 || gesture) return\n // A new press of the primary pointer starts clean: a swipe that another row ended and that was then cancelled leaves\n // no click to swallow. Another finger's press keeps it, as only the primary pointer clicks.\n if (event.isPrimary) suppressClick = false\n if (props.leading.length < 1 && props.trailing.length < 1) return\n // A drag in a text field or along a slider belongs to that control.\n if (event.target instanceof Element && event.target.closest(OWN_DRAG)) return\n const pointerId = event.pointerId\n // The end of the gesture is heard wherever the finger lifts, inside the row or not.\n const handleUp = (end: PointerEvent) => {\n if (end.pointerId === pointerId) finish()\n }\n const handleCancel = (end: PointerEvent) => {\n if (end.pointerId === pointerId) cancel()\n }\n window.addEventListener(\"pointerup\", handleUp, true)\n window.addEventListener(\"pointercancel\", handleCancel, true)\n gesture = {\n pointerId,\n x: event.clientX,\n y: event.clientY,\n start: offset.value,\n swiping: undefined,\n rtl: isRtl(),\n widths: { leading: widthOf(\"leading\"), trailing: widthOf(\"trailing\") },\n rowWidth: root.value?.clientWidth ?? 0,\n detach: () => {\n window.removeEventListener(\"pointerup\", handleUp, true)\n window.removeEventListener(\"pointercancel\", handleCancel, true)\n },\n }\n }\n\n const handlePointerMove = (event: PointerEvent) => {\n const state = gesture\n if (!state || state.pointerId !== event.pointerId || state.swiping === false) return\n const across = (event.clientX - state.x) * (state.rtl ? -1 : 1)\n const down = event.clientY - state.y\n if (state.swiping === undefined) {\n if (Math.abs(across) < SLOP && Math.abs(down) < SLOP) return\n if (Math.abs(across) <= Math.abs(down)) {\n state.swiping = false\n return\n }\n state.swiping = true\n const target = event.currentTarget\n if (target instanceof Element) capture(target, event.pointerId)\n window.getSelection?.()?.removeAllRanges()\n claim()\n rtl.value = state.rtl\n swiping.value = true\n }\n const next = swipeActionsOffset(state.start + across, state.widths, state.rowWidth, props.fullSwipe)\n move(next.offset, next.full)\n }\n\n /** The content lost the finger it held. A child that loses the finger to the content (as a touch moves its implicit capture) ends nothing. */\n const handleLostPointerCapture = (event: PointerEvent) => {\n if (event.target === event.currentTarget && gesture?.pointerId === event.pointerId) cancel()\n }\n\n /** A swipe or a press that closed the row is not a click on the content; a click from the keys still is. */\n const handleClickCapture = (event: MouseEvent) => {\n if (!suppressClick || event.detail === 0) return\n suppressClick = false\n event.preventDefault()\n event.stopPropagation()\n }\n\n /** The focus on an action shows its side; on the content it closes the row. */\n const handleFocusIn = (event: FocusEvent) => {\n if (gesture?.swiping) return\n const target = event.target\n const side = ([\"leading\", \"trailing\"] as const).find((name) => target instanceof Node && !!sides[name]?.contains(target))\n if (side) {\n if (sideOf(offset.value) !== side) open(side)\n } else if (offset.value !== 0) {\n close()\n }\n }\n\n const handleFocusOut = (event: FocusEvent) => {\n if (gesture?.swiping) return\n if (event.relatedTarget instanceof Node && root.value?.contains(event.relatedTarget)) return\n if (offset.value !== 0) close()\n }\n\n const select = (action: SwipeAction, event: MouseEvent) => {\n action.onSelect?.()\n // A press closes the row, as iOS does. From the keys the action keeps the focus, so its side stays open until\n // the focus leaves the row.\n if (event.detail === 0) return\n const target = event.currentTarget\n if (target instanceof HTMLElement) target.blur()\n close()\n }\n\n const renderSide = (side: SwipeActionsSide, actions: SwipeAction[]) => {\n if (actions.length < 1) return null\n const shown = side === \"leading\" ? actions : [...actions].reverse()\n const isFull = full.value && revealed.value === side\n return h(\"div\", {\n \"ref\": (element: unknown) => {\n sides[side] = element instanceof HTMLElement ? element : null\n },\n \"class\": s.Actions,\n \"data-side\": side,\n \"data-full\": isFull ? \"\" : undefined,\n \"style\": isFull ? { width: `${Math.abs(offset.value)}px` } : undefined,\n }, shown.map((action) => {\n const color = action.color ?? \"secondary\"\n // A label alone (text), a symbol with its label inside (label), or a symbol with its label hidden or below.\n const shape = !action.Icon ? \"text\" : props.labelPlacement === \"inside\" ? \"label\" : \"symbol\"\n const labelInside = shape !== \"symbol\"\n const labelBelow = shape === \"symbol\" && props.labelPlacement === \"below\"\n return h(\"button\", {\n \"key\": action.id,\n \"type\": \"button\",\n \"class\": s.Action,\n \"data-color\": color,\n \"data-shape\": shape,\n \"data-first\": action === actions[0] ? \"\" : undefined,\n \"aria-label\": labelInside || labelBelow ? undefined : action.label,\n \"onClick\": (event: MouseEvent) => select(action, event),\n }, [\n h(\"span\", { class: s.Capsule }, [\n action.Icon ? h(action.Icon, { \"class\": s.Icon, \"aria-hidden\": \"true\" }) : null,\n labelInside ? h(\"span\", { class: s.Label }, action.label) : null,\n ]),\n labelBelow ? h(\"span\", { class: s.Caption }, action.label) : null,\n ])\n }))\n }\n\n return () => h(\"div\", {\n ...attrs,\n \"ref\": root,\n \"class\": [s.SwipeActions, attrs.class],\n \"data-row\": \"\",\n \"data-swipe-actions\": \"\",\n \"data-label-placement\": props.labelPlacement,\n \"data-round\": round.value ? \"\" : undefined,\n \"data-revealed\": revealed.value,\n \"data-swiping\": swiping.value ? \"\" : undefined,\n \"onFocusin\": handleFocusIn,\n \"onFocusout\": handleFocusOut,\n }, [\n renderSide(\"leading\", props.leading),\n h(\"div\", {\n \"class\": s.Content,\n \"data-swipe-content\": \"\",\n \"style\": offset.value !== 0 ? { \"--swipe-actions-offset\": `${rtl.value ? -offset.value : offset.value}px` } : undefined,\n \"onPointerdown\": handlePointerDown,\n \"onPointermove\": handlePointerMove,\n \"onLostpointercapture\": handleLostPointerCapture,\n \"onClickCapture\": handleClickCapture,\n }, slots.default?.()),\n renderSide(\"trailing\", props.trailing),\n ])\n },\n})\n\ntype SwipeActionsOwnProps = InstanceType<typeof SwipeActionsComponent>[\"$props\"]\n\n/** SwipeActions props. */\nexport type SwipeActionsProps = SwipeActionsOwnProps\n\n/**\n * Actions behind a row of a list, as the swipe actions of an iOS list: a swipe toward the leading edge reveals the\n * trailing actions, a swipe toward the trailing edge the leading ones, and a full swipe runs the first action of\n * that side. The row is a `data-row` of a FieldGroup. Each action is also a button in the order of the screen, and\n * the focus on one shows its side.\n */\nexport const SwipeActions = SwipeActionsComponent\n"]}
|
|
1
|
+
{"version":3,"file":"SwipeActions.js","sourceRoot":"","sources":["../../../../src/components/SwipeActions/SwipeActions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,CAAC,EAAE,eAAe,EAAE,SAAS,EAAE,SAAS,EAAE,GAAG,EAAE,KAAK,EAAiC,MAAM,KAAK,CAAA;AACpI,OAAO,CAAC,MAAM,gEAAgE,CAAA;AAgC9E,gGAAgG;AAChG,MAAM,IAAI,GAAG,EAAE,CAAA;AAEf,uGAAuG;AACvG,MAAM,UAAU,GAA0B,EAAE,GAAG,EAAE,YAAY,EAAE,C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,CAAC;YACrB,UAAU,CAAC,UAAU,EAAE,KAAK,CAAC,QAAQ,CAAC;SACvC,CAAC,CAAA;IACJ,CAAC;CACF,CAAC,CAAA;AAOF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,qBAAqB,CAAA","sourcesContent":["import { computed, defineComponent, h, onBeforeUnmount, onMounted, onUpdated, ref, watch, type Component, type PropType } from \"vue\"\nimport s from \"@plexui/styles/components/SwipeActions/SwipeActions.module.css\"\n\n// Vue port of packages/ui/src/components/SwipeActions/SwipeActions.tsx: the same row, sides, gesture, full swipe,\n// keys and focus. The content of the row is the default slot; an action's `Icon` is a component, as in Select.\n\nexport type SwipeActionColor =\n | \"primary\"\n | \"secondary\"\n | \"danger\"\n | \"success\"\n | \"info\"\n | \"discovery\"\n | \"caution\"\n | \"warning\"\n\nexport type SwipeAction = {\n /** Unique ID of the action within its side */\n id: string\n /** Name of the action: shown with `labelPlacement` `\"inside\"` or `\"below\"` (and on an action without an icon), and its accessible name always */\n label: string\n /** Icon of the action */\n Icon?: Component\n /** Solid color of the action. @default \"secondary\" */\n color?: SwipeActionColor\n /** Called when the action is pressed, or by a full swipe when it is the first action of its side */\n onSelect?: () => void\n /** `\"destructive\"`: the action removes the row, so the row slides out and its height collapses, as iOS deletes a row, and `onSelect` comes at the end of that for the list to drop it. A row the list keeps comes back. */\n role?: \"destructive\"\n}\n\nexport type SwipeActionsSide = \"leading\" | \"trailing\"\n\n/** A finger has to travel this far, and farther across than down, before the row follows it. */\nconst SLOP = 10\n\n/** The width an open row moves by is the border box of its actions, edge and content gaps included. */\nconst BORDER_BOX: ResizeObserverOptions = { box: \"border-box\" }\n\n/** A finger lifting faster than this (px/ms) opens the side it moves toward, or closes the row when it moves back, however short the swipe. */\nconst FLICK = 0.3\n\n/** A finger that stopped this long (ms) before it lifted flicks nothing. */\nconst FLICK_WINDOW = 100\n\n/** A trackpad swipe (horizontal wheel) ends when no wheel event has come for this long (ms). */\nconst WHEEL_IDLE = 120\n\n/** Controls that take a horizontal drag themselves. */\nconst OWN_DRAG = 'input, textarea, select, [contenteditable]:not([contenteditable=\"false\"]), [role=\"slider\"]'\n\n/** Whether a wheel over `target` belongs to a control or a box inside the row that scrolls across itself. */\nconst scrollsAcross = (target: EventTarget | null, row: Element | null): boolean => {\n for (let element = target instanceof Element ? target : null; element && element !== row; element = element.parentElement) {\n if (element.matches(OWN_DRAG)) return true\n const overflow = getComputedStyle(element).overflowX\n if ((overflow === \"auto\" || overflow === \"scroll\") && element.scrollWidth > element.clientWidth) return true\n }\n return false\n}\n\ntype Gesture = {\n pointerId: number\n x: number\n y: number\n start: number\n /** Undecided while within the slop, then a swipe (true) or a scroll (false). */\n swiping: boolean | undefined\n rtl: boolean\n widths: Record<SwipeActionsSide, number>\n rowWidth: number\n /** Where the finger last was across (px) and when (ms), and how fast it moved there (px/ms). */\n across: number\n time: number\n velocity: number\n /** Removes the listeners for the end of the gesture. */\n detach: () => void\n}\n\n/** The open row: opening another one closes it, as a list keeps one row open. */\nlet closeOpenRow: (() => void) | null = null\n\n/** The row keeps the finger past its edges; a pointer that is no longer active (it lifted between events) cannot be held. */\nconst capture = (element: Element, pointerId: number) => {\n try {\n element.setPointerCapture?.(pointerId)\n } catch {\n // The swipe goes on with the events the row still gets.\n }\n}\n\nconst sideOf = (offset: number): SwipeActionsSide | undefined =>\n offset > 0 ? \"leading\" : offset < 0 ? \"trailing\" : undefined\n\n/**\n * Where a swipe that ended at `offset` settles: a flick (`velocity` px/ms, toward the trailing edge when positive)\n * opens the side it moves toward and closes the row when it moves back; a slow one opens a side moved past half its\n * `width`.\n */\nexport const swipeActionsSettle = (offset: number, velocity: number, width: number): boolean => {\n if (Math.abs(velocity) >= FLICK) return Math.sign(velocity) === Math.sign(offset)\n return Math.abs(offset) >= width / 2\n}\n\n/** The duration (ms) the row moves in, none when the motion is reduced. */\nconst durationOf = (element: Element) => {\n if (typeof matchMedia === \"function\" && matchMedia(\"(prefers-reduced-motion: reduce)\").matches) return 0\n const value = getComputedStyle(element).getPropertyValue(\"--swipe-actions-duration\").trim()\n const time = parseFloat(value)\n if (!Number.isFinite(time)) return 0\n return value.endsWith(\"ms\") ? time : time * 1000\n}\n\n/**\n * Where the content goes for a swipe of `raw` px toward the trailing edge (negative: toward the leading edge), and\n * whether that is a full swipe. A side without actions stays shut. Past its actions the content follows the finger\n * where a full swipe is allowed, and a third as fast where it is not; past the middle between the open actions and\n * the far edge of the row the swipe is full.\n */\nexport const swipeActionsOffset = (\n raw: number,\n widths: Record<SwipeActionsSide, number>,\n rowWidth: number,\n fullSwipe: boolean,\n): { offset: number; full: boolean } => {\n const side = sideOf(raw)\n const width = side ? widths[side] : 0\n if (!side || !(width > 0)) return { offset: 0, full: false }\n const sign = Math.sign(raw)\n const distance = Math.abs(raw)\n if (distance <= width) return { offset: raw, full: false }\n if (!fullSwipe) return { offset: sign * (width + (distance - width) / 3), full: false }\n const travel = Math.min(distance, Math.max(width, rowWidth))\n return { offset: sign * travel, full: travel >= (width + rowWidth) / 2 }\n}\n\nconst SwipeActionsComponent = defineComponent({\n name: \"SwipeActions\",\n inheritAttrs: false,\n props: {\n /** Actions revealed by a swipe toward the trailing edge, the first one at the leading edge */\n leading: { type: Array as PropType<SwipeAction[]>, default: () => [] },\n /** Actions revealed by a swipe toward the leading edge, the first one at the trailing edge */\n trailing: { type: Array as PropType<SwipeAction[]>, default: () => [] },\n /** Where the actions show their labels: `\"hidden\"` (symbols only), `\"inside\"` the capsule, or `\"below\"` it (for rows of 60px and taller, as iOS sets them). @default \"hidden\" */\n labelPlacement: { type: String as PropType<\"hidden\" | \"inside\" | \"below\">, default: \"hidden\" },\n /** A swipe past the middle between the open actions and the far edge runs the first action of that side. @default true */\n fullSwipe: { type: Boolean, default: true },\n },\n setup(props, { attrs, slots }) {\n const offset = ref(0)\n const full = ref(false)\n const swiping = ref(false)\n const rtl = ref(false)\n const round = ref(false)\n const removing = ref(false)\n const height = ref<number | undefined>(undefined)\n /** The timers of a removal and of a trackpad swipe, cleared when the row goes. */\n const timeouts: number[] = []\n let wheelTimer = 0\n /** A trackpad swipe: where it started, how far it went, the widths at its start. `locked` drops the momentum after it. */\n let wheel: { start: number; across: number; widths: Record<SwipeActionsSide, number>; rowWidth: number } | \"locked\" | null = null\n const root = ref<HTMLElement | null>(null)\n const sides: Record<SwipeActionsSide, HTMLElement | null> = { leading: null, trailing: null }\n let gesture: Gesture | null = null\n let suppressClick = false\n let observer: ResizeObserver | null = null\n const revealed = computed(() => sideOf(offset.value))\n\n const widthOf = (side: SwipeActionsSide) => sides[side]?.getBoundingClientRect().width ?? 0\n\n const isRtl = () => !!root.value && getComputedStyle(root.value).direction === \"rtl\"\n\n const move = (next: number, nextFull = false) => {\n offset.value = next\n full.value = nextFull\n }\n\n /** Lets go of the gesture: the listeners for its end go, and the row no longer follows the finger. */\n const release = () => {\n const state = gesture\n gesture = null\n state?.detach()\n return state\n }\n\n /** No action of the row keeps the focus. */\n const blurActions = () => {\n const focused = document.activeElement\n if (focused instanceof HTMLElement && (sides.leading?.contains(focused) || sides.trailing?.contains(focused))) focused.blur()\n }\n\n const close = () => {\n if (removing.value) return\n // Whatever closes or opens the row (a press, the focus, another row) ends a trackpad swipe and its momentum.\n lockWheel()\n // A closed row hides its actions, so none keeps the focus (Enter would run a hidden action).\n blurActions()\n if (closeOpenRow === closer) closeOpenRow = null\n move(0)\n }\n\n /** One function for the life of the row, so the list knows which row is open; another row that opens ends this one's gesture too. */\n const closer = () => {\n const state = release()\n if (state) {\n swiping.value = false\n // The finger of the ended swipe still lifts over this row: its click is not a click on the content.\n if (state.swiping) suppressClick = true\n }\n lockWheel()\n close()\n }\n\n /** This row takes the place of the open one. */\n const claim = () => {\n if (closeOpenRow && closeOpenRow !== closer) closeOpenRow()\n closeOpenRow = closer\n }\n\n /** Shows a side as wide as its actions (`width` when known), or closes the row when that side has none (any more). */\n const open = (side: SwipeActionsSide, width = widthOf(side)) => {\n if (removing.value) return\n if (!(width > 0)) return close()\n lockWheel()\n claim()\n rtl.value = isRtl()\n move(side === \"leading\" ? width : -width)\n }\n\n /** An open row follows its actions: more of them, other labels or another width move it to their new width. */\n const sync = () => {\n const side = sideOf(offset.value)\n if (!side || removing.value || gesture?.swiping || (wheel && wheel !== \"locked\") || full.value) return\n const width = widthOf(side)\n if (!(width > 0)) return close()\n const target = side === \"leading\" ? width : -width\n if (target !== offset.value) move(target)\n }\n\n /**\n * A symbol that has grown as tall as its circle (its max-height) is one, as iOS draws a circle from there. The\n * measure is a capsule that is laid out: a full swipe hides all but the first action of its side, and while none\n * is laid out the shape stays.\n */\n const fit = () => {\n const capsules = [...(root.value?.querySelectorAll<HTMLElement>('[data-shape=\"symbol\"] > :first-child') ?? [])]\n if (capsules.length < 1) {\n round.value = false\n return\n }\n const capsule = capsules.find((element) => element.getBoundingClientRect().height > 0)\n if (!capsule) return\n const max = parseFloat(getComputedStyle(capsule).maxHeight)\n round.value = max > 0 && capsule.getBoundingClientRect().height >= max - 0.5\n }\n\n // After each render, and whenever the actions change size, an open row takes their width and a symbol its shape.\n const observeSides = () => {\n for (const element of [sides.leading, sides.trailing]) if (element) observer?.observe(element, BORDER_BOX)\n }\n onMounted(() => {\n if (typeof ResizeObserver !== \"undefined\") observer = new ResizeObserver(() => {\n fit()\n sync()\n })\n fit()\n observeSides()\n // A trackpad swipe has to stop the page's own scroll and back gesture, which a passive listener cannot.\n root.value?.addEventListener(\"wheel\", handleWheel, { passive: false })\n })\n onUpdated(() => {\n fit()\n sync()\n observeSides()\n })\n\n // A press anywhere outside the open row closes it, while a trackpad moves it too; a finger's own swipe keeps it.\n const handleOutsidePointerDown = (event: PointerEvent) => {\n if (event.target instanceof Node && root.value?.contains(event.target)) return\n if (gesture?.swiping) return\n close()\n }\n watch(revealed, (side) => {\n document.removeEventListener(\"pointerdown\", handleOutsidePointerDown, true)\n if (side) document.addEventListener(\"pointerdown\", handleOutsidePointerDown, true)\n })\n\n // The open row lets go of the list, and of the finger, when it goes away.\n onBeforeUnmount(() => {\n document.removeEventListener(\"pointerdown\", handleOutsidePointerDown, true)\n root.value?.removeEventListener(\"wheel\", handleWheel)\n for (const id of timeouts) window.clearTimeout(id)\n window.clearTimeout(wheelTimer)\n observer?.disconnect()\n observer = null\n release()\n if (closeOpenRow === closer) closeOpenRow = null\n })\n\n /**\n * A destructive action: the content slides out to the side it was swiped to (the trailing one when pressed from\n * the keys) and the row collapses, then the action runs; a row the list keeps comes back closed.\n */\n const remove = (action: SwipeAction, side: SwipeActionsSide) => {\n const element = root.value\n if (!element || removing.value) return\n const duration = durationOf(element)\n const width = element.clientWidth\n claim()\n height.value = element.getBoundingClientRect().height\n rtl.value = isRtl()\n move(side === \"leading\" ? width : -width, full.value)\n removing.value = true\n lockWheel()\n timeouts.push(window.setTimeout(() => {\n action.onSelect?.()\n // A row the list dropped is gone by now; one it keeps comes back.\n timeouts.push(window.setTimeout(() => {\n removing.value = false\n height.value = undefined\n // An action that keeps the focus (chosen from the keys) keeps its side open, so the focus is never on a hidden action.\n const focused = document.activeElement\n const side = ([\"leading\", \"trailing\"] as const).find((name) => !!focused && !!sides[name]?.contains(focused))\n if (side) open(side)\n else close()\n }))\n }, duration))\n }\n\n /** Runs an action from its side: a destructive one removes the row first. */\n const run = (action: SwipeAction | undefined, side: SwipeActionsSide) => {\n if (!action) return close()\n if (action.role === \"destructive\") return remove(action, side)\n action.onSelect?.()\n close()\n }\n\n const settle = (state: Gesture, velocity = 0) => {\n const side = sideOf(offset.value)\n if (!side) return close()\n if (full.value) return run((side === \"leading\" ? props.leading : props.trailing)[0], side)\n // The widths from the start of the swipe: a full swipe may have stretched the actions since.\n if (swipeActionsSettle(offset.value, velocity, state.widths[side])) open(side, state.widths[side])\n else close()\n }\n\n /** A trackpad swipe that has not settled yet settles no more, where it stands (a press or a removal takes over). */\n function stopWheel() {\n window.clearTimeout(wheelTimer)\n if (wheel && wheel !== \"locked\") swiping.value = false\n wheel = null\n }\n\n /** Another row took over: this row's trackpad swipe ends here, and the momentum after it moves nothing. */\n function lockWheel() {\n if (!wheel || wheel === \"locked\") return\n stopWheel()\n wheel = \"locked\"\n wheelTimer = window.setTimeout(() => {\n wheel = null\n }, WHEEL_IDLE)\n }\n\n /**\n * A two-finger swipe on a trackpad moves the row as a finger does, without a full swipe (the momentum after the\n * fingers lift would run an action), and settles when the wheel stops. A swipe down scrolls the page.\n */\n function handleWheel(event: WheelEvent) {\n if (event.ctrlKey) return\n const horizontal = Math.abs(event.deltaX) > Math.abs(event.deltaY)\n let state = wheel\n // The momentum after a swipe keeps the lock until it stops, a removal or not.\n if (state === \"locked\") {\n window.clearTimeout(wheelTimer)\n if (horizontal) event.preventDefault()\n wheelTimer = window.setTimeout(() => {\n wheel = null\n }, WHEEL_IDLE)\n return\n }\n if (removing.value || gesture || (props.leading.length < 1 && props.trailing.length < 1)) return\n if (!state && (!horizontal || scrollsAcross(event.target, root.value))) return\n window.clearTimeout(wheelTimer)\n event.preventDefault()\n if (!state) {\n // The row moves under the focus: an action that has it lets it go, as a closed row does.\n const start = offset.value\n blurActions()\n state = { start, across: 0, widths: { leading: widthOf(\"leading\"), trailing: widthOf(\"trailing\") }, rowWidth: root.value?.clientWidth ?? 0 }\n wheel = state\n claim()\n rtl.value = isRtl()\n swiping.value = true\n }\n const scale = event.deltaMode === 1 ? 16 : event.deltaMode === 2 ? state.rowWidth : 1\n // The page scrolls the other way the fingers move: fingers moving left give a positive deltaX.\n state.across -= event.deltaX * scale * (isRtl() ? -1 : 1)\n const next = swipeActionsOffset(state.start + state.across, state.widths, state.rowWidth, false)\n move(next.offset)\n const widths = state.widths\n wheelTimer = window.setTimeout(() => {\n wheel = \"locked\"\n swiping.value = false\n const side = sideOf(offset.value)\n if (side && swipeActionsSettle(offset.value, 0, widths[side])) open(side, widths[side])\n else close()\n wheelTimer = window.setTimeout(() => {\n wheel = null\n }, WHEEL_IDLE)\n }, WHEEL_IDLE)\n }\n\n /** The finger lifted (anywhere): a swipe settles, a press on an open row closes it. */\n const finish = () => {\n const state = release()\n if (!state) return\n if (state.swiping) {\n suppressClick = true\n swiping.value = false\n settle(state, performance.now() - state.time <= FLICK_WINDOW ? state.velocity : 0)\n } else if (state.start !== 0) {\n if (state.swiping === undefined) suppressClick = true\n close()\n }\n }\n\n /** The browser took the gesture (a scroll) or the row lost the finger: the row goes back to where it was. */\n const cancel = () => {\n const state = release()\n if (!state) return\n swiping.value = false\n const side = sideOf(state.start)\n if (state.swiping && side) open(side, state.widths[side])\n else close()\n }\n\n const handlePointerDown = (event: PointerEvent) => {\n if (event.button !== 0 || gesture || removing.value) return\n // A new press of the primary pointer starts clean: a swipe that another row ended and that was then cancelled leaves\n // no click to swallow. Another finger's press keeps it, as only the primary pointer clicks.\n if (event.isPrimary) suppressClick = false\n if (props.leading.length < 1 && props.trailing.length < 1) return\n // Any press ends a trackpad swipe still moving the row, and its momentum.\n lockWheel()\n // A drag in a text field or along a slider belongs to that control.\n if (event.target instanceof Element && event.target.closest(OWN_DRAG)) return\n const pointerId = event.pointerId\n // The end of the gesture is heard wherever the finger lifts, inside the row or not.\n const handleUp = (end: PointerEvent) => {\n if (end.pointerId === pointerId) finish()\n }\n const handleCancel = (end: PointerEvent) => {\n if (end.pointerId === pointerId) cancel()\n }\n window.addEventListener(\"pointerup\", handleUp, true)\n window.addEventListener(\"pointercancel\", handleCancel, true)\n gesture = {\n pointerId,\n x: event.clientX,\n y: event.clientY,\n start: offset.value,\n swiping: undefined,\n rtl: isRtl(),\n widths: { leading: widthOf(\"leading\"), trailing: widthOf(\"trailing\") },\n rowWidth: root.value?.clientWidth ?? 0,\n across: 0,\n time: performance.now(),\n velocity: 0,\n detach: () => {\n window.removeEventListener(\"pointerup\", handleUp, true)\n window.removeEventListener(\"pointercancel\", handleCancel, true)\n },\n }\n }\n\n const handlePointerMove = (event: PointerEvent) => {\n const state = gesture\n if (!state || state.pointerId !== event.pointerId || state.swiping === false) return\n const across = (event.clientX - state.x) * (state.rtl ? -1 : 1)\n const down = event.clientY - state.y\n // The speed is the finger's latest, from every move, the ones within the slop too.\n const now = performance.now()\n if (now > state.time) state.velocity = (across - state.across) / (now - state.time)\n state.across = across\n state.time = now\n if (state.swiping === undefined) {\n if (Math.abs(across) < SLOP && Math.abs(down) < SLOP) return\n if (Math.abs(across) <= Math.abs(down)) {\n state.swiping = false\n return\n }\n state.swiping = true\n const target = event.currentTarget\n if (target instanceof Element) capture(target, event.pointerId)\n window.getSelection?.()?.removeAllRanges()\n claim()\n rtl.value = state.rtl\n swiping.value = true\n }\n const next = swipeActionsOffset(state.start + across, state.widths, state.rowWidth, props.fullSwipe)\n move(next.offset, next.full)\n }\n\n /** The content lost the finger it held. A child that loses the finger to the content (as a touch moves its implicit capture) ends nothing. */\n const handleLostPointerCapture = (event: PointerEvent) => {\n if (event.target === event.currentTarget && gesture?.pointerId === event.pointerId) cancel()\n }\n\n /** A swipe or a press that closed the row is not a click on the content; a click from the keys still is. */\n const handleClickCapture = (event: MouseEvent) => {\n if (!suppressClick || event.detail === 0) return\n suppressClick = false\n event.preventDefault()\n event.stopPropagation()\n }\n\n /** The focus on an action shows its side; on the content it closes the row. */\n const handleFocusIn = (event: FocusEvent) => {\n if (gesture?.swiping || removing.value) return\n const target = event.target\n const side = ([\"leading\", \"trailing\"] as const).find((name) => target instanceof Node && !!sides[name]?.contains(target))\n if (side) {\n // A trackpad swipe still moving the row ends with the side fully open.\n const wheeling = !!wheel && wheel !== \"locked\"\n if (wheeling || sideOf(offset.value) !== side) open(side)\n } else if (offset.value !== 0) {\n close()\n }\n }\n\n const handleFocusOut = (event: FocusEvent) => {\n if (gesture?.swiping || removing.value) return\n if (event.relatedTarget instanceof Node && root.value?.contains(event.relatedTarget)) return\n if (offset.value !== 0) close()\n }\n\n const select = (action: SwipeAction, side: SwipeActionsSide, event: MouseEvent) => {\n // A row being removed runs nothing more, from the keys either.\n if (removing.value) return\n // A press ends a trackpad swipe still moving the row.\n lockWheel()\n // A pointer leaves no focus on the action, so a row the list keeps closes.\n const target = event.currentTarget\n if (event.detail !== 0 && target instanceof HTMLElement) target.blur()\n if (action.role === \"destructive\") return remove(action, side)\n action.onSelect?.()\n // A press closes the row, as iOS does. From the keys the action keeps the focus, so its side stays open until\n // the focus leaves the row.\n if (event.detail === 0) return\n close()\n }\n\n const renderSide = (side: SwipeActionsSide, actions: SwipeAction[]) => {\n if (actions.length < 1) return null\n const shown = side === \"leading\" ? actions : [...actions].reverse()\n const isFull = full.value && revealed.value === side\n return h(\"div\", {\n \"ref\": (element: unknown) => {\n sides[side] = element instanceof HTMLElement ? element : null\n },\n \"class\": s.Actions,\n \"data-side\": side,\n \"data-full\": isFull ? \"\" : undefined,\n \"style\": isFull ? { width: `${Math.abs(offset.value)}px` } : undefined,\n }, shown.map((action) => {\n const color = action.color ?? \"secondary\"\n // A label alone (text), a symbol with its label inside (label), or a symbol with its label hidden or below.\n const shape = !action.Icon ? \"text\" : props.labelPlacement === \"inside\" ? \"label\" : \"symbol\"\n const labelInside = shape !== \"symbol\"\n const labelBelow = shape === \"symbol\" && props.labelPlacement === \"below\"\n return h(\"button\", {\n \"key\": action.id,\n \"type\": \"button\",\n \"class\": s.Action,\n \"data-color\": color,\n \"data-shape\": shape,\n \"data-first\": action === actions[0] ? \"\" : undefined,\n \"aria-label\": labelInside || labelBelow ? undefined : action.label,\n \"onClick\": (event: MouseEvent) => select(action, side, event),\n }, [\n h(\"span\", { class: s.Capsule }, [\n action.Icon ? h(action.Icon, { \"class\": s.Icon, \"aria-hidden\": \"true\" }) : null,\n labelInside ? h(\"span\", { class: s.Label }, action.label) : null,\n ]),\n labelBelow ? h(\"span\", { class: s.Caption }, action.label) : null,\n ])\n }))\n }\n\n return () => h(\"div\", {\n ...attrs,\n \"ref\": root,\n \"class\": [s.SwipeActions, attrs.class],\n \"data-row\": \"\",\n \"data-swipe-actions\": \"\",\n \"data-label-placement\": props.labelPlacement,\n \"data-round\": round.value ? \"\" : undefined,\n \"data-revealed\": revealed.value,\n \"data-swiping\": swiping.value ? \"\" : undefined,\n \"data-removing\": removing.value ? \"\" : undefined,\n // The row collapses from its height (keyframes in the CSS), so no frame has to pass first.\n \"style\": height.value !== undefined ? [attrs.style, { \"--swipe-actions-row-height\": `${height.value}px` }] : attrs.style,\n \"onFocusin\": handleFocusIn,\n \"onFocusout\": handleFocusOut,\n }, [\n renderSide(\"leading\", props.leading),\n h(\"div\", {\n \"class\": s.Content,\n \"data-swipe-content\": \"\",\n \"style\": offset.value !== 0 ? { \"--swipe-actions-offset\": `${rtl.value ? -offset.value : offset.value}px` } : undefined,\n \"onPointerdown\": handlePointerDown,\n \"onPointermove\": handlePointerMove,\n \"onLostpointercapture\": handleLostPointerCapture,\n \"onClickCapture\": handleClickCapture,\n }, slots.default?.()),\n renderSide(\"trailing\", props.trailing),\n ])\n },\n})\n\ntype SwipeActionsOwnProps = InstanceType<typeof SwipeActionsComponent>[\"$props\"]\n\n/** SwipeActions props. */\nexport type SwipeActionsProps = SwipeActionsOwnProps\n\n/**\n * Actions behind a row of a list, as the swipe actions of an iOS list: a swipe toward the leading edge reveals the\n * trailing actions, a swipe toward the trailing edge the leading ones, and a full swipe runs the first action of\n * that side. The row is a `data-row` of a FieldGroup. Each action is also a button in the order of the screen, and\n * the focus on one shows its side.\n */\nexport const SwipeActions = SwipeActionsComponent\n"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { SwipeActions, swipeActionsOffset, } from "./SwipeActions.js";
|
|
1
|
+
export { SwipeActions, swipeActionsOffset, swipeActionsSettle, } from "./SwipeActions.js";
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/SwipeActions/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,kBAAkB,GAKnB,MAAM,mBAAmB,CAAA","sourcesContent":["export {\n SwipeActions,\n swipeActionsOffset,\n type SwipeAction,\n type SwipeActionColor,\n type SwipeActionsProps,\n type SwipeActionsSide,\n} from \"./SwipeActions.js\"\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/SwipeActions/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,kBAAkB,GAKnB,MAAM,mBAAmB,CAAA","sourcesContent":["export {\n SwipeActions,\n swipeActionsOffset,\n swipeActionsSettle,\n type SwipeAction,\n type SwipeActionColor,\n type SwipeActionsProps,\n type SwipeActionsSide,\n} from \"./SwipeActions.js\"\n"]}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The room on the side the popover did not take, from the room the popper gives its own side (which already holds
|
|
3
|
+
* the offset and the collision padding) and where the trigger stands in the viewport. With no trigger found it is
|
|
4
|
+
* zero, so the popover is capped to its own side as before.
|
|
5
|
+
*/
|
|
6
|
+
function otherRoom(content, room) {
|
|
7
|
+
const trigger = content.id ? document.querySelector(`[aria-controls="${content.id}"]`) : null;
|
|
8
|
+
if (!trigger)
|
|
9
|
+
return 0;
|
|
10
|
+
const rect = trigger.getBoundingClientRect();
|
|
11
|
+
// The popper (Floating UI, fixed) measures the visual viewport, which a keyboard or a zoom makes shorter than the
|
|
12
|
+
// layout one, and in WebKit it moves the trigger's rect by the visual viewport's offset as it does
|
|
13
|
+
const view = window.visualViewport;
|
|
14
|
+
const top = view ? view.offsetTop : 0;
|
|
15
|
+
const height = view ? view.height : document.documentElement.clientHeight;
|
|
16
|
+
const webkit = typeof CSS !== "undefined" && typeof CSS.supports === "function" && CSS.supports("-webkit-backdrop-filter", "none");
|
|
17
|
+
const shift = view && webkit ? view.offsetTop : 0;
|
|
18
|
+
const above = rect.top + shift - top;
|
|
19
|
+
const below = top + height - (rect.bottom + shift);
|
|
20
|
+
return content.getAttribute("data-side") === "top" ? room - above + below : room - below + above;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* On a phone the calendar keeps its whole height, so its popover flips to the side of the trigger with room
|
|
24
|
+
* (Calendar.module.css). When neither side has room, it is capped to the room of the side it took and scrolls, so
|
|
25
|
+
* every date and the time row stay reachable (Codex 15.11). The popover's scroll height is the calendar's own height
|
|
26
|
+
* whether or not it is capped, so the check never feeds on its own result. The popover is looked up in a frame (a
|
|
27
|
+
* Vue parent sets its role after its children mount) and watched for the room and side the popper writes on it as
|
|
28
|
+
* the page scrolls. Returns the cleanup.
|
|
29
|
+
*/
|
|
30
|
+
export function watchCalendarFit(wrapper) {
|
|
31
|
+
if (typeof window === "undefined" || typeof requestAnimationFrame === "undefined")
|
|
32
|
+
return () => { };
|
|
33
|
+
let content = null;
|
|
34
|
+
let mutations;
|
|
35
|
+
let frame = 0;
|
|
36
|
+
let tries = 0;
|
|
37
|
+
const check = () => {
|
|
38
|
+
frame = 0;
|
|
39
|
+
if (!content) {
|
|
40
|
+
content = wrapper.closest('[role="dialog"]');
|
|
41
|
+
if (content && typeof MutationObserver !== "undefined") {
|
|
42
|
+
mutations = new MutationObserver(schedule);
|
|
43
|
+
mutations.observe(content, { attributes: true, attributeFilter: ["style", "data-side"] });
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
const room = content
|
|
47
|
+
? parseFloat(getComputedStyle(content).getPropertyValue("--radix-popover-content-available-height"))
|
|
48
|
+
: NaN;
|
|
49
|
+
if (!content || !Number.isFinite(room) || room <= 0) {
|
|
50
|
+
if (++tries < 20)
|
|
51
|
+
frame = requestAnimationFrame(check);
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
// The cap goes on only when the other side has no room for the whole calendar either. On the side it took
|
|
55
|
+
// while it was shorter, it would otherwise make the grown calendar fit there and stop the popper's flip
|
|
56
|
+
// (console 15.11: a lower row of a sheet opened below and scrolled with 440px free above it).
|
|
57
|
+
const height = content.scrollHeight;
|
|
58
|
+
const squeezed = height > room + 0.5 && height > otherRoom(content, room) + 0.5;
|
|
59
|
+
if (content.hasAttribute("data-calendar-squeezed") !== squeezed)
|
|
60
|
+
content.toggleAttribute("data-calendar-squeezed", squeezed);
|
|
61
|
+
};
|
|
62
|
+
function schedule() {
|
|
63
|
+
tries = 0;
|
|
64
|
+
if (!frame)
|
|
65
|
+
frame = requestAnimationFrame(check);
|
|
66
|
+
}
|
|
67
|
+
schedule();
|
|
68
|
+
const resizes = typeof ResizeObserver !== "undefined" ? new ResizeObserver(schedule) : undefined;
|
|
69
|
+
resizes?.observe(wrapper);
|
|
70
|
+
window.addEventListener("resize", schedule);
|
|
71
|
+
return () => {
|
|
72
|
+
if (frame)
|
|
73
|
+
cancelAnimationFrame(frame);
|
|
74
|
+
resizes?.disconnect();
|
|
75
|
+
mutations?.disconnect();
|
|
76
|
+
window.removeEventListener("resize", schedule);
|
|
77
|
+
content?.removeAttribute("data-calendar-squeezed");
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=calendarFit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"calendarFit.js","sourceRoot":"","sources":["../../../src/lib/calendarFit.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,SAAS,SAAS,CAAC,OAAoB,EAAE,IAAY;IACnD,MAAM,OAAO,GAAG,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,aAAa,CAAc,mBAAmB,OAAO,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA;IAC1G,IAAI,CAAC,OAAO;QAAE,OAAO,CAAC,CAAA;IACtB,MAAM,IAAI,GAAG,OAAO,CAAC,qBAAqB,EAAE,CAAA;IAC5C,kHAAkH;IAClH,mGAAmG;IACnG,MAAM,IAAI,GAAG,MAAM,CAAC,cAAc,CAAA;IAClC,MAAM,GAAG,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAA;IACrC,MAAM,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,eAAe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AAgB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAA;IAC3C,OAAO,GAAG,EAAE;QACV,IAAI,KAAK;YAAE,oBAAoB,CAAC,KAAK,CAAC,CAAA;QACtC,OAAO,EAAE,UAAU,EAAE,CAAA;QACrB,SAAS,EAAE,UAAU,EAAE,CAAA;QACvB,MAAM,CAAC,mBAAmB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAA;QAC9C,OAAO,EAAE,eAAe,CAAC,wBAAwB,CAAC,CAAA;IACpD,CAAC,CAAA;AACH,CAAC","sourcesContent":["/**\n * The room on the side the popover did not take, from the room the popper gives its own side (which already holds\n * the offset and the collision padding) and where the trigger stands in the viewport. With no trigger found it is\n * zero, so the popover is capped to its own side as before.\n */\nfunction otherRoom(content: HTMLElement, room: number): number {\n const trigger = content.id ? document.querySelector<HTMLElement>(`[aria-controls=\"${content.id}\"]`) : null\n if (!trigger) return 0\n const rect = trigger.getBoundingClientRect()\n // The popper (Floating UI, fixed) measures the visual viewport, which a keyboard or a zoom makes shorter than the\n // layout one, and in WebKit it moves the trigger's rect by the visual viewport's offset as it does\n const view = window.visualViewport\n const top = view ? view.offsetTop : 0\n const height = view ? view.height : document.documentElement.clientHeight\n const webkit = typeof CSS !== \"undefined\" && typeof CSS.supports === \"function\" && CSS.supports(\"-webkit-backdrop-filter\", \"none\")\n const shift = view && webkit ? view.offsetTop : 0\n const above = rect.top + shift - top\n const below = top + height - (rect.bottom + shift)\n return content.getAttribute(\"data-side\") === \"top\" ? room - above + below : room - below + above\n}\n\n/**\n * On a phone the calendar keeps its whole height, so its popover flips to the side of the trigger with room\n * (Calendar.module.css). When neither side has room, it is capped to the room of the side it took and scrolls, so\n * every date and the time row stay reachable (Codex 15.11). The popover's scroll height is the calendar's own height\n * whether or not it is capped, so the check never feeds on its own result. The popover is looked up in a frame (a\n * Vue parent sets its role after its children mount) and watched for the room and side the popper writes on it as\n * the page scrolls. Returns the cleanup.\n */\nexport function watchCalendarFit(wrapper: HTMLElement): () => void {\n if (typeof window === \"undefined\" || typeof requestAnimationFrame === \"undefined\") return () => {}\n let content: HTMLElement | null = null\n let mutations: MutationObserver | undefined\n let frame = 0\n let tries = 0\n const check = () => {\n frame = 0\n if (!content) {\n content = wrapper.closest<HTMLElement>('[role=\"dialog\"]')\n if (content && typeof MutationObserver !== \"undefined\") {\n mutations = new MutationObserver(schedule)\n mutations.observe(content, { attributes: true, attributeFilter: [\"style\", \"data-side\"] })\n }\n }\n const room = content\n ? parseFloat(getComputedStyle(content).getPropertyValue(\"--radix-popover-content-available-height\"))\n : NaN\n if (!content || !Number.isFinite(room) || room <= 0) {\n if (++tries < 20) frame = requestAnimationFrame(check)\n return\n }\n // The cap goes on only when the other side has no room for the whole calendar either. On the side it took\n // while it was shorter, it would otherwise make the grown calendar fit there and stop the popper's flip\n // (console 15.11: a lower row of a sheet opened below and scrolled with 440px free above it).\n const height = content.scrollHeight\n const squeezed = height > room + 0.5 && height > otherRoom(content, room) + 0.5\n if (content.hasAttribute(\"data-calendar-squeezed\") !== squeezed) content.toggleAttribute(\"data-calendar-squeezed\", squeezed)\n }\n function schedule() {\n tries = 0\n if (!frame) frame = requestAnimationFrame(check)\n }\n schedule()\n const resizes = typeof ResizeObserver !== \"undefined\" ? new ResizeObserver(schedule) : undefined\n resizes?.observe(wrapper)\n window.addEventListener(\"resize\", schedule)\n return () => {\n if (frame) cancelAnimationFrame(frame)\n resizes?.disconnect()\n mutations?.disconnect()\n window.removeEventListener(\"resize\", schedule)\n content?.removeAttribute(\"data-calendar-squeezed\")\n }\n}\n\n"]}
|
|
@@ -11,8 +11,16 @@ export type SwipeAction = {
|
|
|
11
11
|
color?: SwipeActionColor;
|
|
12
12
|
/** Called when the action is pressed, or by a full swipe when it is the first action of its side */
|
|
13
13
|
onSelect?: () => void;
|
|
14
|
+
/** `"destructive"`: the action removes the row, so the row slides out and its height collapses, as iOS deletes a row, and `onSelect` comes at the end of that for the list to drop it. A row the list keeps comes back. */
|
|
15
|
+
role?: "destructive";
|
|
14
16
|
};
|
|
15
17
|
export type SwipeActionsSide = "leading" | "trailing";
|
|
18
|
+
/**
|
|
19
|
+
* Where a swipe that ended at `offset` settles: a flick (`velocity` px/ms, toward the trailing edge when positive)
|
|
20
|
+
* opens the side it moves toward and closes the row when it moves back; a slow one opens a side moved past half its
|
|
21
|
+
* `width`.
|
|
22
|
+
*/
|
|
23
|
+
export declare const swipeActionsSettle: (offset: number, velocity: number, width: number) => boolean;
|
|
16
24
|
/**
|
|
17
25
|
* Where the content goes for a swipe of `raw` px toward the trailing edge (negative: toward the leading edge), and
|
|
18
26
|
* whether that is a full swipe. A side without actions stays shut. Past its actions the content follows the finger
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { SwipeActions, swipeActionsOffset, type SwipeAction, type SwipeActionColor, type SwipeActionsProps, type SwipeActionsSide, } from "./SwipeActions.js";
|
|
1
|
+
export { SwipeActions, swipeActionsOffset, swipeActionsSettle, type SwipeAction, type SwipeActionColor, type SwipeActionsProps, type SwipeActionsSide, } from "./SwipeActions.js";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* On a phone the calendar keeps its whole height, so its popover flips to the side of the trigger with room
|
|
3
|
+
* (Calendar.module.css). When neither side has room, it is capped to the room of the side it took and scrolls, so
|
|
4
|
+
* every date and the time row stay reachable (Codex 15.11). The popover's scroll height is the calendar's own height
|
|
5
|
+
* whether or not it is capped, so the check never feeds on its own result. The popover is looked up in a frame (a
|
|
6
|
+
* Vue parent sets its role after its children mount) and watched for the room and side the popper writes on it as
|
|
7
|
+
* the page scrolls. Returns the cleanup.
|
|
8
|
+
*/
|
|
9
|
+
export declare function watchCalendarFit(wrapper: HTMLElement): () => void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plexui/vue",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.33.0",
|
|
4
4
|
"description": "Plex UI components for Vue 3, built on Reka UI and the shared @plexui/styles CSS",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
"@maskito/core": "5.2.2",
|
|
78
78
|
"@maskito/kit": "5.2.2",
|
|
79
79
|
"@maskito/vue": "5.2.2",
|
|
80
|
-
"@plexui/styles": "^0.
|
|
80
|
+
"@plexui/styles": "^0.11.1",
|
|
81
81
|
"@tanstack/table-core": "8.21.3",
|
|
82
82
|
"@tanstack/vue-table": "8.21.3",
|
|
83
83
|
"@tiptap/core": "3.21.0",
|