@plexui/vue 0.22.0 → 0.23.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/Alert/Alert.js +16 -4
- package/dist/es/components/Alert/Alert.js.map +1 -1
- package/dist/es/components/ColorPicker/ColorPicker.js +13 -9
- package/dist/es/components/ColorPicker/ColorPicker.js.map +1 -1
- package/dist/es/components/ColorPicker/ColorWell.js +5 -3
- package/dist/es/components/ColorPicker/ColorWell.js.map +1 -1
- package/dist/es/components/ColorPicker/shared.js +5 -4
- package/dist/es/components/ColorPicker/shared.js.map +1 -1
- package/dist/es/components/ContextMenu/ContextMenu.js +9 -9
- package/dist/es/components/ContextMenu/ContextMenu.js.map +1 -1
- package/dist/es/components/ContextMenu/shared.js +25 -5
- package/dist/es/components/ContextMenu/shared.js.map +1 -1
- package/dist/es/components/DatePicker/DatePicker.js +3 -3
- package/dist/es/components/DatePicker/DatePicker.js.map +1 -1
- package/dist/es/components/DatePicker/useCalendarCollisionPadding.js +25 -0
- package/dist/es/components/DatePicker/useCalendarCollisionPadding.js.map +1 -0
- package/dist/es/components/DateRangePicker/DateRangePicker.js +3 -3
- package/dist/es/components/DateRangePicker/DateRangePicker.js.map +1 -1
- package/dist/es/components/Dialog/Dialog.js +2 -2
- package/dist/es/components/Dialog/Dialog.js.map +1 -1
- package/dist/es/components/Input/Input.js +3 -0
- package/dist/es/components/Input/Input.js.map +1 -1
- package/dist/es/components/Menu/Menu.js +10 -1
- package/dist/es/components/Menu/Menu.js.map +1 -1
- package/dist/es/components/PhoneLayout/PhoneLayout.js +9 -1
- package/dist/es/components/PhoneLayout/PhoneLayout.js.map +1 -1
- package/dist/es/components/Popover/Popover.js +2 -2
- package/dist/es/components/Popover/Popover.js.map +1 -1
- package/dist/es/components/ProgressSteps/ProgressSteps.js +7 -3
- package/dist/es/components/ProgressSteps/ProgressSteps.js.map +1 -1
- package/dist/es/components/ProgressSteps/index.js.map +1 -1
- package/dist/es/components/Select/Select.js +178 -32
- package/dist/es/components/Select/Select.js.map +1 -1
- package/dist/es/components/SelectControl/SelectControl.js +3 -1
- package/dist/es/components/SelectControl/SelectControl.js.map +1 -1
- package/dist/es/components/Slider/Slider.js +24 -11
- package/dist/es/components/Slider/Slider.js.map +1 -1
- package/dist/es/components/Slider/sliderPrimitive.js +5 -2
- package/dist/es/components/Slider/sliderPrimitive.js.map +1 -1
- package/dist/es/components/Sortable/Sortable.js +1 -1
- package/dist/es/components/Sortable/Sortable.js.map +1 -1
- package/dist/es/components/StatCard/index.js +4 -1
- package/dist/es/components/StatCard/index.js.map +1 -1
- package/dist/es/components/{StatCard/StatCard.js → StatsCard/StatsCard.js} +32 -27
- package/dist/es/components/StatsCard/StatsCard.js.map +1 -0
- package/dist/es/components/StatsCard/index.js +2 -0
- package/dist/es/components/StatsCard/index.js.map +1 -0
- package/dist/es/components/SwipeActions/SwipeActions.js +32 -5
- package/dist/es/components/SwipeActions/SwipeActions.js.map +1 -1
- package/dist/es/components/TabBar/TabBar.js +52 -21
- package/dist/es/components/TabBar/TabBar.js.map +1 -1
- package/dist/es/components/Tabs/Tabs.js +229 -6
- package/dist/es/components/Tabs/Tabs.js.map +1 -1
- package/dist/es/components/Toolbar/Toolbar.js.map +1 -1
- package/dist/es/lib/menuTriggerCover.js +40 -3
- package/dist/es/lib/menuTriggerCover.js.map +1 -1
- package/dist/types/components/ColorPicker/ColorPicker.d.ts +3 -2
- package/dist/types/components/ColorPicker/shared.d.ts +5 -4
- package/dist/types/components/ContextMenu/shared.d.ts +28 -6
- package/dist/types/components/DatePicker/useCalendarCollisionPadding.d.ts +9 -0
- package/dist/types/components/Dialog/Dialog.d.ts +2 -2
- package/dist/types/components/PhoneLayout/PhoneLayout.d.ts +5 -0
- package/dist/types/components/Popover/Popover.d.ts +5 -5
- package/dist/types/components/ProgressSteps/ProgressSteps.d.ts +17 -3
- package/dist/types/components/ProgressSteps/index.d.ts +1 -1
- package/dist/types/components/Select/Select.d.ts +19 -8
- package/dist/types/components/StatCard/index.d.ts +9 -1
- package/dist/types/components/{StatCard/StatCard.d.ts → StatsCard/StatsCard.d.ts} +19 -19
- package/dist/types/components/StatsCard/index.d.ts +1 -0
- package/dist/types/components/SwipeActions/SwipeActions.d.ts +4 -4
- package/dist/types/components/TabBar/TabBar.d.ts +34 -0
- package/dist/types/components/Tabs/Tabs.d.ts +33 -2
- package/dist/types/components/Toolbar/Toolbar.d.ts +1 -1
- package/dist/types/lib/menuTriggerCover.d.ts +16 -2
- package/package.json +2 -2
- package/dist/es/components/DatePicker/useCalendarGutter.js +0 -14
- package/dist/es/components/DatePicker/useCalendarGutter.js.map +0 -1
- package/dist/es/components/StatCard/StatCard.js.map +0 -1
- package/dist/types/components/DatePicker/useCalendarGutter.d.ts +0 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sliderPrimitive.js","sourceRoot":"","sources":["../../../../src/components/Slider/sliderPrimitive.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EACR,eAAe,EACf,CAAC,EACD,MAAM,EACN,eAAe,EACf,SAAS,EACT,OAAO,EACP,GAAG,EACH,UAAU,EACV,KAAK,GAKN,MAAM,KAAK,CAAA;AACZ,OAAO,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAqCtE,MAAM,gBAAgB,GAAqC,MAAM,CAAC,uBAAuB,CAAC,CAAA;AAE1F,MAAM,gBAAgB,GAAG,GAAG,EAAE,CAAC,MAAM,CAAC,gBAAgB,CAAE,CAAA;AAExD,MAAM,SAAS,GAAG,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAA;AACxC,MAAM,UAAU,GAAG,CAAC,SAAS,EAAE,WAAW,EAAE,WAAW,EAAE,YAAY,CAAC,CAAA;AACtE,MAAM,SAAS,GAAkD;IAC/D,WAAW,EAAE,CAAC,MAAM,EAAE,UAAU,EAAE,WAAW,EAAE,WAAW,CAAC;IAC3D,aAAa,EAAE,CAAC,MA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EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,KAAK;wBACjE,SAAS,EAAE,WAAW;qBACvB,CAAC;iBACH,CACF;gBACD,kEAAkE;gBAClE,uDAAuD;gBACvD,aAAa,CAAC,KAAK;oBACjB,CAAC,CAAC,CAAC,CAAC,iBAAiB,EAAE,EAAE,GAAG,EAAE,KAAK,CAAC,KAAK,EAAE,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,CAAC;oBACrF,CAAC,CAAC,IAAI;aACT,CAAA;QACH,CAAC,CAAA;IACH,CAAC;CACF,CAAC,CAAA","sourcesContent":["import {\n computed,\n defineComponent,\n h,\n inject,\n onBeforeUnmount,\n onMounted,\n provide,\n ref,\n shallowRef,\n watch,\n type ComputedRef,\n type InjectionKey,\n type PropType,\n type Ref,\n} from \"vue\"\nimport { useIsFormControl, useSize } from \"../Checkbox/bubbleInput.js\"\n\n// Internal: Radix Slider (Root, Track, Range, Thumb) as Plex's Slider uses\n// it, rendered the Radix way (@radix-ui/react-slider 1.6, from radix-ui\n// 1.8). Reka's Slider renders different markup (no positioning wrapper\n// around the thumb, `data-slider-impl`, `--reka-slider-thumb-transform`, its\n// own hidden input), runs its handlers before the caller's and has no\n// counterpart for Radix's thumb focus order, so the Radix primitive is ported\n// here. Plex always controls the value (`values` + `onValueChange`), so\n// Radix's uncontrolled state, `onValueCommit`, `name`, `form`, `dir`,\n// `inverted` and `preserveThumbOrder` (unused by Plex) are left out.\n\ntype SliderOrientation = \"horizontal\" | \"vertical\"\n\ntype OrientationContext = {\n startEdge: \"left\" | \"bottom\"\n endEdge: \"right\" | \"top\"\n size: \"width\" | \"height\"\n direction: 1\n}\n\ntype SliderContextValue = {\n values: ComputedRef<number[]>\n min: ComputedRef<number>\n max: ComputedRef<number>\n disabled: ComputedRef<boolean>\n orientation: ComputedRef<SliderOrientation>\n edges: ComputedRef<OrientationContext>\n valueIndexToChange: { current: number }\n /** The values the last pointer or key change asked for (tells the hidden inputs a user change from a parent's) */\n userRequestedValues: Ref<number[] | null>\n /** Thumb elements in mount order (Radix keeps them in a Set) */\n thumbs: Set<HTMLElement>\n /** Index of a thumb among the slider's thumbs, in DOM order (Radix's collection) */\n thumbIndex: (thumb: HTMLElement) => number\n}\n\nconst SliderContextKey: InjectionKey<SliderContextValue> = Symbol(\"PlexUISliderPrimitive\")\n\nconst useSliderContext = () => inject(SliderContextKey)!\n\nconst PAGE_KEYS = [\"PageUp\", \"PageDown\"]\nconst ARROW_KEYS = [\"ArrowUp\", \"ArrowDown\", \"ArrowLeft\", \"ArrowRight\"]\nconst BACK_KEYS: Record<\"from-left\" | \"from-bottom\", string[]> = {\n \"from-left\": [\"Home\", \"PageDown\", \"ArrowDown\", \"ArrowLeft\"],\n \"from-bottom\": [\"Home\", \"PageDown\", \"ArrowDown\", \"ArrowLeft\"],\n}\n\n// Radix's left-to-right horizontal and bottom-to-top vertical slider (Plex\n// passes neither `dir` nor `inverted`)\nconst HORIZONTAL: OrientationContext = { startEdge: \"left\", endEdge: \"right\", size: \"width\", direction: 1 }\nconst VERTICAL: OrientationContext = { startEdge: \"bottom\", endEdge: \"top\", size: \"height\", direction: 1 }\n\nconst clampNumber = (value: number, [min, max]: [number, number]) => Math.min(max, Math.max(min, value))\n\nconst getNextSortedValues = (prevValues: number[] = [], nextValue: number, atIndex: number) => {\n const nextValues = [...prevValues]\n nextValues[atIndex] = nextValue\n return nextValues.sort((a, b) => a - b)\n}\n\nconst convertValueToPercentage = (value: number, min: number, max: number) => {\n const maxSteps = max - min\n const percentPerStep = 100 / maxSteps\n const percentage = percentPerStep * (value - min)\n return clampNumber(percentage, [0, 100])\n}\n\nconst getLabel = (index: number, totalValues: number) => {\n if (totalValues > 2) {\n return `Value ${index + 1} of ${totalValues}`\n } else if (totalValues === 2) {\n return [\"Minimum\", \"Maximum\"][index]\n } else {\n return undefined\n }\n}\n\nconst getClosestValueIndex = (values: number[], nextValue: number) => {\n if (values.length === 1) return 0\n const distances = values.map((value) => Math.abs(value - nextValue))\n const closestDistance = Math.min(...distances)\n return distances.indexOf(closestDistance)\n}\n\nconst linearScale = (input: readonly [number, number], output: readonly [number, number]) => (value: number) => {\n if (input[0] === input[1] || output[0] === output[1]) return output[0]\n const ratio = (output[1] - output[0]) / (input[1] - input[0])\n return output[0] + ratio * (value - input[0])\n}\n\nconst getThumbInBoundsOffset = (width: number, left: number, direction: number) => {\n const halfWidth = width / 2\n const halfPercent = 50\n const offset = linearScale([0, halfPercent], [0, halfWidth])\n return (halfWidth - offset(left) * direction) * direction\n}\n\nconst getStepsBetweenValues = (values: number[]) => values.slice(0, -1).map((value, index) => values[index + 1]! - value)\n\nconst hasMinStepsBetweenValues = (values: number[], minStepsBetweenValues: number) => {\n if (minStepsBetweenValues > 0) {\n const stepsBetweenValues = getStepsBetweenValues(values)\n const actualMinStepsBetweenValues = Math.min(...stepsBetweenValues)\n return actualMinStepsBetweenValues >= minStepsBetweenValues\n }\n return true\n}\n\nconst getDecimalCount = (value: number) => {\n if (!Number.isFinite(value)) return 0\n const str = value.toString()\n if (str.includes(\"e\")) {\n const [coefficient, exponent] = str.split(\"e\")\n const decimalPart = coefficient!.split(\".\")[1] || \"\"\n return Math.max(0, decimalPart.length - Number(exponent))\n }\n return (str.split(\".\")[1] || \"\").length\n}\n\nconst roundValue = (value: number, decimalCount: number) => {\n const rounder = Math.pow(10, decimalCount)\n return Math.round(value * rounder) / rounder\n}\n\n// A key step from a value off the step grid lands on the grid's next value first\nconst getNextStepValue = (\n value: number,\n { min, step, direction, multiplier }: { min: number; step: number; direction: number; multiplier: number },\n) => {\n const decimalCount = getDecimalCount(step)\n const stepsFromMin = (value - min) / step\n const nearestSteps = Math.round(stepsFromMin)\n const isAligned = roundValue(nearestSteps * step + min, decimalCount) === roundValue(value, decimalCount)\n let nextSteps\n if (isAligned) {\n nextSteps = nearestSteps + multiplier * direction\n } else if (direction > 0) {\n nextSteps = Math.ceil(stepsFromMin)\n } else {\n nextSteps = Math.floor(stepsFromMin)\n }\n return roundValue(nextSteps * step + min, decimalCount)\n}\n\nconst callHandlers = (handlers: unknown, event: Event) => {\n for (const handler of Array.isArray(handlers) ? handlers : [handlers]) {\n if (typeof handler === \"function\") handler(event)\n }\n}\n\n/**\n * Radix `Slider.Root`. `class`, `style` and the caller's `onPointerdown`,\n * `onPointerup` (run before Radix's, which they can cancel), `onFocusin` and\n * `onFocusout` land on the root `<span>`.\n */\nexport const SliderRoot = defineComponent({\n name: \"SliderRoot\",\n inheritAttrs: false,\n props: {\n values: { type: Array as PropType<number[]>, required: true },\n min: { type: Number, required: true },\n max: { type: Number, required: true },\n step: { type: Number, required: true },\n disabled: { type: Boolean, default: false },\n orientation: { type: String as PropType<SliderOrientation>, default: \"horizontal\" },\n minStepsBetweenThumbs: { type: Number, default: 0 },\n onValueChange: Function as PropType<(values: number[]) => void>,\n /** Receives the root element, like React's forwarded ref */\n elementRef: Function as PropType<(element: HTMLElement | null) => void>,\n },\n setup(props, { attrs, slots }) {\n const root = ref<HTMLElement | null>(null)\n const thumbs = new Set<HTMLElement>()\n const valueIndexToChange = { current: 0 }\n const userRequestedValues = shallowRef<number[] | null>(null)\n // A key change shows the focus ring on the thumb it focuses; a pointer does not\n let isKeyboardInteraction = false\n let rect: DOMRect | undefined\n\n const isHorizontal = () => props.orientation === \"horizontal\"\n\n const setRoot = (element: unknown) => {\n root.value = (element as HTMLElement | null) ?? null\n props.elementRef?.(root.value)\n }\n\n provide(SliderContextKey, {\n values: computed(() => props.values),\n min: computed(() => props.min),\n max: computed(() => props.max),\n disabled: computed(() => props.disabled),\n orientation: computed(() => props.orientation),\n edges: computed(() => (isHorizontal() ? HORIZONTAL : VERTICAL)),\n valueIndexToChange,\n userRequestedValues,\n thumbs,\n thumbIndex: (thumb) => Array.from(root.value?.querySelectorAll('[role=\"slider\"]') ?? []).indexOf(thumb),\n })\n\n // Radix's controlled useControllableState: a new array is reported,\n // focusing the thumb that changed first\n const reportValues = (values: number[]) => {\n const thumbList = [...thumbs]\n thumbList[valueIndexToChange.current]?.focus({\n preventScroll: true,\n focusVisible: isKeyboardInteraction,\n } as FocusOptions)\n isKeyboardInteraction = false\n props.onValueChange?.(values)\n }\n\n // The updater runs against the current prop, and only a changed array is reported\n const updateValues = (value: number, atIndex: number) => {\n const decimalCount = getDecimalCount(props.step)\n const snapToStep = roundValue(Math.round((value - props.min) / props.step) * props.step + props.min, decimalCount)\n const nextValue = clampNumber(snapToStep, [props.min, props.max])\n const prevValues = props.values\n let result = prevValues\n const nextValues = getNextSortedValues(prevValues, nextValue, atIndex)\n if (hasMinStepsBetweenValues(nextValues, props.minStepsBetweenThumbs * props.step)) {\n valueIndexToChange.current = nextValues.indexOf(nextValue)\n const hasChanged = String(nextValues) !== String(prevValues)\n if (hasChanged) userRequestedValues.value = nextValues\n result = hasChanged ? nextValues : prevValues\n }\n if (result !== prevValues) reportValues(result)\n }\n\n // A form reset reports the values of the first render again\n const initialValues = props.values\n const handleFormReset = () => {\n if (initialValues !== props.values) reportValues(initialValues)\n }\n watch(\n root,\n (element, _previous, onCleanup) => {\n const form = element?.closest(\"form\")\n if (!(form instanceof HTMLFormElement)) return\n form.addEventListener(\"reset\", handleFormReset)\n onCleanup(() => form.removeEventListener(\"reset\", handleFormReset))\n },\n { flush: \"post\" },\n )\n\n const getValueFromPointer = (event: PointerEvent) => {\n const element = root.value!\n const bounds = rect || element.getBoundingClientRect()\n rect = bounds\n if (isHorizontal()) {\n const value = linearScale([0, bounds.width], [props.min, props.max])\n return value(event.clientX - bounds.left)\n }\n const value = linearScale([0, bounds.height], [props.max, props.min])\n return value(event.clientY - bounds.top)\n }\n\n const handleKeyDown = (event: KeyboardEvent) => {\n if (event.key === \"Home\") {\n if (!props.disabled) {\n isKeyboardInteraction = true\n updateValues(props.min, 0)\n }\n event.preventDefault()\n } else if (event.key === \"End\") {\n if (!props.disabled) {\n isKeyboardInteraction = true\n updateValues(props.max, props.values.length - 1)\n }\n event.preventDefault()\n } else if (PAGE_KEYS.concat(ARROW_KEYS).includes(event.key)) {\n const slideDirection = isHorizontal() ? \"from-left\" : \"from-bottom\"\n const isBackKey = BACK_KEYS[slideDirection].includes(event.key)\n const stepDirection = isBackKey ? -1 : 1\n if (!props.disabled) {\n isKeyboardInteraction = true\n const isPageKey = PAGE_KEYS.includes(event.key)\n const isSkipKey = isPageKey || (event.shiftKey && ARROW_KEYS.includes(event.key))\n const multiplier = isSkipKey ? 10 : 1\n const atIndex = valueIndexToChange.current\n const value = props.values[atIndex]!\n const nextValue = getNextStepValue(value, {\n min: props.min,\n step: props.step,\n direction: stepDirection,\n multiplier,\n })\n updateValues(nextValue, atIndex)\n }\n event.preventDefault()\n }\n }\n\n const handlePointerDown = (event: PointerEvent) => {\n callHandlers(attrs.onPointerdown, event)\n if (event.defaultPrevented) return\n if (!props.disabled) isKeyboardInteraction = false\n const target = event.target as HTMLElement\n target.setPointerCapture(event.pointerId)\n event.preventDefault()\n if (thumbs.has(target)) {\n target.focus({ preventScroll: true, focusVisible: false } as FocusOptions)\n } else {\n const value = getValueFromPointer(event)\n if (!props.disabled) updateValues(value, getClosestValueIndex(props.values, value))\n }\n }\n\n const handlePointerMove = (event: PointerEvent) => {\n const target = event.target as HTMLElement\n if (target.hasPointerCapture(event.pointerId)) {\n const value = getValueFromPointer(event)\n if (!props.disabled) updateValues(value, valueIndexToChange.current)\n }\n }\n\n const handlePointerUp = (event: PointerEvent) => {\n callHandlers(attrs.onPointerup, event)\n if (event.defaultPrevented) return\n const target = event.target as HTMLElement\n if (target.hasPointerCapture(event.pointerId)) {\n target.releasePointerCapture(event.pointerId)\n rect = undefined\n }\n }\n\n return () => {\n const { class: className, style, onPointerdown: _down, onPointerup: _up, ...restAttrs } = attrs\n const horizontal = isHorizontal()\n\n return h(\n \"span\",\n {\n // Radix renders SliderHorizontal or SliderVertical: switching remounts the slider\n \"key\": props.orientation,\n \"ref\": setRoot,\n \"dir\": horizontal ? \"ltr\" : undefined,\n \"data-orientation\": props.orientation,\n \"aria-disabled\": props.disabled,\n \"data-disabled\": props.disabled ? \"\" : undefined,\n \"class\": className,\n ...restAttrs,\n \"style\": [\n style,\n { \"--radix-slider-thumb-transform\": horizontal ? \"translateX(-50%)\" : \"translateY(50%)\" },\n ],\n \"onKeydown\": handleKeyDown,\n \"onPointerdown\": handlePointerDown,\n \"onPointermove\": handlePointerMove,\n \"onPointerup\": handlePointerUp,\n },\n slots.default?.(),\n )\n }\n },\n})\n\n/** Radix `Slider.Track` */\nexport const SliderTrack = defineComponent({\n name: \"SliderTrack\",\n setup(_props, { slots }) {\n const context = useSliderContext()\n return () =>\n h(\n \"span\",\n {\n \"data-disabled\": context.disabled.value ? \"\" : undefined,\n \"data-orientation\": context.orientation.value,\n },\n slots.default?.(),\n )\n },\n})\n\n/** Radix `Slider.Range` */\nexport const SliderRange = defineComponent({\n name: \"SliderRange\",\n inheritAttrs: false,\n setup(_props, { attrs }) {\n const context = useSliderContext()\n return () => {\n const values = context.values.value\n const edges = context.edges.value\n const percentages = values.map((value) => convertValueToPercentage(value, context.min.value, context.max.value))\n const offsetStart = values.length > 1 ? Math.min(...percentages) : 0\n const offsetEnd = 100 - Math.max(...percentages)\n const { style, ...restAttrs } = attrs\n\n return h(\"span\", {\n \"data-orientation\": context.orientation.value,\n \"data-disabled\": context.disabled.value ? \"\" : undefined,\n ...restAttrs,\n \"style\": [style, { [edges.startEdge]: `${offsetStart}%`, [edges.endEdge]: `${offsetEnd}%` }],\n })\n }\n },\n})\n\n// Radix's SliderBubbleInput: a hidden input whose value follows the thumb's.\n// A change sets it through the native setter and dispatches a bubbling\n// `input` event. Form listeners see it when a pointer or a key asked for the\n// value; when only the parent's value changed, the event stops at the input.\nconst SliderBubbleInput = defineComponent({\n name: \"SliderBubbleInput\",\n props: {\n value: { type: Number, default: undefined },\n index: { type: Number, required: true },\n },\n setup(props) {\n const context = useSliderContext()\n const input = ref<HTMLInputElement | null>(null)\n let shouldStopInputPropagation = false\n let prevValue = props.value\n let handledUserRequestedValues = context.userRequestedValues.value\n let prevUserRequestedValues = context.userRequestedValues.value\n\n onMounted(() => {\n // React creates the input by setting its `value` property\n if (input.value && props.value !== undefined) input.value.value = String(props.value)\n })\n\n watch(\n [() => props.value, context.userRequestedValues],\n ([value, userRequestedValues]) => {\n const element = input.value\n if (!element) return\n const setValue = Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype, \"value\")?.set\n const previousValue = prevValue\n const valueChanged = previousValue !== value\n prevValue = value\n const isUserRequestFromThisRender = userRequestedValues !== prevUserRequestedValues\n prevUserRequestedValues = userRequestedValues\n if (valueChanged && setValue) {\n const hasUnhandledUserRequest = userRequestedValues !== handledUserRequestedValues\n handledUserRequestedValues = userRequestedValues\n const requestedValue = userRequestedValues?.[props.index]\n const isUserInteraction =\n hasUnhandledUserRequest &&\n ((isUserRequestFromThisRender && requestedValue !== previousValue) || requestedValue === value)\n shouldStopInputPropagation = !isUserInteraction\n setValue.call(element, value as unknown as string)\n element.dispatchEvent(new Event(\"input\", { bubbles: true }))\n shouldStopInputPropagation = false\n }\n },\n { flush: \"post\" },\n )\n\n return () =>\n h(\"input\", {\n \"ref\": input,\n \"style\": { display: \"none\" },\n // React's `defaultValue`, updated on every render\n \"^value\": props.value === undefined ? undefined : String(props.value),\n \"onInput\": (event: Event) => {\n if (shouldStopInputPropagation) event.stopPropagation()\n },\n })\n },\n})\n\n/**\n * Radix `Slider.Thumb`: a positioning `<span>` holding the thumb and, inside\n * a form, a hidden input next to it that reports value changes with an\n * `input` event.\n */\nexport const SliderThumb = defineComponent({\n name: \"SliderThumb\",\n inheritAttrs: false,\n props: {\n /** Receives the thumb element, like React's ref */\n elementRef: Function as PropType<(element: HTMLElement | null) => void>,\n },\n setup(props, { attrs }) {\n const context = useSliderContext()\n const thumb = ref<HTMLElement | null>(null)\n // Radix finds the index once the thumb has mounted; until then the thumb is hidden\n const index = ref(-1)\n const isFormControl = useIsFormControl(thumb, () => undefined)\n const size = useSize(() => thumb.value)\n const value = computed<number | undefined>(() => context.values.value[index.value])\n\n const setThumb = (element: unknown) => {\n thumb.value = (element as HTMLElement | null) ?? null\n props.elementRef?.(thumb.value)\n }\n\n let registered: HTMLElement | null = null\n onMounted(() => {\n const element = thumb.value\n if (!element) return\n registered = element\n context.thumbs.add(element)\n index.value = context.thumbIndex(element)\n })\n onBeforeUnmount(() => {\n if (registered) context.thumbs.delete(registered)\n })\n\n const handleFocus = () => {\n context.valueIndexToChange.current = index.value\n }\n\n return () => {\n const edges = context.edges.value\n const currentValue = value.value\n const percent =\n currentValue === undefined ? 0 : convertValueToPercentage(currentValue, context.min.value, context.max.value)\n const label = getLabel(index.value, context.values.value.length)\n const orientationSize = size.value?.[edges.size]\n const thumbInBoundsOffset = orientationSize\n ? getThumbInBoundsOffset(orientationSize, percent, edges.direction)\n : 0\n const { \"aria-label\": ariaLabel, style, ...thumbAttrs } = attrs\n const disabled = context.disabled.value\n\n return [\n h(\n \"span\",\n {\n style: {\n transform: \"var(--radix-slider-thumb-transform)\",\n position: \"absolute\",\n [edges.startEdge]: `calc(${percent}% + ${thumbInBoundsOffset}px)`,\n },\n },\n [\n h(\"span\", {\n \"role\": \"slider\",\n \"aria-label\": (ariaLabel as string | undefined) || label,\n \"aria-valuemin\": context.min.value,\n \"aria-valuenow\": currentValue,\n \"aria-valuemax\": context.max.value,\n \"aria-orientation\": context.orientation.value,\n \"data-orientation\": context.orientation.value,\n \"data-disabled\": disabled ? \"\" : undefined,\n \"tabindex\": disabled ? undefined : 0,\n ...thumbAttrs,\n \"ref\": setThumb,\n \"style\": currentValue === undefined ? { display: \"none\" } : style,\n \"onFocus\": handleFocus,\n }),\n ],\n ),\n // Keyed by the index like Radix's, so the input remounts once the\n // index is known (and never reports the initial value)\n isFormControl.value\n ? h(SliderBubbleInput, { key: index.value, value: currentValue, index: index.value })\n : null,\n ]\n }\n },\n})\n"]}
|
|
1
|
+
{"version":3,"file":"sliderPrimitive.js","sourceRoot":"","sources":["../../../../src/components/Slider/sliderPrimitive.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ACL,SAAS,EAAE,qCAAqC;wBAChD,QAAQ,EAAE,UAAU;wBACpB,CAAC,KAAK,CAAC,SAAS,CAAC,EAAE,QAAQ,OAAO,OAAO,mBAAmB,KAAK;qBAClE;iBACF,EACD;oBACE,CAAC,CAAC,MAAM,EAAE;wBACR,MAAM,EAAE,QAAQ;wBAChB,YAAY,EAAG,SAAgC,IAAI,KAAK;wBACxD,eAAe,EAAE,OAAO,CAAC,GAAG,CAAC,KAAK;wBAClC,eAAe,EAAE,YAAY;wBAC7B,eAAe,EAAE,OAAO,CAAC,GAAG,CAAC,KAAK;wBAClC,kBAAkB,EAAE,OAAO,CAAC,WAAW,CAAC,KAAK;wBAC7C,kBAAkB,EAAE,OAAO,CAAC,WAAW,CAAC,KAAK;wBAC7C,eAAe,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS;wBAC1C,UAAU,EAAE,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;wBACpC,GAAG,UAAU;wBACb,KAAK,EAAE,QAAQ;wBACf,OAAO,EAAE,YAAY,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,KAAK;wBACjE,SAAS,EAAE,WAAW;qBACvB,CAAC;iBACH,CACF;gBACD,kEAAkE;gBAClE,uDAAuD;gBACvD,aAAa,CAAC,KAAK;oBACjB,CAAC,CAAC,CAAC,CAAC,iBAAiB,EAAE,EAAE,GAAG,EAAE,KAAK,CAAC,KAAK,EAAE,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,CAAC;oBACrF,CAAC,CAAC,IAAI;aACT,CAAA;QACH,CAAC,CAAA;IACH,CAAC;CACF,CAAC,CAAA","sourcesContent":["import {\n computed,\n defineComponent,\n h,\n inject,\n onBeforeUnmount,\n onMounted,\n provide,\n ref,\n shallowRef,\n watch,\n type ComputedRef,\n type InjectionKey,\n type PropType,\n type Ref,\n} from \"vue\"\nimport { useIsFormControl, useSize } from \"../Checkbox/bubbleInput.js\"\n\n// Internal: Radix Slider (Root, Track, Range, Thumb) as Plex's Slider uses\n// it, rendered the Radix way (@radix-ui/react-slider 1.6, from radix-ui\n// 1.8). Reka's Slider renders different markup (no positioning wrapper\n// around the thumb, `data-slider-impl`, `--reka-slider-thumb-transform`, its\n// own hidden input), runs its handlers before the caller's and has no\n// counterpart for Radix's thumb focus order, so the Radix primitive is ported\n// here. Plex always controls the value (`values` + `onValueChange`), so\n// Radix's uncontrolled state, `onValueCommit`, `name`, `form`, `dir`,\n// `inverted` and `preserveThumbOrder` (unused by Plex) are left out.\n\ntype SliderOrientation = \"horizontal\" | \"vertical\"\n\ntype OrientationContext = {\n startEdge: \"left\" | \"bottom\"\n endEdge: \"right\" | \"top\"\n size: \"width\" | \"height\"\n direction: 1\n}\n\ntype SliderContextValue = {\n values: ComputedRef<number[]>\n min: ComputedRef<number>\n max: ComputedRef<number>\n disabled: ComputedRef<boolean>\n orientation: ComputedRef<SliderOrientation>\n edges: ComputedRef<OrientationContext>\n valueIndexToChange: { current: number }\n /** The values the last pointer or key change asked for (tells the hidden inputs a user change from a parent's) */\n userRequestedValues: Ref<number[] | null>\n /** Thumb elements in mount order (Radix keeps them in a Set) */\n thumbs: Set<HTMLElement>\n /** Index of a thumb among the slider's thumbs, in DOM order (Radix's collection) */\n thumbIndex: (thumb: HTMLElement) => number\n}\n\nconst SliderContextKey: InjectionKey<SliderContextValue> = Symbol(\"PlexUISliderPrimitive\")\n\nconst useSliderContext = () => inject(SliderContextKey)!\n\nconst PAGE_KEYS = [\"PageUp\", \"PageDown\"]\nconst ARROW_KEYS = [\"ArrowUp\", \"ArrowDown\", \"ArrowLeft\", \"ArrowRight\"]\nconst BACK_KEYS: Record<\"from-left\" | \"from-bottom\", string[]> = {\n \"from-left\": [\"Home\", \"PageDown\", \"ArrowDown\", \"ArrowLeft\"],\n \"from-bottom\": [\"Home\", \"PageDown\", \"ArrowDown\", \"ArrowLeft\"],\n}\n\n// Radix's left-to-right horizontal and bottom-to-top vertical slider (Plex\n// passes neither `dir` nor `inverted`)\nconst HORIZONTAL: OrientationContext = { startEdge: \"left\", endEdge: \"right\", size: \"width\", direction: 1 }\nconst VERTICAL: OrientationContext = { startEdge: \"bottom\", endEdge: \"top\", size: \"height\", direction: 1 }\n\nconst clampNumber = (value: number, [min, max]: [number, number]) => Math.min(max, Math.max(min, value))\n\nconst getNextSortedValues = (prevValues: number[] = [], nextValue: number, atIndex: number) => {\n const nextValues = [...prevValues]\n nextValues[atIndex] = nextValue\n return nextValues.sort((a, b) => a - b)\n}\n\nconst convertValueToPercentage = (value: number, min: number, max: number) => {\n const maxSteps = max - min\n const percentPerStep = 100 / maxSteps\n const percentage = percentPerStep * (value - min)\n return clampNumber(percentage, [0, 100])\n}\n\nconst getLabel = (index: number, totalValues: number) => {\n if (totalValues > 2) {\n return `Value ${index + 1} of ${totalValues}`\n } else if (totalValues === 2) {\n return [\"Minimum\", \"Maximum\"][index]\n } else {\n return undefined\n }\n}\n\nconst getClosestValueIndex = (values: number[], nextValue: number) => {\n if (values.length === 1) return 0\n const distances = values.map((value) => Math.abs(value - nextValue))\n const closestDistance = Math.min(...distances)\n return distances.indexOf(closestDistance)\n}\n\nconst linearScale = (input: readonly [number, number], output: readonly [number, number]) => (value: number) => {\n if (input[0] === input[1] || output[0] === output[1]) return output[0]\n const ratio = (output[1] - output[0]) / (input[1] - input[0])\n return output[0] + ratio * (value - input[0])\n}\n\nconst getThumbInBoundsOffset = (width: number, left: number, direction: number) => {\n const halfWidth = width / 2\n const halfPercent = 50\n const offset = linearScale([0, halfPercent], [0, halfWidth])\n return (halfWidth - offset(left) * direction) * direction\n}\n\nconst getStepsBetweenValues = (values: number[]) => values.slice(0, -1).map((value, index) => values[index + 1]! - value)\n\nconst hasMinStepsBetweenValues = (values: number[], minStepsBetweenValues: number) => {\n if (minStepsBetweenValues > 0) {\n const stepsBetweenValues = getStepsBetweenValues(values)\n const actualMinStepsBetweenValues = Math.min(...stepsBetweenValues)\n return actualMinStepsBetweenValues >= minStepsBetweenValues\n }\n return true\n}\n\nconst getDecimalCount = (value: number) => {\n if (!Number.isFinite(value)) return 0\n const str = value.toString()\n if (str.includes(\"e\")) {\n const [coefficient, exponent] = str.split(\"e\")\n const decimalPart = coefficient!.split(\".\")[1] || \"\"\n return Math.max(0, decimalPart.length - Number(exponent))\n }\n return (str.split(\".\")[1] || \"\").length\n}\n\nconst roundValue = (value: number, decimalCount: number) => {\n const rounder = Math.pow(10, decimalCount)\n return Math.round(value * rounder) / rounder\n}\n\n// A key step from a value off the step grid lands on the grid's next value first\nconst getNextStepValue = (\n value: number,\n { min, step, direction, multiplier }: { min: number; step: number; direction: number; multiplier: number },\n) => {\n const decimalCount = getDecimalCount(step)\n const stepsFromMin = (value - min) / step\n const nearestSteps = Math.round(stepsFromMin)\n const isAligned = roundValue(nearestSteps * step + min, decimalCount) === roundValue(value, decimalCount)\n let nextSteps\n if (isAligned) {\n nextSteps = nearestSteps + multiplier * direction\n } else if (direction > 0) {\n nextSteps = Math.ceil(stepsFromMin)\n } else {\n nextSteps = Math.floor(stepsFromMin)\n }\n return roundValue(nextSteps * step + min, decimalCount)\n}\n\nconst callHandlers = (handlers: unknown, event: Event) => {\n for (const handler of Array.isArray(handlers) ? handlers : [handlers]) {\n if (typeof handler === \"function\") handler(event)\n }\n}\n\n/**\n * Radix `Slider.Root`. `class`, `style` and the caller's `onPointerdown`,\n * `onPointerup` (run before Radix's, which they can cancel), `onFocusin` and\n * `onFocusout` land on the root `<span>`.\n */\nexport const SliderRoot = defineComponent({\n name: \"SliderRoot\",\n inheritAttrs: false,\n props: {\n values: { type: Array as PropType<number[]>, required: true },\n min: { type: Number, required: true },\n max: { type: Number, required: true },\n step: { type: Number, required: true },\n disabled: { type: Boolean, default: false },\n orientation: { type: String as PropType<SliderOrientation>, default: \"horizontal\" },\n minStepsBetweenThumbs: { type: Number, default: 0 },\n onValueChange: Function as PropType<(values: number[]) => void>,\n /** Receives the root element, like React's forwarded ref */\n elementRef: Function as PropType<(element: HTMLElement | null) => void>,\n },\n setup(props, { attrs, slots }) {\n const root = ref<HTMLElement | null>(null)\n const thumbs = new Set<HTMLElement>()\n const valueIndexToChange = { current: 0 }\n const userRequestedValues = shallowRef<number[] | null>(null)\n // A key change shows the focus ring on the thumb it focuses; a pointer does not\n let isKeyboardInteraction = false\n let rect: DOMRect | undefined\n\n const isHorizontal = () => props.orientation === \"horizontal\"\n\n const thumbsInOrder = () => Array.from(root.value?.querySelectorAll<HTMLElement>('[role=\"slider\"]') ?? [])\n\n const setRoot = (element: unknown) => {\n root.value = (element as HTMLElement | null) ?? null\n props.elementRef?.(root.value)\n }\n\n provide(SliderContextKey, {\n values: computed(() => props.values),\n min: computed(() => props.min),\n max: computed(() => props.max),\n disabled: computed(() => props.disabled),\n orientation: computed(() => props.orientation),\n edges: computed(() => (isHorizontal() ? HORIZONTAL : VERTICAL)),\n valueIndexToChange,\n userRequestedValues,\n thumbs,\n thumbIndex: (thumb) => thumbsInOrder().indexOf(thumb),\n })\n\n // Radix's controlled useControllableState: a new array is reported,\n // focusing the thumb that changed first\n const reportValues = (values: number[]) => {\n // In the order of the page, not of the set: Vue mounts new keyed thumbs from the last (a slider turning into a\n // range), so the set may hold them backwards\n const thumbList = thumbsInOrder()\n thumbList[valueIndexToChange.current]?.focus({\n preventScroll: true,\n focusVisible: isKeyboardInteraction,\n } as FocusOptions)\n isKeyboardInteraction = false\n props.onValueChange?.(values)\n }\n\n // The updater runs against the current prop, and only a changed array is reported\n const updateValues = (value: number, atIndex: number) => {\n const decimalCount = getDecimalCount(props.step)\n const snapToStep = roundValue(Math.round((value - props.min) / props.step) * props.step + props.min, decimalCount)\n const nextValue = clampNumber(snapToStep, [props.min, props.max])\n const prevValues = props.values\n let result = prevValues\n const nextValues = getNextSortedValues(prevValues, nextValue, atIndex)\n if (hasMinStepsBetweenValues(nextValues, props.minStepsBetweenThumbs * props.step)) {\n valueIndexToChange.current = nextValues.indexOf(nextValue)\n const hasChanged = String(nextValues) !== String(prevValues)\n if (hasChanged) userRequestedValues.value = nextValues\n result = hasChanged ? nextValues : prevValues\n }\n if (result !== prevValues) reportValues(result)\n }\n\n // A form reset reports the values of the first render again\n const initialValues = props.values\n const handleFormReset = () => {\n if (initialValues !== props.values) reportValues(initialValues)\n }\n watch(\n root,\n (element, _previous, onCleanup) => {\n const form = element?.closest(\"form\")\n if (!(form instanceof HTMLFormElement)) return\n form.addEventListener(\"reset\", handleFormReset)\n onCleanup(() => form.removeEventListener(\"reset\", handleFormReset))\n },\n { flush: \"post\" },\n )\n\n const getValueFromPointer = (event: PointerEvent) => {\n const element = root.value!\n const bounds = rect || element.getBoundingClientRect()\n rect = bounds\n if (isHorizontal()) {\n const value = linearScale([0, bounds.width], [props.min, props.max])\n return value(event.clientX - bounds.left)\n }\n const value = linearScale([0, bounds.height], [props.max, props.min])\n return value(event.clientY - bounds.top)\n }\n\n const handleKeyDown = (event: KeyboardEvent) => {\n if (event.key === \"Home\") {\n if (!props.disabled) {\n isKeyboardInteraction = true\n updateValues(props.min, 0)\n }\n event.preventDefault()\n } else if (event.key === \"End\") {\n if (!props.disabled) {\n isKeyboardInteraction = true\n updateValues(props.max, props.values.length - 1)\n }\n event.preventDefault()\n } else if (PAGE_KEYS.concat(ARROW_KEYS).includes(event.key)) {\n const slideDirection = isHorizontal() ? \"from-left\" : \"from-bottom\"\n const isBackKey = BACK_KEYS[slideDirection].includes(event.key)\n const stepDirection = isBackKey ? -1 : 1\n if (!props.disabled) {\n isKeyboardInteraction = true\n const isPageKey = PAGE_KEYS.includes(event.key)\n const isSkipKey = isPageKey || (event.shiftKey && ARROW_KEYS.includes(event.key))\n const multiplier = isSkipKey ? 10 : 1\n const atIndex = valueIndexToChange.current\n const value = props.values[atIndex]!\n const nextValue = getNextStepValue(value, {\n min: props.min,\n step: props.step,\n direction: stepDirection,\n multiplier,\n })\n updateValues(nextValue, atIndex)\n }\n event.preventDefault()\n }\n }\n\n const handlePointerDown = (event: PointerEvent) => {\n callHandlers(attrs.onPointerdown, event)\n if (event.defaultPrevented) return\n if (!props.disabled) isKeyboardInteraction = false\n const target = event.target as HTMLElement\n target.setPointerCapture(event.pointerId)\n event.preventDefault()\n if (thumbs.has(target)) {\n target.focus({ preventScroll: true, focusVisible: false } as FocusOptions)\n } else {\n const value = getValueFromPointer(event)\n if (!props.disabled) updateValues(value, getClosestValueIndex(props.values, value))\n }\n }\n\n const handlePointerMove = (event: PointerEvent) => {\n const target = event.target as HTMLElement\n if (target.hasPointerCapture(event.pointerId)) {\n const value = getValueFromPointer(event)\n if (!props.disabled) updateValues(value, valueIndexToChange.current)\n }\n }\n\n const handlePointerUp = (event: PointerEvent) => {\n callHandlers(attrs.onPointerup, event)\n if (event.defaultPrevented) return\n const target = event.target as HTMLElement\n if (target.hasPointerCapture(event.pointerId)) {\n target.releasePointerCapture(event.pointerId)\n rect = undefined\n }\n }\n\n return () => {\n const { class: className, style, onPointerdown: _down, onPointerup: _up, ...restAttrs } = attrs\n const horizontal = isHorizontal()\n\n return h(\n \"span\",\n {\n // Radix renders SliderHorizontal or SliderVertical: switching remounts the slider\n \"key\": props.orientation,\n \"ref\": setRoot,\n \"dir\": horizontal ? \"ltr\" : undefined,\n \"data-orientation\": props.orientation,\n \"aria-disabled\": props.disabled,\n \"data-disabled\": props.disabled ? \"\" : undefined,\n \"class\": className,\n ...restAttrs,\n \"style\": [\n style,\n { \"--radix-slider-thumb-transform\": horizontal ? \"translateX(-50%)\" : \"translateY(50%)\" },\n ],\n \"onKeydown\": handleKeyDown,\n \"onPointerdown\": handlePointerDown,\n \"onPointermove\": handlePointerMove,\n \"onPointerup\": handlePointerUp,\n },\n slots.default?.(),\n )\n }\n },\n})\n\n/** Radix `Slider.Track` */\nexport const SliderTrack = defineComponent({\n name: \"SliderTrack\",\n setup(_props, { slots }) {\n const context = useSliderContext()\n return () =>\n h(\n \"span\",\n {\n \"data-disabled\": context.disabled.value ? \"\" : undefined,\n \"data-orientation\": context.orientation.value,\n },\n slots.default?.(),\n )\n },\n})\n\n/** Radix `Slider.Range` */\nexport const SliderRange = defineComponent({\n name: \"SliderRange\",\n inheritAttrs: false,\n setup(_props, { attrs }) {\n const context = useSliderContext()\n return () => {\n const values = context.values.value\n const edges = context.edges.value\n const percentages = values.map((value) => convertValueToPercentage(value, context.min.value, context.max.value))\n const offsetStart = values.length > 1 ? Math.min(...percentages) : 0\n const offsetEnd = 100 - Math.max(...percentages)\n const { style, ...restAttrs } = attrs\n\n return h(\"span\", {\n \"data-orientation\": context.orientation.value,\n \"data-disabled\": context.disabled.value ? \"\" : undefined,\n ...restAttrs,\n \"style\": [style, { [edges.startEdge]: `${offsetStart}%`, [edges.endEdge]: `${offsetEnd}%` }],\n })\n }\n },\n})\n\n// Radix's SliderBubbleInput: a hidden input whose value follows the thumb's.\n// A change sets it through the native setter and dispatches a bubbling\n// `input` event. Form listeners see it when a pointer or a key asked for the\n// value; when only the parent's value changed, the event stops at the input.\nconst SliderBubbleInput = defineComponent({\n name: \"SliderBubbleInput\",\n props: {\n value: { type: Number, default: undefined },\n index: { type: Number, required: true },\n },\n setup(props) {\n const context = useSliderContext()\n const input = ref<HTMLInputElement | null>(null)\n let shouldStopInputPropagation = false\n let prevValue = props.value\n let handledUserRequestedValues = context.userRequestedValues.value\n let prevUserRequestedValues = context.userRequestedValues.value\n\n onMounted(() => {\n // React creates the input by setting its `value` property\n if (input.value && props.value !== undefined) input.value.value = String(props.value)\n })\n\n watch(\n [() => props.value, context.userRequestedValues],\n ([value, userRequestedValues]) => {\n const element = input.value\n if (!element) return\n const setValue = Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype, \"value\")?.set\n const previousValue = prevValue\n const valueChanged = previousValue !== value\n prevValue = value\n const isUserRequestFromThisRender = userRequestedValues !== prevUserRequestedValues\n prevUserRequestedValues = userRequestedValues\n if (valueChanged && setValue) {\n const hasUnhandledUserRequest = userRequestedValues !== handledUserRequestedValues\n handledUserRequestedValues = userRequestedValues\n const requestedValue = userRequestedValues?.[props.index]\n const isUserInteraction =\n hasUnhandledUserRequest &&\n ((isUserRequestFromThisRender && requestedValue !== previousValue) || requestedValue === value)\n shouldStopInputPropagation = !isUserInteraction\n setValue.call(element, value as unknown as string)\n element.dispatchEvent(new Event(\"input\", { bubbles: true }))\n shouldStopInputPropagation = false\n }\n },\n { flush: \"post\" },\n )\n\n return () =>\n h(\"input\", {\n \"ref\": input,\n \"style\": { display: \"none\" },\n // React's `defaultValue`, updated on every render\n \"^value\": props.value === undefined ? undefined : String(props.value),\n \"onInput\": (event: Event) => {\n if (shouldStopInputPropagation) event.stopPropagation()\n },\n })\n },\n})\n\n/**\n * Radix `Slider.Thumb`: a positioning `<span>` holding the thumb and, inside\n * a form, a hidden input next to it that reports value changes with an\n * `input` event.\n */\nexport const SliderThumb = defineComponent({\n name: \"SliderThumb\",\n inheritAttrs: false,\n props: {\n /** Receives the thumb element, like React's ref */\n elementRef: Function as PropType<(element: HTMLElement | null) => void>,\n },\n setup(props, { attrs }) {\n const context = useSliderContext()\n const thumb = ref<HTMLElement | null>(null)\n // Radix finds the index once the thumb has mounted; until then the thumb is hidden\n const index = ref(-1)\n const isFormControl = useIsFormControl(thumb, () => undefined)\n const size = useSize(() => thumb.value)\n const value = computed<number | undefined>(() => context.values.value[index.value])\n\n const setThumb = (element: unknown) => {\n thumb.value = (element as HTMLElement | null) ?? null\n props.elementRef?.(thumb.value)\n }\n\n let registered: HTMLElement | null = null\n onMounted(() => {\n const element = thumb.value\n if (!element) return\n registered = element\n context.thumbs.add(element)\n index.value = context.thumbIndex(element)\n })\n onBeforeUnmount(() => {\n if (registered) context.thumbs.delete(registered)\n })\n\n const handleFocus = () => {\n context.valueIndexToChange.current = index.value\n }\n\n return () => {\n const edges = context.edges.value\n const currentValue = value.value\n const percent =\n currentValue === undefined ? 0 : convertValueToPercentage(currentValue, context.min.value, context.max.value)\n const label = getLabel(index.value, context.values.value.length)\n const orientationSize = size.value?.[edges.size]\n const thumbInBoundsOffset = orientationSize\n ? getThumbInBoundsOffset(orientationSize, percent, edges.direction)\n : 0\n const { \"aria-label\": ariaLabel, style, ...thumbAttrs } = attrs\n const disabled = context.disabled.value\n\n return [\n h(\n \"span\",\n {\n style: {\n transform: \"var(--radix-slider-thumb-transform)\",\n position: \"absolute\",\n [edges.startEdge]: `calc(${percent}% + ${thumbInBoundsOffset}px)`,\n },\n },\n [\n h(\"span\", {\n \"role\": \"slider\",\n \"aria-label\": (ariaLabel as string | undefined) || label,\n \"aria-valuemin\": context.min.value,\n \"aria-valuenow\": currentValue,\n \"aria-valuemax\": context.max.value,\n \"aria-orientation\": context.orientation.value,\n \"data-orientation\": context.orientation.value,\n \"data-disabled\": disabled ? \"\" : undefined,\n \"tabindex\": disabled ? undefined : 0,\n ...thumbAttrs,\n \"ref\": setThumb,\n \"style\": currentValue === undefined ? { display: \"none\" } : style,\n \"onFocus\": handleFocus,\n }),\n ],\n ),\n // Keyed by the index like Radix's, so the input remounts once the\n // index is known (and never reports the initial value)\n isFormControl.value\n ? h(SliderBubbleInput, { key: index.value, value: currentValue, index: index.value })\n : null,\n ]\n }\n },\n})\n"]}
|
|
@@ -104,7 +104,7 @@ const SortableHandleComponent = defineComponent({
|
|
|
104
104
|
"class": clsx(s.Handle, className),
|
|
105
105
|
"data-sortable-handle": "",
|
|
106
106
|
"aria-label": props.ariaLabel,
|
|
107
|
-
}, (slots.default ? slots.default() : [h(GripVertical, { class: s.DesktopGrip, "aria-hidden": true }), h(Hamburger, { class: s.PhoneGrip, "aria-hidden": true })]));
|
|
107
|
+
}, (slots.default ? slots.default() : [h(GripVertical, { class: s.DesktopGrip, "aria-hidden": true }), h(Hamburger, { class: s.PhoneGrip, "aria-hidden": true, "preserveAspectRatio": "none" })]));
|
|
108
108
|
};
|
|
109
109
|
},
|
|
110
110
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Sortable.js","sourceRoot":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O,EAAE,IAAI,CAAC,CAAC,CAAC,MAAM,EAAE,SAAuB,CAAC;gBAChD,sBAAsB,EAAE,KAAK,CAAC,KAAK;gBACnC,WAAW,EAAE,KAAK,CAAC,IAAI;aACxB,EACD,SAAS,CAAC,CAAC,CAAE,KAAK,CAAC,OAAO,EAAE,EAAyB,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,OAAO,EAAE,EAAE,EAAE,CAC7F,CAAA;QACH,CAAC,CAAA;IACH,CAAC;CACF,CAAC,CAAA;AAEF,6HAA6H;AAC7H,MAAM,CAAC,MAAM,QAAQ,GAAG,iBAAiB,CAAA;AACzC,gFAAgF;AAChF,MAAM,CAAC,MAAM,cAAc,GAAG,uBAAuB,CAAA;AACrD,+FAA+F;AAC/F,MAAM,CAAC,MAAM,cAAc,GAAG,uBAAuB,CAAA","sourcesContent":["import clsx, { type ClassValue } from \"clsx\"\nimport {\n defineComponent,\n h,\n mergeProps,\n nextTick,\n onBeforeUnmount,\n watch,\n type Component,\n type PropType,\n type SlotsType,\n type VNodeArrayChildren,\n type VNodeChild,\n} from \"vue\"\nimport { moveItem, sortableKeyDown, sortablePointerDown, type SortableLayout, type SortableMove } from \"../../lib/sortable.js\"\nimport { GripVertical, Hamburger } from \"../Icon/index.js\"\nimport s from \"@plexui/styles/components/Sortable/Sortable.module.css\"\n\n// Vue port of packages/ui/src/components/Sortable/Sortable.tsx.\n//\n// - `value` binds with `v-model:value`; `change` fires with it.\n// - React's `Sortable.Handle` and `Sortable.Target` are the flat `SortableHandle` and `SortableTarget` here.\n// - Attributes reach the rendered element, as React's rest props do.\n\nconst preventNativeDrag = (event: Event) => event.preventDefault()\n\nconst SortableComponent = defineComponent({\n name: \"Sortable\",\n inheritAttrs: false,\n props: {\n /** The list, in the order of the children. Bind with `v-model:value`. */\n value: { type: Array as PropType<readonly unknown[]>, required: true },\n /** `list` for rows one under another, `grid` for items that stand side by side. @default \"list\" */\n layout: { type: String as PropType<SortableLayout>, default: \"list\" },\n /** Element to render, such as `TableBody` for table rows. @default \"div\" */\n as: { type: [String, Object] as PropType<string | Component>, default: \"div\" },\n /** Turns dragging off. @default false */\n disabled: { type: Boolean, default: false },\n /** Shows the grips of `SortableHandle`. A hidden grip still takes the keyboard, and the item drags from anywhere but a control. @default true in a table, otherwise false */\n handles: { type: Boolean, default: undefined },\n /** Lists of one group trade items, and a `SortableTarget` of that group takes them. Give each list a `name`. */\n group: { type: String, default: undefined },\n /** Names the list in `move`. */\n name: { type: String, default: undefined },\n },\n emits: {\n \"update:value\": (value: unknown[]) => Array.isArray(value),\n \"change\": (value: unknown[]) => Array.isArray(value),\n /** An item moved, inside this list or out of it. Out of it the app updates both lists: `update:value` is for a move inside one. */\n \"move\": (move: SortableMove) => typeof move === \"object\" && move !== null,\n /** A drag rests on a `SortableTarget` of the group: open what it stands for or go there. */\n \"hold\": (name: string) => typeof name === \"string\",\n },\n slots: Object as SlotsType<{\n /** The items, one direct child per entry of `value`, keyed by the entry and not by its index */\n default?: () => VNodeChild\n }>,\n setup(props, { attrs, emit, slots }) {\n let cancelDrag: ReturnType<typeof sortablePointerDown>\n onBeforeUnmount(() => cancelDrag?.())\n watch(() => props.disabled, (disabled) => {\n if (disabled) {\n cancelDrag?.()\n cancelDrag = undefined\n }\n }, { flush: \"sync\" })\n const commit = async (from: number, to: number) => {\n const next = moveItem(props.value, from, to)\n emit(\"update:value\", next)\n emit(\"change\", next)\n emit(\"move\", { item: props.value[from], from: props.name as string, fromIndex: from, to: props.name as string, toIndex: to })\n await nextTick()\n }\n\n const link = {\n move: async (fromIndex: number, to: string, toIndex?: number) => {\n emit(\"move\", { item: props.value[fromIndex], from: props.name as string, fromIndex, to, toIndex })\n await nextTick()\n },\n hold: (name: string) => emit(\"hold\", name),\n }\n\n const onPointerdown = (event: PointerEvent) => {\n if (!props.disabled && !event.defaultPrevented) {\n cancelDrag = sortablePointerDown(event, event.currentTarget as HTMLElement, props.layout, commit, link) ?? cancelDrag\n }\n }\n\n const onKeydown = (event: KeyboardEvent) => {\n if (!props.disabled && !event.defaultPrevented) void sortableKeyDown(event, event.currentTarget as HTMLElement, commit, link)\n }\n\n return () => {\n const { class: className, ...rest } = attrs\n const isElement = typeof props.as === \"string\"\n return h(\n props.as as string,\n mergeProps(rest, {\n \"class\": clsx(s.Sortable, className as ClassValue),\n \"data-sortable\": \"\",\n \"data-layout\": props.layout,\n \"data-disabled\": props.disabled ? \"\" : undefined,\n \"data-handles\": props.handles?.toString(),\n \"data-group\": props.group,\n \"data-name\": props.name,\n onPointerdown,\n onKeydown,\n \"onDragstart\": preventNativeDrag,\n }),\n isElement ? (slots.default?.() as VNodeArrayChildren) : { default: () => slots.default?.() },\n )\n }\n },\n})\n\nconst SortableHandleComponent = defineComponent({\n name: \"SortableHandle\",\n inheritAttrs: false,\n props: {\n /** Name of the handle for assistive technology. @default \"Reorder\" */\n ariaLabel: { type: String, default: \"Reorder\" },\n },\n slots: Object as SlotsType<{\n /** The grip */\n default?: () => VNodeChild\n }>,\n setup(props, { attrs, slots }) {\n return () => {\n const { class: className, ...rest } = attrs\n return h(\n \"button\",\n {\n ...rest,\n \"type\": \"button\",\n \"class\": clsx(s.Handle, className as ClassValue),\n \"data-sortable-handle\": \"\",\n \"aria-label\": props.ariaLabel,\n },\n (slots.default ? slots.default() : [h(GripVertical, { class: s.DesktopGrip, \"aria-hidden\": true }), h(Hamburger, { class: s.PhoneGrip, \"aria-hidden\": true })]) as VNodeArrayChildren,\n )\n }\n },\n})\n\nconst SortableTargetComponent = defineComponent({\n name: \"SortableTarget\",\n inheritAttrs: false,\n props: {\n /** The `group` of the lists whose items it takes */\n group: { type: String, required: true },\n /** Names the target in `move` and `hold` on the list */\n name: { type: String, required: true },\n /** Element to render. @default \"div\" */\n as: { type: [String, Object] as PropType<string | Component>, default: \"div\" },\n },\n slots: Object as SlotsType<{\n /** What the target shows */\n default?: () => VNodeChild\n }>,\n setup(props, { attrs, slots }) {\n return () => {\n const { class: className, ...rest } = attrs\n const isElement = typeof props.as === \"string\"\n return h(\n props.as as string,\n {\n ...rest,\n \"class\": clsx(s.Target, className as ClassValue),\n \"data-sortable-target\": props.group,\n \"data-name\": props.name,\n },\n isElement ? (slots.default?.() as VNodeArrayChildren) : { default: () => slots.default?.() },\n )\n }\n },\n})\n\n/** Reorders its direct children by dragging, from anywhere but a control, or by a `SortableHandle` where grips are shown. */\nexport const Sortable = SortableComponent\n/** The grip of an item. Arrow keys move the item while the handle has focus. */\nexport const SortableHandle = SortableHandleComponent\n/** A place outside the lists that takes an item whole: a folder, a category in a side list. */\nexport const SortableTarget = SortableTargetComponent\nexport type { SortableLayout, SortableMove }\n"]}
|
|
1
|
+
{"version":3,"file":"Sortable.js","sourceRoot":"","sources":["../../../../src/components/Sortable/Sortable.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,EAAE,EAAmB,MAAM,MAAM,CAAA;AAC5C,OAAO,EACL,eAAe,EACf,CAAC,EACD,UAAU,EACV,QAAQ,EACR,eAAe,EACf,KAAK,GAMN,MAAM,KAAK,CAAA;AACZ,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,mBAAmB,EAA0C,MAAM,uBAAuB,CAAA;AAC9H,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAC1D,OAAO,CAAC,MAAM,wDAAwD,CAAA;AAEtE,gEAAgE;AAChE,EAAE;AACF,gEAAgE;AAChE,6GAA6G;AAC7G,qEAAqE;AAErE,MAAM,iBAAiB,GAAG,CAAC,KAAY,EAAE,EAAE,CAAC,KAAK,CAAC,cAAc,EAAE,CAAA;AAElE,MAAM,iBAAiB,GAAG,eAAe,CAAC;IACxC,IAAI,EAAE,UAAU;IAChB,YAAY,EAAE,KAAK;IACnB,KAAK,EAAE;QACL,yEAAyE;QACzE,KAAK,EAAE,EAAE,IAAI,EAAE,KAAqC,EAAE,QAAQ,EAAE,IAAI,EAAE;QACtE,mGAAmG;QACnG,MAAM,EAAE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AI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE;QACtC,wCAAwC;QACxC,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,CAAiC,EAAE,OAAO,EAAE,KAAK,EAAE;KAC/E;IACD,KAAK,EAAE,MAGL;IACF,KAAK,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE;QAC3B,OAAO,GAAG,EAAE;YACV,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,GAAG,KAAK,CAAA;YAC3C,MAAM,SAAS,GAAG,OAAO,KAAK,CAAC,EAAE,KAAK,QAAQ,CAAA;YAC9C,OAAO,CAAC,CACN,KAAK,CAAC,EAAY,EAClB;gBACE,GAAG,IAAI;gBACP,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC,MAAM,EAAE,SAAuB,CAAC;gBAChD,sBAAsB,EAAE,KAAK,CAAC,KAAK;gBACnC,WAAW,EAAE,KAAK,CAAC,IAAI;aACxB,EACD,SAAS,CAAC,CAAC,CAAE,KAAK,CAAC,OAAO,EAAE,EAAyB,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,OAAO,EAAE,EAAE,EAAE,CAC7F,CAAA;QACH,CAAC,CAAA;IACH,CAAC;CACF,CAAC,CAAA;AAEF,6HAA6H;AAC7H,MAAM,CAAC,MAAM,QAAQ,GAAG,iBAAiB,CAAA;AACzC,gFAAgF;AAChF,MAAM,CAAC,MAAM,cAAc,GAAG,uBAAuB,CAAA;AACrD,+FAA+F;AAC/F,MAAM,CAAC,MAAM,cAAc,GAAG,uBAAuB,CAAA","sourcesContent":["import clsx, { type ClassValue } from \"clsx\"\nimport {\n defineComponent,\n h,\n mergeProps,\n nextTick,\n onBeforeUnmount,\n watch,\n type Component,\n type PropType,\n type SlotsType,\n type VNodeArrayChildren,\n type VNodeChild,\n} from \"vue\"\nimport { moveItem, sortableKeyDown, sortablePointerDown, type SortableLayout, type SortableMove } from \"../../lib/sortable.js\"\nimport { GripVertical, Hamburger } from \"../Icon/index.js\"\nimport s from \"@plexui/styles/components/Sortable/Sortable.module.css\"\n\n// Vue port of packages/ui/src/components/Sortable/Sortable.tsx.\n//\n// - `value` binds with `v-model:value`; `change` fires with it.\n// - React's `Sortable.Handle` and `Sortable.Target` are the flat `SortableHandle` and `SortableTarget` here.\n// - Attributes reach the rendered element, as React's rest props do.\n\nconst preventNativeDrag = (event: Event) => event.preventDefault()\n\nconst SortableComponent = defineComponent({\n name: \"Sortable\",\n inheritAttrs: false,\n props: {\n /** The list, in the order of the children. Bind with `v-model:value`. */\n value: { type: Array as PropType<readonly unknown[]>, required: true },\n /** `list` for rows one under another, `grid` for items that stand side by side. @default \"list\" */\n layout: { type: String as PropType<SortableLayout>, default: \"list\" },\n /** Element to render, such as `TableBody` for table rows. @default \"div\" */\n as: { type: [String, Object] as PropType<string | Component>, default: \"div\" },\n /** Turns dragging off. @default false */\n disabled: { type: Boolean, default: false },\n /** Shows the grips of `SortableHandle`. A hidden grip still takes the keyboard, and the item drags from anywhere but a control. @default true in a table, otherwise false */\n handles: { type: Boolean, default: undefined },\n /** Lists of one group trade items, and a `SortableTarget` of that group takes them. Give each list a `name`. */\n group: { type: String, default: undefined },\n /** Names the list in `move`. */\n name: { type: String, default: undefined },\n },\n emits: {\n \"update:value\": (value: unknown[]) => Array.isArray(value),\n \"change\": (value: unknown[]) => Array.isArray(value),\n /** An item moved, inside this list or out of it. Out of it the app updates both lists: `update:value` is for a move inside one. */\n \"move\": (move: SortableMove) => typeof move === \"object\" && move !== null,\n /** A drag rests on a `SortableTarget` of the group: open what it stands for or go there. */\n \"hold\": (name: string) => typeof name === \"string\",\n },\n slots: Object as SlotsType<{\n /** The items, one direct child per entry of `value`, keyed by the entry and not by its index */\n default?: () => VNodeChild\n }>,\n setup(props, { attrs, emit, slots }) {\n let cancelDrag: ReturnType<typeof sortablePointerDown>\n onBeforeUnmount(() => cancelDrag?.())\n watch(() => props.disabled, (disabled) => {\n if (disabled) {\n cancelDrag?.()\n cancelDrag = undefined\n }\n }, { flush: \"sync\" })\n const commit = async (from: number, to: number) => {\n const next = moveItem(props.value, from, to)\n emit(\"update:value\", next)\n emit(\"change\", next)\n emit(\"move\", { item: props.value[from], from: props.name as string, fromIndex: from, to: props.name as string, toIndex: to })\n await nextTick()\n }\n\n const link = {\n move: async (fromIndex: number, to: string, toIndex?: number) => {\n emit(\"move\", { item: props.value[fromIndex], from: props.name as string, fromIndex, to, toIndex })\n await nextTick()\n },\n hold: (name: string) => emit(\"hold\", name),\n }\n\n const onPointerdown = (event: PointerEvent) => {\n if (!props.disabled && !event.defaultPrevented) {\n cancelDrag = sortablePointerDown(event, event.currentTarget as HTMLElement, props.layout, commit, link) ?? cancelDrag\n }\n }\n\n const onKeydown = (event: KeyboardEvent) => {\n if (!props.disabled && !event.defaultPrevented) void sortableKeyDown(event, event.currentTarget as HTMLElement, commit, link)\n }\n\n return () => {\n const { class: className, ...rest } = attrs\n const isElement = typeof props.as === \"string\"\n return h(\n props.as as string,\n mergeProps(rest, {\n \"class\": clsx(s.Sortable, className as ClassValue),\n \"data-sortable\": \"\",\n \"data-layout\": props.layout,\n \"data-disabled\": props.disabled ? \"\" : undefined,\n \"data-handles\": props.handles?.toString(),\n \"data-group\": props.group,\n \"data-name\": props.name,\n onPointerdown,\n onKeydown,\n \"onDragstart\": preventNativeDrag,\n }),\n isElement ? (slots.default?.() as VNodeArrayChildren) : { default: () => slots.default?.() },\n )\n }\n },\n})\n\nconst SortableHandleComponent = defineComponent({\n name: \"SortableHandle\",\n inheritAttrs: false,\n props: {\n /** Name of the handle for assistive technology. @default \"Reorder\" */\n ariaLabel: { type: String, default: \"Reorder\" },\n },\n slots: Object as SlotsType<{\n /** The grip */\n default?: () => VNodeChild\n }>,\n setup(props, { attrs, slots }) {\n return () => {\n const { class: className, ...rest } = attrs\n return h(\n \"button\",\n {\n ...rest,\n \"type\": \"button\",\n \"class\": clsx(s.Handle, className as ClassValue),\n \"data-sortable-handle\": \"\",\n \"aria-label\": props.ariaLabel,\n },\n (slots.default ? slots.default() : [h(GripVertical, { class: s.DesktopGrip, \"aria-hidden\": true }), h(Hamburger, { class: s.PhoneGrip, \"aria-hidden\": true, \"preserveAspectRatio\": \"none\" })]) as VNodeArrayChildren,\n )\n }\n },\n})\n\nconst SortableTargetComponent = defineComponent({\n name: \"SortableTarget\",\n inheritAttrs: false,\n props: {\n /** The `group` of the lists whose items it takes */\n group: { type: String, required: true },\n /** Names the target in `move` and `hold` on the list */\n name: { type: String, required: true },\n /** Element to render. @default \"div\" */\n as: { type: [String, Object] as PropType<string | Component>, default: \"div\" },\n },\n slots: Object as SlotsType<{\n /** What the target shows */\n default?: () => VNodeChild\n }>,\n setup(props, { attrs, slots }) {\n return () => {\n const { class: className, ...rest } = attrs\n const isElement = typeof props.as === \"string\"\n return h(\n props.as as string,\n {\n ...rest,\n \"class\": clsx(s.Target, className as ClassValue),\n \"data-sortable-target\": props.group,\n \"data-name\": props.name,\n },\n isElement ? (slots.default?.() as VNodeArrayChildren) : { default: () => slots.default?.() },\n )\n }\n },\n})\n\n/** Reorders its direct children by dragging, from anywhere but a control, or by a `SortableHandle` where grips are shown. */\nexport const Sortable = SortableComponent\n/** The grip of an item. Arrow keys move the item while the handle has focus. */\nexport const SortableHandle = SortableHandleComponent\n/** A place outside the lists that takes an item whole: a folder, a category in a side list. */\nexport const SortableTarget = SortableTargetComponent\nexport type { SortableLayout, SortableMove }\n"]}
|
|
@@ -1,2 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
// Backward-compatible alias: StatCard is now StatsCard, as in packages/ui/src/components/StatCard.
|
|
2
|
+
import { StatsCard, } from "../StatsCard/index.js";
|
|
3
|
+
/** @deprecated Renamed to `StatsCard`: `import { StatsCard } from "@plexui/vue/components/StatsCard"`. */
|
|
4
|
+
export const StatCard = StatsCard;
|
|
2
5
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/StatCard/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/StatCard/index.ts"],"names":[],"mappings":"AAAA,mGAAmG;AACnG,OAAO,EACL,SAAS,GAIV,MAAM,uBAAuB,CAAA;AAE9B,0GAA0G;AAC1G,MAAM,CAAC,MAAM,QAAQ,GAAqB,SAAS,CAAA","sourcesContent":["// Backward-compatible alias: StatCard is now StatsCard, as in packages/ui/src/components/StatCard.\nimport {\n StatsCard,\n type StatsCardAccentColor,\n type StatsCardProps,\n type StatsCardTrend,\n} from \"../StatsCard/index.js\"\n\n/** @deprecated Renamed to `StatsCard`: `import { StatsCard } from \"@plexui/vue/components/StatsCard\"`. */\nexport const StatCard: typeof StatsCard = StatsCard\n/** @deprecated Renamed to `StatsCardAccentColor`. */\nexport type StatCardAccentColor = StatsCardAccentColor\n/** @deprecated Renamed to `StatsCardProps`. */\nexport type StatCardProps = StatsCardProps\n/** @deprecated Renamed to `StatsCardTrend`. */\nexport type StatCardTrend = StatsCardTrend\n"]}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { defineComponent, h } from "vue";
|
|
2
2
|
import { Badge } from "../Badge/index.js";
|
|
3
|
-
import { InfoCircle } from "../Icon/index.js";
|
|
3
|
+
import { InfoCircle, Trending } from "../Icon/index.js";
|
|
4
4
|
import { Tooltip } from "../Tooltip/index.js";
|
|
5
5
|
import { hasContent } from "../../lib/slotContent.js";
|
|
6
|
-
import s from "@plexui/styles/components/
|
|
7
|
-
const
|
|
8
|
-
name: "
|
|
6
|
+
import s from "@plexui/styles/components/StatsCard/StatsCard.module.css";
|
|
7
|
+
const StatsCardComponent = defineComponent({
|
|
8
|
+
name: "StatsCard",
|
|
9
9
|
props: {
|
|
10
10
|
/** Label describing the metric */
|
|
11
11
|
label: { type: String, required: true },
|
|
@@ -19,11 +19,11 @@ const StatCardComponent = defineComponent({
|
|
|
19
19
|
invertTrend: { type: Boolean, default: undefined },
|
|
20
20
|
/** Progress value from 0 to 100. Shows a progress bar at the bottom. */
|
|
21
21
|
progress: Number,
|
|
22
|
-
/** Label displayed
|
|
22
|
+
/** Label displayed after the progress bar */
|
|
23
23
|
progressLabel: String,
|
|
24
24
|
/** Tooltip text: renders an (i) icon next to the label with a tooltip on hover */
|
|
25
25
|
tooltip: String,
|
|
26
|
-
/** Where the trend indicator is positioned:
|
|
26
|
+
/** Where the trend indicator is positioned: under the value with its label, or right-aligned in the header row (its label under the value). @default "value" */
|
|
27
27
|
trendPosition: { type: String, default: "value" },
|
|
28
28
|
/** Visual style of the trend indicator: plain colored text, or a Badge. @default "text" */
|
|
29
29
|
trendVariant: { type: String, default: "text" },
|
|
@@ -31,7 +31,7 @@ const StatCardComponent = defineComponent({
|
|
|
31
31
|
size: { type: String, default: "default" },
|
|
32
32
|
/** Visual variant of the card. @default "default" */
|
|
33
33
|
variant: { type: String, default: "default" },
|
|
34
|
-
/**
|
|
34
|
+
/** Color of the accent variant's bar. @default "primary" */
|
|
35
35
|
accentColor: { type: String, default: "primary" },
|
|
36
36
|
},
|
|
37
37
|
setup(props, { slots }) {
|
|
@@ -58,11 +58,21 @@ const StatCardComponent = defineComponent({
|
|
|
58
58
|
: invertTrend
|
|
59
59
|
? "success"
|
|
60
60
|
: "danger";
|
|
61
|
+
// A trend line points the way the value moved, whichever colour that is (shadcn's metric cards draw lucide's
|
|
62
|
+
// trending-up and trending-down); a fall is the rise mirrored
|
|
63
|
+
const trendContent = () => [
|
|
64
|
+
trendValue !== 0 ? h(Trending, { class: trendValue < 0 ? s.TrendDown : undefined }) : null,
|
|
65
|
+
trendText,
|
|
66
|
+
];
|
|
61
67
|
const trendEl = trend != null
|
|
62
68
|
? trendVariant === "badge"
|
|
63
|
-
? h(Badge, { size: "sm", color: trendBadgeColor }, { default:
|
|
64
|
-
: h("div", { class: [s.Trend, trendClassName] },
|
|
69
|
+
? h(Badge, { size: "sm", color: trendBadgeColor }, { default: trendContent })
|
|
70
|
+
: h("div", { class: [s.Trend, trendClassName] }, trendContent())
|
|
65
71
|
: null;
|
|
72
|
+
// The icon's tile stands at the end of the header, as the trend may (shadcn's metric card with an icon)
|
|
73
|
+
const iconSlot = slots.icon?.();
|
|
74
|
+
const iconEl = hasContent(iconSlot) ? h("div", { class: s.IconWrapper }, iconSlot) : null;
|
|
75
|
+
const headerTrendEl = trendPosition === "header" ? trendEl : null;
|
|
66
76
|
const headerEl = h("div", { class: s.Header }, [
|
|
67
77
|
h("div", { class: s.LabelRow }, [
|
|
68
78
|
h("div", { class: s.Label }, label),
|
|
@@ -75,17 +85,21 @@ const StatCardComponent = defineComponent({
|
|
|
75
85
|
})
|
|
76
86
|
: null,
|
|
77
87
|
]),
|
|
78
|
-
|
|
88
|
+
headerTrendEl || iconEl ? h("div", { class: s.HeaderEnd }, [headerTrendEl, iconEl]) : null,
|
|
79
89
|
]);
|
|
80
90
|
const valueSlot = slots.value?.();
|
|
81
91
|
const valueRowEl = h("div", { class: s.ValueRow }, [
|
|
82
92
|
h("div", { class: s.Value }, hasContent(valueSlot) ? valueSlot : props.value),
|
|
83
|
-
trendPosition === "value" ? trendEl : null,
|
|
84
|
-
description ? h("div", { class: s.Description }, description) : null,
|
|
85
93
|
]);
|
|
86
|
-
|
|
87
|
-
|
|
94
|
+
// Under the value, a trend and what it compares with, on one line (shadcn's metric card with a trend); a trend
|
|
95
|
+
// in the header leaves its label there
|
|
96
|
+
const trendRowEl = trend != null && (trendPosition === "value" || trend.label)
|
|
97
|
+
? h("div", { class: s.TrendRow }, [
|
|
98
|
+
trendPosition === "value" ? trendEl : null,
|
|
99
|
+
trend.label ? h("span", { class: s.TrendLabel }, trend.label) : null,
|
|
100
|
+
])
|
|
88
101
|
: null;
|
|
102
|
+
const descriptionEl = description ? h("div", { class: s.Description }, description) : null;
|
|
89
103
|
const progressEl = progressValue !== undefined || progressLabel
|
|
90
104
|
? h("div", { class: s.Progress }, [
|
|
91
105
|
h("div", { class: s.ProgressTrack }, [
|
|
@@ -100,23 +114,14 @@ const StatCardComponent = defineComponent({
|
|
|
100
114
|
: null;
|
|
101
115
|
const sparklineSlot = slots.sparkline?.();
|
|
102
116
|
const sparklineEl = hasContent(sparklineSlot) ? h("div", { class: s.Sparkline }, sparklineSlot) : null;
|
|
103
|
-
const iconSlot = slots.icon?.();
|
|
104
|
-
const content = [headerEl, valueRowEl, footerEl, progressEl, sparklineEl];
|
|
105
117
|
return h("div", {
|
|
106
|
-
"class": s.
|
|
118
|
+
"class": s.StatsCard,
|
|
107
119
|
"data-variant": props.variant,
|
|
108
120
|
"data-size": props.size,
|
|
109
121
|
"data-accent-color": props.accentColor,
|
|
110
|
-
},
|
|
111
|
-
? [
|
|
112
|
-
h("div", { class: s.Body }, [
|
|
113
|
-
h("div", { class: s.IconWrapper }, iconSlot),
|
|
114
|
-
h("div", { class: s.Content }, content),
|
|
115
|
-
]),
|
|
116
|
-
]
|
|
117
|
-
: content);
|
|
122
|
+
}, [headerEl, valueRowEl, trendRowEl, descriptionEl, progressEl, sparklineEl]);
|
|
118
123
|
};
|
|
119
124
|
},
|
|
120
125
|
});
|
|
121
|
-
export const
|
|
122
|
-
//# sourceMappingURL=
|
|
126
|
+
export const StatsCard = StatsCardComponent;
|
|
127
|
+
//# sourceMappingURL=StatsCard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StatsCard.js","sourceRoot":"","sources":["../../../../src/components/StatsCard/StatsCard.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,CAAC,EAAsC,MAAM,KAAK,CAAA;AAC5E,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AACzC,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AACvD,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAC7C,OAAO,EAAE,UAAU,E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AC,WAAW;aACvC,EACD,CAAC,QAAQ,EAAE,UAAU,EAAE,UAAU,EAAE,aAAa,EAAE,UAAU,EAAE,WAAW,CAAC,CAC3E,CAAA;QACH,CAAC,CAAA;IACH,CAAC;CACF,CAAC,CAAA;AAOF,MAAM,CAAC,MAAM,SAAS,GAAG,kBAAwF,CAAA","sourcesContent":["import { defineComponent, h, type HTMLAttributes, type PropType } from \"vue\"\nimport { Badge } from \"../Badge/index.js\"\nimport { InfoCircle, Trending } from \"../Icon/index.js\"\nimport { Tooltip } from \"../Tooltip/index.js\"\nimport { hasContent } from \"../../lib/slotContent.js\"\nimport s from \"@plexui/styles/components/StatsCard/StatsCard.module.css\"\n\n// Vue port of packages/ui/src/components/StatsCard/StatsCard.tsx. Props,\n// defaults and rendered DOM match React (checked by the parity tests).\n// ReactNode props are slots: `value` (also a prop, for plain values),\n// `icon` and `sparkline`. React spreads the remaining props after its own\n// attributes, so caller attributes win; Vue's fallthrough does the same.\n\nexport type StatsCardTrend = {\n /** The percentage change value (e.g. 12.5 for +12.5%) */\n value: number\n /** Optional label for the trend (e.g. \"vs last month\") */\n label?: string\n}\n\nexport type StatsCardAccentColor =\n | \"primary\"\n | \"secondary\"\n | \"info\"\n | \"success\"\n | \"warning\"\n | \"danger\"\n | \"discovery\"\n | \"caution\"\n\nconst StatsCardComponent = defineComponent({\n name: \"StatsCard\",\n props: {\n /** Label describing the metric */\n label: { type: String, required: true },\n /** The primary metric value (e.g. \"1,234\" or \"$50K\"); the `value` slot takes rich content */\n value: { type: [String, Number] as PropType<string | number>, default: undefined },\n /** Optional description or subtitle below the value */\n description: String,\n /** Trend indicator with percentage change */\n trend: Object as PropType<StatsCardTrend>,\n /** When true, a positive trend is bad (red) and negative is good (green). Use for metrics like \"Error Rate\" or \"Avg Completion Time\". */\n invertTrend: { type: Boolean, default: undefined },\n /** Progress value from 0 to 100. Shows a progress bar at the bottom. */\n progress: Number,\n /** Label displayed after the progress bar */\n progressLabel: String,\n /** Tooltip text: renders an (i) icon next to the label with a tooltip on hover */\n tooltip: String,\n /** Where the trend indicator is positioned: under the value with its label, or right-aligned in the header row (its label under the value). @default \"value\" */\n trendPosition: { type: String as PropType<\"value\" | \"header\">, default: \"value\" },\n /** Visual style of the trend indicator: plain colored text, or a Badge. @default \"text\" */\n trendVariant: { type: String as PropType<\"text\" | \"badge\">, default: \"text\" },\n /** Size of the card: standard dashboard card, or compact for dense layouts. @default \"default\" */\n size: { type: String as PropType<\"default\" | \"sm\">, default: \"default\" },\n /** Visual variant of the card. @default \"default\" */\n variant: { type: String as PropType<\"default\" | \"accent\">, default: \"default\" },\n /** Color of the accent variant's bar. @default \"primary\" */\n accentColor: { type: String as PropType<StatsCardAccentColor>, default: \"primary\" },\n },\n setup(props, { slots }) {\n return () => {\n const { label, description, trend, invertTrend, progress, progressLabel, tooltip, trendPosition, trendVariant } =\n props\n\n const trendValue = trend?.value ?? 0\n const trendClassName =\n trendValue === 0\n ? s.TrendNeutral\n : trendValue > 0\n ? invertTrend\n ? s.TrendNegative\n : s.TrendPositive\n : invertTrend\n ? s.TrendPositive\n : s.TrendNegative\n\n const trendText = `${trendValue > 0 ? \"+\" : \"\"}${trendValue}%`\n const progressValue = progress === undefined ? undefined : Math.min(100, Math.max(0, progress))\n\n const trendBadgeColor =\n trendValue === 0\n ? \"secondary\"\n : trendValue > 0\n ? invertTrend\n ? \"danger\"\n : \"success\"\n : invertTrend\n ? \"success\"\n : \"danger\"\n\n // A trend line points the way the value moved, whichever colour that is (shadcn's metric cards draw lucide's\n // trending-up and trending-down); a fall is the rise mirrored\n const trendContent = () => [\n trendValue !== 0 ? h(Trending, { class: trendValue < 0 ? s.TrendDown : undefined }) : null,\n trendText,\n ]\n\n const trendEl =\n trend != null\n ? trendVariant === \"badge\"\n ? h(Badge, { size: \"sm\", color: trendBadgeColor }, { default: trendContent })\n : h(\"div\", { class: [s.Trend, trendClassName] }, trendContent())\n : null\n\n // The icon's tile stands at the end of the header, as the trend may (shadcn's metric card with an icon)\n const iconSlot = slots.icon?.()\n const iconEl = hasContent(iconSlot) ? h(\"div\", { class: s.IconWrapper }, iconSlot) : null\n const headerTrendEl = trendPosition === \"header\" ? trendEl : null\n\n const headerEl = h(\"div\", { class: s.Header }, [\n h(\"div\", { class: s.LabelRow }, [\n h(\"div\", { class: s.Label }, label),\n tooltip\n ? h(\n Tooltip,\n { content: tooltip },\n {\n // Focusable and named so keyboard and screen-reader users reach the tooltip\n default: () =>\n h(\"span\", { \"class\": s.InfoIcon, \"tabindex\": 0, \"role\": \"img\", \"aria-label\": \"More information\" }, [\n h(InfoCircle),\n ]),\n },\n )\n : null,\n ]),\n headerTrendEl || iconEl ? h(\"div\", { class: s.HeaderEnd }, [headerTrendEl, iconEl]) : null,\n ])\n\n const valueSlot = slots.value?.()\n const valueRowEl = h(\"div\", { class: s.ValueRow }, [\n h(\"div\", { class: s.Value }, hasContent(valueSlot) ? valueSlot : props.value),\n ])\n\n // Under the value, a trend and what it compares with, on one line (shadcn's metric card with a trend); a trend\n // in the header leaves its label there\n const trendRowEl =\n trend != null && (trendPosition === \"value\" || trend.label)\n ? h(\"div\", { class: s.TrendRow }, [\n trendPosition === \"value\" ? trendEl : null,\n trend.label ? h(\"span\", { class: s.TrendLabel }, trend.label) : null,\n ])\n : null\n\n const descriptionEl = description ? h(\"div\", { class: s.Description }, description) : null\n\n const progressEl =\n progressValue !== undefined || progressLabel\n ? h(\"div\", { class: s.Progress }, [\n h(\"div\", { class: s.ProgressTrack }, [\n h(\"div\", {\n \"class\": s.ProgressBar,\n \"style\": { width: `${progressValue ?? 0}%` },\n \"aria-hidden\": \"true\",\n }),\n ]),\n progressLabel ? h(\"div\", { class: s.ProgressLabel }, progressLabel) : null,\n ])\n : null\n\n const sparklineSlot = slots.sparkline?.()\n const sparklineEl = hasContent(sparklineSlot) ? h(\"div\", { class: s.Sparkline }, sparklineSlot) : null\n\n return h(\n \"div\",\n {\n \"class\": s.StatsCard,\n \"data-variant\": props.variant,\n \"data-size\": props.size,\n \"data-accent-color\": props.accentColor,\n },\n [headerEl, valueRowEl, trendRowEl, descriptionEl, progressEl, sparklineEl],\n )\n }\n },\n})\n\ntype StatsCardOwnProps = InstanceType<typeof StatsCardComponent>[\"$props\"]\n\n/** StatsCard props plus the native <div> attributes that fall through to it, as in React. */\nexport type StatsCardProps = StatsCardOwnProps & Omit<HTMLAttributes, keyof StatsCardOwnProps>\n\nexport const StatsCard = StatsCardComponent as typeof StatsCardComponent & { new (): { $props: StatsCardProps } }\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/StatsCard/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAuE,MAAM,gBAAgB,CAAA","sourcesContent":["export { StatsCard, type StatsCardAccentColor, type StatsCardProps, type StatsCardTrend } from \"./StatsCard.js\"\n"]}
|
|
@@ -46,7 +46,7 @@ const SwipeActionsComponent = defineComponent({
|
|
|
46
46
|
leading: { type: Array, default: () => [] },
|
|
47
47
|
/** Actions revealed by a swipe toward the leading edge, the first one at the trailing edge */
|
|
48
48
|
trailing: { type: Array, default: () => [] },
|
|
49
|
-
/** Where the actions show their labels: `"hidden"` (symbols only), `"inside"` the capsule, or `"below"` it (for rows of
|
|
49
|
+
/** 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" */
|
|
50
50
|
labelPlacement: { type: String, default: "hidden" },
|
|
51
51
|
/** A swipe past the middle between the open actions and the far edge runs the first action of that side. @default true */
|
|
52
52
|
fullSwipe: { type: Boolean, default: true },
|
|
@@ -56,6 +56,7 @@ const SwipeActionsComponent = defineComponent({
|
|
|
56
56
|
const full = ref(false);
|
|
57
57
|
const swiping = ref(false);
|
|
58
58
|
const rtl = ref(false);
|
|
59
|
+
const round = ref(false);
|
|
59
60
|
const root = ref(null);
|
|
60
61
|
const sides = { leading: null, trailing: null };
|
|
61
62
|
let gesture = null;
|
|
@@ -117,7 +118,24 @@ const SwipeActionsComponent = defineComponent({
|
|
|
117
118
|
if (target !== offset.value)
|
|
118
119
|
move(target);
|
|
119
120
|
};
|
|
120
|
-
|
|
121
|
+
/**
|
|
122
|
+
* A symbol that has grown as tall as its circle (its max-height) is one, as iOS draws a circle from there. The
|
|
123
|
+
* measure is a capsule that is laid out: a full swipe hides all but the first action of its side, and while none
|
|
124
|
+
* is laid out the shape stays.
|
|
125
|
+
*/
|
|
126
|
+
const fit = () => {
|
|
127
|
+
const capsules = [...(root.value?.querySelectorAll('[data-shape="symbol"] > :first-child') ?? [])];
|
|
128
|
+
if (capsules.length < 1) {
|
|
129
|
+
round.value = false;
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
const capsule = capsules.find((element) => element.getBoundingClientRect().height > 0);
|
|
133
|
+
if (!capsule)
|
|
134
|
+
return;
|
|
135
|
+
const max = parseFloat(getComputedStyle(capsule).maxHeight);
|
|
136
|
+
round.value = max > 0 && capsule.getBoundingClientRect().height >= max - 0.5;
|
|
137
|
+
};
|
|
138
|
+
// After each render, and whenever the actions change size, an open row takes their width and a symbol its shape.
|
|
121
139
|
const observeSides = () => {
|
|
122
140
|
for (const element of [sides.leading, sides.trailing])
|
|
123
141
|
if (element)
|
|
@@ -125,10 +143,15 @@ const SwipeActionsComponent = defineComponent({
|
|
|
125
143
|
};
|
|
126
144
|
onMounted(() => {
|
|
127
145
|
if (typeof ResizeObserver !== "undefined")
|
|
128
|
-
observer = new ResizeObserver(
|
|
146
|
+
observer = new ResizeObserver(() => {
|
|
147
|
+
fit();
|
|
148
|
+
sync();
|
|
149
|
+
});
|
|
150
|
+
fit();
|
|
129
151
|
observeSides();
|
|
130
152
|
});
|
|
131
153
|
onUpdated(() => {
|
|
154
|
+
fit();
|
|
132
155
|
sync();
|
|
133
156
|
observeSides();
|
|
134
157
|
});
|
|
@@ -319,13 +342,16 @@ const SwipeActionsComponent = defineComponent({
|
|
|
319
342
|
"style": isFull ? { width: `${Math.abs(offset.value)}px` } : undefined,
|
|
320
343
|
}, shown.map((action) => {
|
|
321
344
|
const color = action.color ?? "secondary";
|
|
322
|
-
|
|
323
|
-
const
|
|
345
|
+
// A label alone (text), a symbol with its label inside (label), or a symbol with its label hidden or below.
|
|
346
|
+
const shape = !action.Icon ? "text" : props.labelPlacement === "inside" ? "label" : "symbol";
|
|
347
|
+
const labelInside = shape !== "symbol";
|
|
348
|
+
const labelBelow = shape === "symbol" && props.labelPlacement === "below";
|
|
324
349
|
return h("button", {
|
|
325
350
|
"key": action.id,
|
|
326
351
|
"type": "button",
|
|
327
352
|
"class": s.Action,
|
|
328
353
|
"data-color": color,
|
|
354
|
+
"data-shape": shape,
|
|
329
355
|
"data-first": action === actions[0] ? "" : undefined,
|
|
330
356
|
"aria-label": labelInside || labelBelow ? undefined : action.label,
|
|
331
357
|
"onClick": (event) => select(action, event),
|
|
@@ -345,6 +371,7 @@ const SwipeActionsComponent = defineComponent({
|
|
|
345
371
|
"data-row": "",
|
|
346
372
|
"data-swipe-actions": "",
|
|
347
373
|
"data-label-placement": props.labelPlacement,
|
|
374
|
+
"data-round": round.value ? "" : undefined,
|
|
348
375
|
"data-revealed": revealed.value,
|
|
349
376
|
"data-swiping": swiping.value ? "" : undefined,
|
|
350
377
|
"onFocusin": handleFocusIn,
|