@treeui/vue 0.14.0 → 0.15.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/components/TAppShell.cjs.map +1 -1
- package/dist/components/TAppShell.js.map +1 -1
- package/dist/components/TAppShell.vue.d.ts +25 -0
- package/dist/components/TAppShell.vue.d.ts.map +1 -1
- package/dist/components/TAppShell.vue_vue_type_script_setup_true_lang.cjs +1 -1
- package/dist/components/TAppShell.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/components/TAppShell.vue_vue_type_script_setup_true_lang.js +166 -104
- package/dist/components/TAppShell.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/TButton.cjs.map +1 -1
- package/dist/components/TButton.js.map +1 -1
- package/dist/components/TButton.vue.d.ts +6 -0
- package/dist/components/TButton.vue.d.ts.map +1 -1
- package/dist/components/TButton.vue_vue_type_script_setup_true_lang.cjs +1 -1
- package/dist/components/TButton.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/components/TButton.vue_vue_type_script_setup_true_lang.js +10 -2
- package/dist/components/TButton.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/TChart.cjs.map +1 -1
- package/dist/components/TChart.js.map +1 -1
- package/dist/components/TChart.vue.d.ts.map +1 -1
- package/dist/components/TChart.vue_vue_type_script_setup_true_lang.cjs +1 -1
- package/dist/components/TChart.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/components/TChart.vue_vue_type_script_setup_true_lang.js +58 -58
- package/dist/components/TChart.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/TColorSwatch.cjs +2 -0
- package/dist/components/TColorSwatch.cjs.map +1 -0
- package/dist/components/TColorSwatch.js +7 -0
- package/dist/components/TColorSwatch.js.map +1 -0
- package/dist/components/TColorSwatch.vue.d.ts +33 -0
- package/dist/components/TColorSwatch.vue.d.ts.map +1 -0
- package/dist/components/TColorSwatch.vue_vue_type_script_setup_true_lang.cjs +2 -0
- package/dist/components/TColorSwatch.vue_vue_type_script_setup_true_lang.cjs.map +1 -0
- package/dist/components/TColorSwatch.vue_vue_type_script_setup_true_lang.js +63 -0
- package/dist/components/TColorSwatch.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/TDropdown.vue.d.ts +1 -1
- package/dist/components/TDropdown.vue.d.ts.map +1 -1
- package/dist/components/TInput.cjs.map +1 -1
- package/dist/components/TInput.js.map +1 -1
- package/dist/components/TInput.vue.d.ts +4 -1
- package/dist/components/TInput.vue.d.ts.map +1 -1
- package/dist/components/TInput.vue_vue_type_script_setup_true_lang.cjs +1 -1
- package/dist/components/TInput.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/components/TInput.vue_vue_type_script_setup_true_lang.js +2 -0
- package/dist/components/TInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/TKbd.cjs +2 -0
- package/dist/components/TKbd.cjs.map +1 -0
- package/dist/components/TKbd.js +7 -0
- package/dist/components/TKbd.js.map +1 -0
- package/dist/components/TKbd.vue.d.ts +18 -0
- package/dist/components/TKbd.vue.d.ts.map +1 -0
- package/dist/components/TKbd.vue_vue_type_script_setup_true_lang.cjs +2 -0
- package/dist/components/TKbd.vue_vue_type_script_setup_true_lang.cjs.map +1 -0
- package/dist/components/TKbd.vue_vue_type_script_setup_true_lang.js +12 -0
- package/dist/components/TKbd.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/TPopover.vue.d.ts +1 -1
- package/dist/components/TPopover.vue.d.ts.map +1 -1
- package/dist/components/TSelect.cjs.map +1 -1
- package/dist/components/TSelect.js.map +1 -1
- package/dist/components/TSelect.vue.d.ts +4 -1
- package/dist/components/TSelect.vue.d.ts.map +1 -1
- package/dist/components/TSelect.vue_vue_type_script_setup_true_lang.cjs +1 -1
- package/dist/components/TSelect.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/components/TSelect.vue_vue_type_script_setup_true_lang.js +2 -0
- package/dist/components/TSelect.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/TSpacer.cjs +2 -0
- package/dist/components/TSpacer.cjs.map +1 -0
- package/dist/components/TSpacer.js +7 -0
- package/dist/components/TSpacer.js.map +1 -0
- package/dist/components/TSpacer.vue.d.ts +8 -0
- package/dist/components/TSpacer.vue.d.ts.map +1 -0
- package/dist/components/TSpacer.vue_vue_type_script_setup_true_lang.cjs +2 -0
- package/dist/components/TSpacer.vue_vue_type_script_setup_true_lang.cjs.map +1 -0
- package/dist/components/TSpacer.vue_vue_type_script_setup_true_lang.js +16 -0
- package/dist/components/TSpacer.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/TSplit.cjs +2 -0
- package/dist/components/TSplit.cjs.map +1 -0
- package/dist/components/TSplit.js +7 -0
- package/dist/components/TSplit.js.map +1 -0
- package/dist/components/TSplit.vue.d.ts +38 -0
- package/dist/components/TSplit.vue.d.ts.map +1 -0
- package/dist/components/TSplit.vue_vue_type_script_setup_true_lang.cjs +2 -0
- package/dist/components/TSplit.vue_vue_type_script_setup_true_lang.cjs.map +1 -0
- package/dist/components/TSplit.vue_vue_type_script_setup_true_lang.js +43 -0
- package/dist/components/TSplit.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/TStack.cjs.map +1 -1
- package/dist/components/TStack.js.map +1 -1
- package/dist/components/TStack.vue.d.ts +3 -0
- package/dist/components/TStack.vue.d.ts.map +1 -1
- package/dist/components/TStack.vue_vue_type_script_setup_true_lang.cjs +1 -1
- package/dist/components/TStack.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/components/TStack.vue_vue_type_script_setup_true_lang.js +6 -1
- package/dist/components/TStack.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/TStackItem.cjs +2 -0
- package/dist/components/TStackItem.cjs.map +1 -0
- package/dist/components/TStackItem.js +7 -0
- package/dist/components/TStackItem.js.map +1 -0
- package/dist/components/TStackItem.vue.d.ts +38 -0
- package/dist/components/TStackItem.vue.d.ts.map +1 -0
- package/dist/components/TStackItem.vue_vue_type_script_setup_true_lang.cjs +2 -0
- package/dist/components/TStackItem.vue_vue_type_script_setup_true_lang.cjs.map +1 -0
- package/dist/components/TStackItem.vue_vue_type_script_setup_true_lang.js +45 -0
- package/dist/components/TStackItem.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/TText.cjs +2 -0
- package/dist/components/TText.cjs.map +1 -0
- package/dist/components/TText.js +7 -0
- package/dist/components/TText.js.map +1 -0
- package/dist/components/TText.vue.d.ts +39 -0
- package/dist/components/TText.vue.d.ts.map +1 -0
- package/dist/components/TText.vue_vue_type_script_setup_true_lang.cjs +2 -0
- package/dist/components/TText.vue_vue_type_script_setup_true_lang.cjs.map +1 -0
- package/dist/components/TText.vue_vue_type_script_setup_true_lang.js +32 -0
- package/dist/components/TText.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/TTextarea.cjs.map +1 -1
- package/dist/components/TTextarea.js.map +1 -1
- package/dist/components/TTextarea.vue.d.ts +4 -1
- package/dist/components/TTextarea.vue.d.ts.map +1 -1
- package/dist/components/TTextarea.vue_vue_type_script_setup_true_lang.cjs +1 -1
- package/dist/components/TTextarea.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/components/TTextarea.vue_vue_type_script_setup_true_lang.js +2 -0
- package/dist/components/TTextarea.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/index.d.ts +8 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/composables/useTheme.cjs +2 -0
- package/dist/composables/useTheme.cjs.map +1 -0
- package/dist/composables/useTheme.d.ts +38 -0
- package/dist/composables/useTheme.d.ts.map +1 -0
- package/dist/composables/useTheme.js +54 -0
- package/dist/composables/useTheme.js.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +43 -36
- package/dist/plugin.cjs +1 -1
- package/dist/plugin.cjs.map +1 -1
- package/dist/plugin.d.ts.map +1 -1
- package/dist/plugin.js +142 -130
- package/dist/plugin.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types/contracts.cjs +1 -1
- package/dist/types/contracts.cjs.map +1 -1
- package/dist/types/contracts.d.ts +8 -1
- package/dist/types/contracts.d.ts.map +1 -1
- package/dist/types/contracts.js +8 -2
- package/dist/types/contracts.js.map +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TSelect.vue_vue_type_script_setup_true_lang.js","names":["$slots"],"sources":["../../src/components/TSelect.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { createId, isActivationKey, isEscapeKey } from '@treeui/utils';\nimport { computed, nextTick, onBeforeUnmount, ref, toRef, useAttrs, watch } from 'vue';\nimport { useControllableOpen } from '../composables/useControllableOpen';\nimport type { TSize } from '../types/contracts';\nimport TSpinner from './TSpinner.vue';\n\ndefineOptions({\n inheritAttrs: false,\n});\n\nexport interface TSelectOption {\n label: string;\n value: string | number;\n disabled?: boolean;\n}\n\nconst props = withDefaults(\n defineProps<{\n modelValue?: string | number;\n options?: TSelectOption[];\n open?: boolean;\n defaultOpen?: boolean;\n size?: TSize;\n disabled?: boolean;\n loading?: boolean;\n invalid?: boolean;\n placeholder?: string;\n }>(),\n {\n modelValue: '',\n options: () => [],\n open: undefined,\n defaultOpen: false,\n size: 'md',\n disabled: false,\n loading: false,\n invalid: false,\n placeholder: '',\n },\n);\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: string | number];\n 'update:open': [value: boolean];\n 'open-change': [value: boolean];\n}>();\n\nconst attrs = useAttrs();\nconst listboxId = createId('t-select');\nconst rootRef = ref<HTMLElement | null>(null);\nconst triggerRef = ref<HTMLButtonElement | null>(null);\nconst listboxRef = ref<HTMLElement | null>(null);\nconst optionRefs = ref<Map<string | number, HTMLElement>>(new Map());\nconst focusedIndex = ref(-1);\nconst dropUp = ref(false);\n\nconst triggerAttrs = computed(() => {\n const { class: _class, style: _style, ...rest } = attrs;\n return rest;\n});\n\nconst { value: isOpen, setValue } = useControllableOpen(\n toRef(props, 'open'),\n props.defaultOpen,\n (value) => {\n emit('update:open', value);\n emit('open-change', value);\n },\n);\n\nconst rootClasses = computed(() => [\n 't-select',\n `t-select--${props.size}`,\n {\n 't-select--drop-up': dropUp.value,\n 'is-disabled': props.disabled,\n 'is-invalid': props.invalid,\n 'is-loading': props.loading,\n 'is-open': isOpen.value,\n },\n attrs.class,\n]);\n\n// Nearest ancestor that can clip the listbox (scroll container or hidden overflow).\nconst findClippingAncestor = (element: HTMLElement): HTMLElement | null => {\n let parent = element.parentElement;\n while (parent && parent !== document.body) {\n const { overflowY } = window.getComputedStyle(parent);\n if (overflowY === 'auto' || overflowY === 'scroll' || overflowY === 'hidden') {\n return parent;\n }\n parent = parent.parentElement;\n }\n return null;\n};\n\n// Flip the listbox above the trigger when its rendered position overflows the\n// nearest clipping ancestor (e.g. a modal body) or the viewport, and there is\n// more room above the trigger than below it. Measuring the rendered rect keeps\n// the decision in sync with the CSS offset (--tree-space-2) automatically.\nconst updateDropDirection = () => {\n const trigger = triggerRef.value;\n const listbox = listboxRef.value;\n if (!trigger || !listbox) {\n dropUp.value = false;\n return;\n }\n const triggerRect = trigger.getBoundingClientRect();\n const listboxRect = listbox.getBoundingClientRect();\n const boundary = findClippingAncestor(trigger)?.getBoundingClientRect();\n const bottomLimit = Math.min(boundary?.bottom ?? Infinity, window.innerHeight);\n const topLimit = Math.max(boundary?.top ?? 0, 0);\n const spaceBelow = bottomLimit - triggerRect.bottom;\n const spaceAbove = triggerRect.top - topLimit;\n dropUp.value = listboxRect.bottom > bottomLimit && spaceAbove > spaceBelow;\n};\n\nconst rootStyle = computed(() => attrs.style);\n\nconst selectedLabel = computed(() => {\n const opt = props.options.find((o) => o.value === props.modelValue);\n return opt?.label ?? '';\n});\n\nconst enabledOptions = computed(() =>\n props.options.filter((o) => !o.disabled),\n);\n\nconst openDropdown = () => {\n if (props.disabled) return;\n const selectedIdx = props.options.findIndex((o) => o.value === props.modelValue);\n focusedIndex.value = selectedIdx >= 0 ? selectedIdx : 0;\n // Render downward first so the measurement always starts from the default position.\n dropUp.value = false;\n setValue(true);\n nextTick(() => {\n updateDropDirection();\n focusOption(focusedIndex.value);\n });\n};\n\nconst closeDropdown = (restoreFocus = false) => {\n setValue(false);\n focusedIndex.value = -1;\n if (restoreFocus) {\n nextTick(() => triggerRef.value?.focus());\n }\n};\n\nconst toggleDropdown = () => {\n if (isOpen.value) {\n closeDropdown();\n } else {\n openDropdown();\n }\n};\n\nconst selectOption = (opt: TSelectOption) => {\n if (opt.disabled) return;\n emit('update:modelValue', opt.value);\n closeDropdown(true);\n};\n\nconst focusOption = (index: number) => {\n const opt = props.options[index];\n if (!opt) return;\n const el = optionRefs.value.get(opt.value);\n el?.focus();\n};\n\nconst setOptionRef = (el: Element | null, value: string | number) => {\n if (el instanceof HTMLElement) {\n optionRefs.value.set(value, el);\n } else {\n optionRefs.value.delete(value);\n }\n};\n\nconst moveFocus = (direction: 1 | -1) => {\n let nextIndex = focusedIndex.value + direction;\n while (nextIndex >= 0 && nextIndex < props.options.length) {\n if (!props.options[nextIndex].disabled) {\n focusedIndex.value = nextIndex;\n focusOption(nextIndex);\n return;\n }\n nextIndex += direction;\n }\n};\n\nconst onTriggerKeydown = (event: KeyboardEvent) => {\n if (props.disabled) return;\n\n if (isEscapeKey(event) && isOpen.value) {\n event.preventDefault();\n closeDropdown();\n return;\n }\n\n if (isActivationKey(event) || event.key === 'ArrowDown' || event.key === 'ArrowUp') {\n event.preventDefault();\n openDropdown();\n }\n};\n\nconst onOptionKeydown = (event: KeyboardEvent, opt: TSelectOption, _index: number) => {\n if (isEscapeKey(event)) {\n event.preventDefault();\n closeDropdown(true);\n return;\n }\n\n if (isActivationKey(event)) {\n event.preventDefault();\n selectOption(opt);\n return;\n }\n\n switch (event.key) {\n case 'ArrowDown':\n event.preventDefault();\n moveFocus(1);\n break;\n case 'ArrowUp':\n event.preventDefault();\n moveFocus(-1);\n break;\n case 'Home':\n event.preventDefault();\n focusedIndex.value = enabledOptions.value.length > 0\n ? props.options.indexOf(enabledOptions.value[0])\n : 0;\n focusOption(focusedIndex.value);\n break;\n case 'End':\n event.preventDefault();\n focusedIndex.value = enabledOptions.value.length > 0\n ? props.options.indexOf(enabledOptions.value[enabledOptions.value.length - 1])\n : props.options.length - 1;\n focusOption(focusedIndex.value);\n break;\n default:\n break;\n }\n};\n\nconst onDocumentPointerDown = (event: PointerEvent) => {\n if (!isOpen.value) return;\n const target = event.target;\n if (!(target instanceof Node)) return;\n if (rootRef.value?.contains(target)) return;\n closeDropdown();\n};\n\nconst hasSelection = computed(() =>\n props.modelValue !== '' && props.modelValue !== null && props.modelValue !== undefined,\n);\n\nwatch(isOpen, (value) => {\n if (value) {\n document.addEventListener('pointerdown', onDocumentPointerDown);\n } else {\n document.removeEventListener('pointerdown', onDocumentPointerDown);\n }\n});\n\nonBeforeUnmount(() => {\n document.removeEventListener('pointerdown', onDocumentPointerDown);\n});\n</script>\n\n<template>\n <div\n ref=\"rootRef\"\n :class=\"rootClasses\"\n :style=\"rootStyle\"\n :data-state=\"isOpen ? 'open' : 'closed'\"\n >\n <button\n ref=\"triggerRef\"\n v-bind=\"triggerAttrs\"\n type=\"button\"\n class=\"t-select__trigger\"\n :disabled=\"disabled\"\n :aria-controls=\"isOpen ? listboxId : undefined\"\n aria-haspopup=\"listbox\"\n :aria-expanded=\"isOpen\"\n :aria-invalid=\"invalid || undefined\"\n :aria-busy=\"loading || undefined\"\n @click=\"toggleDropdown\"\n @keydown=\"onTriggerKeydown\"\n >\n <span\n v-if=\"$slots.prefix\"\n class=\"t-select__slot t-select__slot--prefix\"\n >\n <slot name=\"prefix\" />\n </span>\n <span\n class=\"t-select__value\"\n :data-placeholder=\"!hasSelection ? true : undefined\"\n >\n {{ selectedLabel || placeholder }}\n </span>\n <TSpinner\n v-if=\"loading\"\n size=\"sm\"\n label=\"Loading\"\n />\n <svg\n v-else\n class=\"t-select__chevron\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <polyline points=\"4 6 8 10 12 6\" />\n </svg>\n </button>\n <transition name=\"t-fade\">\n <ul\n v-if=\"isOpen && !disabled\"\n :id=\"listboxId\"\n ref=\"listboxRef\"\n role=\"listbox\"\n class=\"t-select__listbox\"\n :aria-label=\"typeof triggerAttrs['aria-label'] === 'string' ? triggerAttrs['aria-label'] : undefined\"\n >\n <li\n v-for=\"(opt, index) in options\"\n :key=\"opt.value\"\n :ref=\"(el) => setOptionRef(el as Element | null, opt.value)\"\n role=\"option\"\n class=\"t-select__option\"\n :class=\"{\n 'is-selected': opt.value === modelValue,\n 'is-disabled': opt.disabled,\n 'is-focused': index === focusedIndex,\n }\"\n :aria-selected=\"opt.value === modelValue\"\n :aria-disabled=\"opt.disabled || undefined\"\n :tabindex=\"opt.disabled ? -1 : 0\"\n @click=\"selectOption(opt)\"\n @keydown=\"onOptionKeydown($event, opt, index)\"\n >\n {{ opt.label }}\n <svg\n v-if=\"opt.value === modelValue\"\n class=\"t-select__check\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <polyline points=\"3.5 8.5 6.5 11.5 12.5 4.5\" />\n </svg>\n </li>\n </ul>\n </transition>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiBA,IAAM,IAAQ,GAyBR,IAAO,GAMP,IAAQ,EAAS,GACjB,IAAY,EAAS,UAAU,GAC/B,IAAU,EAAwB,IAAI,GACtC,IAAa,EAA8B,IAAI,GAC/C,IAAa,EAAwB,I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AK,EAAA,CAAC,oBAAkB;oBACa,EAAI,UAAU,EAAA;oBAAuC,EAAI;mBAAoC,MAAU,EAAA;;IAK3I,iBAAe,EAAI,UAAU,EAAA;IAC7B,iBAAe,EAAI,YAAY,KAAA;IAC/B,UAAU,EAAI,WAAQ,KAAA;IACtB,UAAK,MAAE,EAAa,CAAG;IACvB,YAAO,MAAE,GAAgB,GAAQ,GAAK,CAAK;WAEzC,EAAI,KAAK,IAAG,KACf,CAAA,GACQ,EAAI,UAAU,EAAA,cAAA,EAAA,GADtB,EAYM,OAZN,IAYM,CAAA,GAAA,AAAA,EAAA,OAAA,CADJ,EAA+C,YAAA,EAArC,QAAO,4BAA2B,GAAA,MAAA,EAAA,CAAA,CAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,GAAA,IAAA,EAAA"}
|
|
1
|
+
{"version":3,"file":"TSelect.vue_vue_type_script_setup_true_lang.js","names":["$slots"],"sources":["../../src/components/TSelect.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { createId, isActivationKey, isEscapeKey } from '@treeui/utils';\nimport { computed, nextTick, onBeforeUnmount, ref, toRef, useAttrs, watch } from 'vue';\nimport { useControllableOpen } from '../composables/useControllableOpen';\nimport type { TFieldWidth, TSize } from '../types/contracts';\nimport TSpinner from './TSpinner.vue';\n\ndefineOptions({\n inheritAttrs: false,\n});\n\nexport interface TSelectOption {\n label: string;\n value: string | number;\n disabled?: boolean;\n}\n\nconst props = withDefaults(\n defineProps<{\n modelValue?: string | number;\n options?: TSelectOption[];\n open?: boolean;\n defaultOpen?: boolean;\n size?: TSize;\n /** Inline-size cap. Fluid (`full`) by default. */\n width?: TFieldWidth;\n disabled?: boolean;\n loading?: boolean;\n invalid?: boolean;\n placeholder?: string;\n }>(),\n {\n modelValue: '',\n options: () => [],\n open: undefined,\n defaultOpen: false,\n size: 'md',\n width: 'full',\n disabled: false,\n loading: false,\n invalid: false,\n placeholder: '',\n },\n);\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: string | number];\n 'update:open': [value: boolean];\n 'open-change': [value: boolean];\n}>();\n\nconst attrs = useAttrs();\nconst listboxId = createId('t-select');\nconst rootRef = ref<HTMLElement | null>(null);\nconst triggerRef = ref<HTMLButtonElement | null>(null);\nconst listboxRef = ref<HTMLElement | null>(null);\nconst optionRefs = ref<Map<string | number, HTMLElement>>(new Map());\nconst focusedIndex = ref(-1);\nconst dropUp = ref(false);\n\nconst triggerAttrs = computed(() => {\n const { class: _class, style: _style, ...rest } = attrs;\n return rest;\n});\n\nconst { value: isOpen, setValue } = useControllableOpen(\n toRef(props, 'open'),\n props.defaultOpen,\n (value) => {\n emit('update:open', value);\n emit('open-change', value);\n },\n);\n\nconst rootClasses = computed(() => [\n 't-select',\n `t-select--${props.size}`,\n props.width !== 'full' ? `t-field-width--${props.width}` : null,\n {\n 't-select--drop-up': dropUp.value,\n 'is-disabled': props.disabled,\n 'is-invalid': props.invalid,\n 'is-loading': props.loading,\n 'is-open': isOpen.value,\n },\n attrs.class,\n]);\n\n// Nearest ancestor that can clip the listbox (scroll container or hidden overflow).\nconst findClippingAncestor = (element: HTMLElement): HTMLElement | null => {\n let parent = element.parentElement;\n while (parent && parent !== document.body) {\n const { overflowY } = window.getComputedStyle(parent);\n if (overflowY === 'auto' || overflowY === 'scroll' || overflowY === 'hidden') {\n return parent;\n }\n parent = parent.parentElement;\n }\n return null;\n};\n\n// Flip the listbox above the trigger when its rendered position overflows the\n// nearest clipping ancestor (e.g. a modal body) or the viewport, and there is\n// more room above the trigger than below it. Measuring the rendered rect keeps\n// the decision in sync with the CSS offset (--tree-space-2) automatically.\nconst updateDropDirection = () => {\n const trigger = triggerRef.value;\n const listbox = listboxRef.value;\n if (!trigger || !listbox) {\n dropUp.value = false;\n return;\n }\n const triggerRect = trigger.getBoundingClientRect();\n const listboxRect = listbox.getBoundingClientRect();\n const boundary = findClippingAncestor(trigger)?.getBoundingClientRect();\n const bottomLimit = Math.min(boundary?.bottom ?? Infinity, window.innerHeight);\n const topLimit = Math.max(boundary?.top ?? 0, 0);\n const spaceBelow = bottomLimit - triggerRect.bottom;\n const spaceAbove = triggerRect.top - topLimit;\n dropUp.value = listboxRect.bottom > bottomLimit && spaceAbove > spaceBelow;\n};\n\nconst rootStyle = computed(() => attrs.style);\n\nconst selectedLabel = computed(() => {\n const opt = props.options.find((o) => o.value === props.modelValue);\n return opt?.label ?? '';\n});\n\nconst enabledOptions = computed(() =>\n props.options.filter((o) => !o.disabled),\n);\n\nconst openDropdown = () => {\n if (props.disabled) return;\n const selectedIdx = props.options.findIndex((o) => o.value === props.modelValue);\n focusedIndex.value = selectedIdx >= 0 ? selectedIdx : 0;\n // Render downward first so the measurement always starts from the default position.\n dropUp.value = false;\n setValue(true);\n nextTick(() => {\n updateDropDirection();\n focusOption(focusedIndex.value);\n });\n};\n\nconst closeDropdown = (restoreFocus = false) => {\n setValue(false);\n focusedIndex.value = -1;\n if (restoreFocus) {\n nextTick(() => triggerRef.value?.focus());\n }\n};\n\nconst toggleDropdown = () => {\n if (isOpen.value) {\n closeDropdown();\n } else {\n openDropdown();\n }\n};\n\nconst selectOption = (opt: TSelectOption) => {\n if (opt.disabled) return;\n emit('update:modelValue', opt.value);\n closeDropdown(true);\n};\n\nconst focusOption = (index: number) => {\n const opt = props.options[index];\n if (!opt) return;\n const el = optionRefs.value.get(opt.value);\n el?.focus();\n};\n\nconst setOptionRef = (el: Element | null, value: string | number) => {\n if (el instanceof HTMLElement) {\n optionRefs.value.set(value, el);\n } else {\n optionRefs.value.delete(value);\n }\n};\n\nconst moveFocus = (direction: 1 | -1) => {\n let nextIndex = focusedIndex.value + direction;\n while (nextIndex >= 0 && nextIndex < props.options.length) {\n if (!props.options[nextIndex].disabled) {\n focusedIndex.value = nextIndex;\n focusOption(nextIndex);\n return;\n }\n nextIndex += direction;\n }\n};\n\nconst onTriggerKeydown = (event: KeyboardEvent) => {\n if (props.disabled) return;\n\n if (isEscapeKey(event) && isOpen.value) {\n event.preventDefault();\n closeDropdown();\n return;\n }\n\n if (isActivationKey(event) || event.key === 'ArrowDown' || event.key === 'ArrowUp') {\n event.preventDefault();\n openDropdown();\n }\n};\n\nconst onOptionKeydown = (event: KeyboardEvent, opt: TSelectOption, _index: number) => {\n if (isEscapeKey(event)) {\n event.preventDefault();\n closeDropdown(true);\n return;\n }\n\n if (isActivationKey(event)) {\n event.preventDefault();\n selectOption(opt);\n return;\n }\n\n switch (event.key) {\n case 'ArrowDown':\n event.preventDefault();\n moveFocus(1);\n break;\n case 'ArrowUp':\n event.preventDefault();\n moveFocus(-1);\n break;\n case 'Home':\n event.preventDefault();\n focusedIndex.value = enabledOptions.value.length > 0\n ? props.options.indexOf(enabledOptions.value[0])\n : 0;\n focusOption(focusedIndex.value);\n break;\n case 'End':\n event.preventDefault();\n focusedIndex.value = enabledOptions.value.length > 0\n ? props.options.indexOf(enabledOptions.value[enabledOptions.value.length - 1])\n : props.options.length - 1;\n focusOption(focusedIndex.value);\n break;\n default:\n break;\n }\n};\n\nconst onDocumentPointerDown = (event: PointerEvent) => {\n if (!isOpen.value) return;\n const target = event.target;\n if (!(target instanceof Node)) return;\n if (rootRef.value?.contains(target)) return;\n closeDropdown();\n};\n\nconst hasSelection = computed(() =>\n props.modelValue !== '' && props.modelValue !== null && props.modelValue !== undefined,\n);\n\nwatch(isOpen, (value) => {\n if (value) {\n document.addEventListener('pointerdown', onDocumentPointerDown);\n } else {\n document.removeEventListener('pointerdown', onDocumentPointerDown);\n }\n});\n\nonBeforeUnmount(() => {\n document.removeEventListener('pointerdown', onDocumentPointerDown);\n});\n</script>\n\n<template>\n <div\n ref=\"rootRef\"\n :class=\"rootClasses\"\n :style=\"rootStyle\"\n :data-state=\"isOpen ? 'open' : 'closed'\"\n >\n <button\n ref=\"triggerRef\"\n v-bind=\"triggerAttrs\"\n type=\"button\"\n class=\"t-select__trigger\"\n :disabled=\"disabled\"\n :aria-controls=\"isOpen ? listboxId : undefined\"\n aria-haspopup=\"listbox\"\n :aria-expanded=\"isOpen\"\n :aria-invalid=\"invalid || undefined\"\n :aria-busy=\"loading || undefined\"\n @click=\"toggleDropdown\"\n @keydown=\"onTriggerKeydown\"\n >\n <span\n v-if=\"$slots.prefix\"\n class=\"t-select__slot t-select__slot--prefix\"\n >\n <slot name=\"prefix\" />\n </span>\n <span\n class=\"t-select__value\"\n :data-placeholder=\"!hasSelection ? true : undefined\"\n >\n {{ selectedLabel || placeholder }}\n </span>\n <TSpinner\n v-if=\"loading\"\n size=\"sm\"\n label=\"Loading\"\n />\n <svg\n v-else\n class=\"t-select__chevron\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <polyline points=\"4 6 8 10 12 6\" />\n </svg>\n </button>\n <transition name=\"t-fade\">\n <ul\n v-if=\"isOpen && !disabled\"\n :id=\"listboxId\"\n ref=\"listboxRef\"\n role=\"listbox\"\n class=\"t-select__listbox\"\n :aria-label=\"typeof triggerAttrs['aria-label'] === 'string' ? triggerAttrs['aria-label'] : undefined\"\n >\n <li\n v-for=\"(opt, index) in options\"\n :key=\"opt.value\"\n :ref=\"(el) => setOptionRef(el as Element | null, opt.value)\"\n role=\"option\"\n class=\"t-select__option\"\n :class=\"{\n 'is-selected': opt.value === modelValue,\n 'is-disabled': opt.disabled,\n 'is-focused': index === focusedIndex,\n }\"\n :aria-selected=\"opt.value === modelValue\"\n :aria-disabled=\"opt.disabled || undefined\"\n :tabindex=\"opt.disabled ? -1 : 0\"\n @click=\"selectOption(opt)\"\n @keydown=\"onOptionKeydown($event, opt, index)\"\n >\n {{ opt.label }}\n <svg\n v-if=\"opt.value === modelValue\"\n class=\"t-select__check\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <polyline points=\"3.5 8.5 6.5 11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G,EAAA,CAAA,KAAM,CAAK,EAAA,YAAA,EAAA,GADnB,EAwCK,MAAA;;IAtCF,IAAI,EAAA,CAAA;aACD;IAAJ,KAAI;IACJ,MAAK;IACL,OAAM;IACL,cAAU,OAAS,EAAA,MAAY,iBAAA,WAA8B,EAAA,MAAY,gBAAiB,KAAA;eAE3F,EA+BK,GAAA,MAAA,GA9BoB,EAAA,UAAf,GAAK,YADf,EA+BK,MAAA;IA7BF,KAAK,EAAI;;IACT,MAAM,MAAO,GAAa,GAAsB,EAAI,KAAK;IAC1D,MAAK;IACL,OAAK,EAAA,CAAC,oBAAkB;oBACa,EAAI,UAAU,EAAA;oBAAuC,EAAI;mBAAoC,MAAU,EAAA;;IAK3I,iBAAe,EAAI,UAAU,EAAA;IAC7B,iBAAe,EAAI,YAAY,KAAA;IAC/B,UAAU,EAAI,WAAQ,KAAA;IACtB,UAAK,MAAE,EAAa,CAAG;IACvB,YAAO,MAAE,GAAgB,GAAQ,GAAK,CAAK;WAEzC,EAAI,KAAK,IAAG,KACf,CAAA,GACQ,EAAI,UAAU,EAAA,cAAA,EAAA,GADtB,EAYM,OAZN,IAYM,CAAA,GAAA,AAAA,EAAA,OAAA,CADJ,EAA+C,YAAA,EAArC,QAAO,4BAA2B,GAAA,MAAA,EAAA,CAAA,CAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,GAAA,IAAA,EAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TSpacer.cjs","names":[],"sources":["../../src/components/TSpacer.vue"],"sourcesContent":["<script setup lang=\"ts\">\n// A flexible spacer that absorbs free space between siblings in a flex layout\n// (e.g. a TStack). Use it to push items apart or pin a trailing item to the end\n// without hand-writing `margin-*: auto` or `flex: 1`.\nwithDefaults(\n defineProps<{\n as?: string;\n }>(),\n {\n as: 'div',\n },\n);\n</script>\n\n<template>\n <component\n :is=\"as\"\n class=\"t-spacer\"\n aria-hidden=\"true\"\n />\n</template>\n"],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TSpacer.js","names":[],"sources":["../../src/components/TSpacer.vue"],"sourcesContent":["<script setup lang=\"ts\">\n// A flexible spacer that absorbs free space between siblings in a flex layout\n// (e.g. a TStack). Use it to push items apart or pin a trailing item to the end\n// without hand-writing `margin-*: auto` or `flex: 1`.\nwithDefaults(\n defineProps<{\n as?: string;\n }>(),\n {\n as: 'div',\n },\n);\n</script>\n\n<template>\n <component\n :is=\"as\"\n class=\"t-spacer\"\n aria-hidden=\"true\"\n />\n</template>\n"],"mappings":""}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
as?: string;
|
|
3
|
+
};
|
|
4
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
5
|
+
as: string;
|
|
6
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
7
|
+
export default _default;
|
|
8
|
+
//# sourceMappingURL=TSpacer.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TSpacer.vue.d.ts","sourceRoot":"","sources":["../../src/components/TSpacer.vue"],"names":[],"mappings":"AA0BA,KAAK,WAAW,GAAG;IACf,EAAE,CAAC,EAAE,MAAM,CAAC;CACb,CAAC;;QADK,MAAM;;AA2Df,wBAQG"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
let e=require("vue");var t=(0,e.defineComponent)({__name:`TSpacer`,props:{as:{default:`div`}},setup(t){return(n,r)=>((0,e.openBlock)(),(0,e.createBlock)((0,e.resolveDynamicComponent)(t.as),{class:`t-spacer`,"aria-hidden":`true`}))}});exports.default=t;
|
|
2
|
+
//# sourceMappingURL=TSpacer.vue_vue_type_script_setup_true_lang.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TSpacer.vue_vue_type_script_setup_true_lang.cjs","names":[],"sources":["../../src/components/TSpacer.vue"],"sourcesContent":["<script setup lang=\"ts\">\n// A flexible spacer that absorbs free space between siblings in a flex layout\n// (e.g. a TStack). Use it to push items apart or pin a trailing item to the end\n// without hand-writing `margin-*: auto` or `flex: 1`.\nwithDefaults(\n defineProps<{\n as?: string;\n }>(),\n {\n as: 'div',\n },\n);\n</script>\n\n<template>\n <component\n :is=\"as\"\n class=\"t-spacer\"\n aria-hidden=\"true\"\n />\n</template>\n"],"mappings":"uLAgBS,EAAA,EAAE,EAAA,CACP,MAAM,WACN,cAAY"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { createBlock as e, defineComponent as t, openBlock as n, resolveDynamicComponent as r } from "vue";
|
|
2
|
+
//#region src/components/TSpacer.vue?vue&type=script&setup=true&lang.ts
|
|
3
|
+
var i = /*@__PURE__*/ t({
|
|
4
|
+
__name: "TSpacer",
|
|
5
|
+
props: { as: { default: "div" } },
|
|
6
|
+
setup(t) {
|
|
7
|
+
return (i, a) => (n(), e(r(t.as), {
|
|
8
|
+
class: "t-spacer",
|
|
9
|
+
"aria-hidden": "true"
|
|
10
|
+
}));
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
//#endregion
|
|
14
|
+
export { i as default };
|
|
15
|
+
|
|
16
|
+
//# sourceMappingURL=TSpacer.vue_vue_type_script_setup_true_lang.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TSpacer.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../src/components/TSpacer.vue"],"sourcesContent":["<script setup lang=\"ts\">\n// A flexible spacer that absorbs free space between siblings in a flex layout\n// (e.g. a TStack). Use it to push items apart or pin a trailing item to the end\n// without hand-writing `margin-*: auto` or `flex: 1`.\nwithDefaults(\n defineProps<{\n as?: string;\n }>(),\n {\n as: 'div',\n },\n);\n</script>\n\n<template>\n <component\n :is=\"as\"\n class=\"t-spacer\"\n aria-hidden=\"true\"\n />\n</template>\n"],"mappings":";;;;;;yBAeE,EAIE,EAHK,EAAA,EAAE,GAAA;GACP,OAAM;GACN,eAAY"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TSplit.cjs","names":[],"sources":["../../src/components/TSplit.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, useAttrs } from 'vue';\n\ndefineOptions({\n inheritAttrs: false,\n});\n\nconst props = withDefaults(\n defineProps<{\n as?: string;\n gap?: string;\n /** Main pane grows this many times faster than the aside pane. */\n ratio?: number;\n /** Min width each pane keeps before the layout stacks to one column. */\n minWidth?: string;\n /** Which side the aside pane sits on when side-by-side. */\n side?: 'start' | 'end';\n /** Cross-axis alignment (align-items). */\n align?: string;\n }>(),\n {\n as: 'div',\n gap: 'var(--tree-space-5)',\n ratio: 2,\n minWidth: '18rem',\n side: 'end',\n align: 'start',\n },\n);\n\nconst attrs = useAttrs();\n\nconst rootClasses = computed(() => [\n 't-split',\n `t-split--${props.side}`,\n attrs.class,\n]);\n\nconst rootStyle = computed(() => [\n {\n '--tree-split-gap': props.gap,\n '--tree-split-ratio': String(props.ratio),\n '--tree-split-min': props.minWidth,\n '--tree-split-align': props.align,\n },\n attrs.style,\n]);\n\nconst rootAttrs = computed(() => {\n const { class: _class, style: _style, ...rest } = attrs;\n return rest;\n});\n</script>\n\n<template>\n <component\n :is=\"as\"\n v-bind=\"rootAttrs\"\n :class=\"rootClasses\"\n :style=\"rootStyle\"\n >\n <div class=\"t-split__main\">\n <slot />\n </div>\n <div\n v-if=\"$slots.aside\"\n class=\"t-split__aside\"\n >\n <slot name=\"aside\" />\n </div>\n </component>\n</template>\n"],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TSplit.js","names":[],"sources":["../../src/components/TSplit.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, useAttrs } from 'vue';\n\ndefineOptions({\n inheritAttrs: false,\n});\n\nconst props = withDefaults(\n defineProps<{\n as?: string;\n gap?: string;\n /** Main pane grows this many times faster than the aside pane. */\n ratio?: number;\n /** Min width each pane keeps before the layout stacks to one column. */\n minWidth?: string;\n /** Which side the aside pane sits on when side-by-side. */\n side?: 'start' | 'end';\n /** Cross-axis alignment (align-items). */\n align?: string;\n }>(),\n {\n as: 'div',\n gap: 'var(--tree-space-5)',\n ratio: 2,\n minWidth: '18rem',\n side: 'end',\n align: 'start',\n },\n);\n\nconst attrs = useAttrs();\n\nconst rootClasses = computed(() => [\n 't-split',\n `t-split--${props.side}`,\n attrs.class,\n]);\n\nconst rootStyle = computed(() => [\n {\n '--tree-split-gap': props.gap,\n '--tree-split-ratio': String(props.ratio),\n '--tree-split-min': props.minWidth,\n '--tree-split-align': props.align,\n },\n attrs.style,\n]);\n\nconst rootAttrs = computed(() => {\n const { class: _class, style: _style, ...rest } = attrs;\n return rest;\n});\n</script>\n\n<template>\n <component\n :is=\"as\"\n v-bind=\"rootAttrs\"\n :class=\"rootClasses\"\n :style=\"rootStyle\"\n >\n <div class=\"t-split__main\">\n <slot />\n </div>\n <div\n v-if=\"$slots.aside\"\n class=\"t-split__aside\"\n >\n <slot name=\"aside\" />\n </div>\n </component>\n</template>\n"],"mappings":""}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
as?: string;
|
|
3
|
+
gap?: string;
|
|
4
|
+
/** Main pane grows this many times faster than the aside pane. */
|
|
5
|
+
ratio?: number;
|
|
6
|
+
/** Min width each pane keeps before the layout stacks to one column. */
|
|
7
|
+
minWidth?: string;
|
|
8
|
+
/** Which side the aside pane sits on when side-by-side. */
|
|
9
|
+
side?: 'start' | 'end';
|
|
10
|
+
/** Cross-axis alignment (align-items). */
|
|
11
|
+
align?: string;
|
|
12
|
+
};
|
|
13
|
+
declare function __VLS_template(): {
|
|
14
|
+
attrs: Partial<{}>;
|
|
15
|
+
slots: {
|
|
16
|
+
default?(_: {}): any;
|
|
17
|
+
aside?(_: {}): any;
|
|
18
|
+
};
|
|
19
|
+
refs: {};
|
|
20
|
+
rootEl: any;
|
|
21
|
+
};
|
|
22
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
23
|
+
declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
24
|
+
gap: string;
|
|
25
|
+
as: string;
|
|
26
|
+
align: string;
|
|
27
|
+
side: "start" | "end";
|
|
28
|
+
minWidth: string;
|
|
29
|
+
ratio: number;
|
|
30
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
31
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
32
|
+
export default _default;
|
|
33
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
34
|
+
new (): {
|
|
35
|
+
$slots: S;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
//# sourceMappingURL=TSplit.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TSplit.vue.d.ts","sourceRoot":"","sources":["../../src/components/TSplit.vue"],"names":[],"mappings":"AAgFA,KAAK,WAAW,GAAG;IACf,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,kEAAkE;IAClE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,wEAAwE;IACxE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,2DAA2D;IAC3D,IAAI,CAAC,EAAE,OAAO,GAAG,KAAK,CAAC;IACvB,0CAA0C;IAC1C,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AA8CJ,iBAAS,cAAc;WA8CT,OAAO,IAA6B;;yBAXrB,GAAG;uBACL,GAAG;;;;EAe7B;AAYD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;SAvHX,MAAM;QADP,MAAM;WASH,MAAM;UAFP,OAAO,GAAG,KAAK;cAFX,MAAM;WAFT,MAAM;6EA4HhB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAapG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
let e=require("vue");var t={class:`t-split__main`},n={key:0,class:`t-split__aside`},r=(0,e.defineComponent)({inheritAttrs:!1,__name:`TSplit`,props:{as:{default:`div`},gap:{default:`var(--tree-space-5)`},ratio:{default:2},minWidth:{default:`18rem`},side:{default:`end`},align:{default:`start`}},setup(r){let i=r,a=(0,e.useAttrs)(),o=(0,e.computed)(()=>[`t-split`,`t-split--${i.side}`,a.class]),s=(0,e.computed)(()=>[{"--tree-split-gap":i.gap,"--tree-split-ratio":String(i.ratio),"--tree-split-min":i.minWidth,"--tree-split-align":i.align},a.style]),c=(0,e.computed)(()=>{let{class:e,style:t,...n}=a;return n});return(i,a)=>((0,e.openBlock)(),(0,e.createBlock)((0,e.resolveDynamicComponent)(r.as),(0,e.mergeProps)(c.value,{class:o.value,style:s.value}),{default:(0,e.withCtx)(()=>[(0,e.createElementVNode)(`div`,t,[(0,e.renderSlot)(i.$slots,`default`)]),i.$slots.aside?((0,e.openBlock)(),(0,e.createElementBlock)(`div`,n,[(0,e.renderSlot)(i.$slots,`aside`)])):(0,e.createCommentVNode)(``,!0)]),_:3},16,[`class`,`style`]))}});exports.default=r;
|
|
2
|
+
//# sourceMappingURL=TSplit.vue_vue_type_script_setup_true_lang.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TSplit.vue_vue_type_script_setup_true_lang.cjs","names":["$slots"],"sources":["../../src/components/TSplit.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, useAttrs } from 'vue';\n\ndefineOptions({\n inheritAttrs: false,\n});\n\nconst props = withDefaults(\n defineProps<{\n as?: string;\n gap?: string;\n /** Main pane grows this many times faster than the aside pane. */\n ratio?: number;\n /** Min width each pane keeps before the layout stacks to one column. */\n minWidth?: string;\n /** Which side the aside pane sits on when side-by-side. */\n side?: 'start' | 'end';\n /** Cross-axis alignment (align-items). */\n align?: string;\n }>(),\n {\n as: 'div',\n gap: 'var(--tree-space-5)',\n ratio: 2,\n minWidth: '18rem',\n side: 'end',\n align: 'start',\n },\n);\n\nconst attrs = useAttrs();\n\nconst rootClasses = computed(() => [\n 't-split',\n `t-split--${props.side}`,\n attrs.class,\n]);\n\nconst rootStyle = computed(() => [\n {\n '--tree-split-gap': props.gap,\n '--tree-split-ratio': String(props.ratio),\n '--tree-split-min': props.minWidth,\n '--tree-split-align': props.align,\n },\n attrs.style,\n]);\n\nconst rootAttrs = computed(() => {\n const { class: _class, style: _style, ...rest } = attrs;\n return rest;\n});\n</script>\n\n<template>\n <component\n :is=\"as\"\n v-bind=\"rootAttrs\"\n :class=\"rootClasses\"\n :style=\"rootStyle\"\n >\n <div class=\"t-split__main\">\n <slot />\n </div>\n <div\n v-if=\"$slots.aside\"\n class=\"t-split__aside\"\n >\n <slot name=\"aside\" />\n </div>\n </component>\n</template>\n"],"mappings":"+SAOA,IAAM,EAAQ,EAuBR,GAAA,EAAA,EAAA,SAAA,CAAiB,EAEjB,GAAA,EAAA,EAAA,SAAA,KAA6B,CACjC,UACA,YAAY,EAAM,OAClB,EAAM,KACR,CAAC,EAEK,GAAA,EAAA,EAAA,SAAA,KAA2B,CAC/B,CACE,mBAAoB,EAAM,IAC1B,qBAAsB,OAAO,EAAM,KAAK,EACxC,mBAAoB,EAAM,SAC1B,qBAAsB,EAAM,KAC9B,EACA,EAAM,KACR,CAAC,EAEK,GAAA,EAAA,EAAA,SAAA,KAA2B,CAC/B,GAAM,CAAE,MAAO,EAAQ,MAAO,EAAQ,GAAG,GAAS,EAClD,OAAO,CACT,CAAC,kFAKQ,EAAA,EAAE,GAAA,EAAA,EAAA,WAAA,CACC,EAaE,MAbO,CAChB,MAAO,EAAA,MACP,MAAO,EAAA,mCAIF,EAAA,EAAA,EAAA,mBAAA,CAAA,MAFN,EAEM,EAAA,EAAA,EAAA,WAAA,CADI,EAAA,OAAA,SAAA,CAAA,CAAA,EAGFA,EAAAA,OAAO,QAAA,EAAA,EAAA,UAAA,CAAA,GAAA,EAAA,EAAA,mBAAA,CAIT,MALN,EAKM,EAAA,EAAA,EAAA,WAAA,CADiB,EAAA,OAAA,OAAA,CAAA,CAAA,IAAA,EAAA,EAAA,mBAAA,CAAA,GAAA,EAAA,CAAA,CAAA"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { computed as e, createBlock as t, createCommentVNode as n, createElementBlock as r, createElementVNode as i, defineComponent as a, mergeProps as o, openBlock as s, renderSlot as c, resolveDynamicComponent as l, useAttrs as u, withCtx as d } from "vue";
|
|
2
|
+
//#region src/components/TSplit.vue?vue&type=script&setup=true&lang.ts
|
|
3
|
+
var f = { class: "t-split__main" }, p = {
|
|
4
|
+
key: 0,
|
|
5
|
+
class: "t-split__aside"
|
|
6
|
+
}, m = /*@__PURE__*/ a({
|
|
7
|
+
inheritAttrs: !1,
|
|
8
|
+
__name: "TSplit",
|
|
9
|
+
props: {
|
|
10
|
+
as: { default: "div" },
|
|
11
|
+
gap: { default: "var(--tree-space-5)" },
|
|
12
|
+
ratio: { default: 2 },
|
|
13
|
+
minWidth: { default: "18rem" },
|
|
14
|
+
side: { default: "end" },
|
|
15
|
+
align: { default: "start" }
|
|
16
|
+
},
|
|
17
|
+
setup(a) {
|
|
18
|
+
let m = a, h = u(), g = e(() => [
|
|
19
|
+
"t-split",
|
|
20
|
+
`t-split--${m.side}`,
|
|
21
|
+
h.class
|
|
22
|
+
]), _ = e(() => [{
|
|
23
|
+
"--tree-split-gap": m.gap,
|
|
24
|
+
"--tree-split-ratio": String(m.ratio),
|
|
25
|
+
"--tree-split-min": m.minWidth,
|
|
26
|
+
"--tree-split-align": m.align
|
|
27
|
+
}, h.style]), v = e(() => {
|
|
28
|
+
let { class: e, style: t, ...n } = h;
|
|
29
|
+
return n;
|
|
30
|
+
});
|
|
31
|
+
return (e, u) => (s(), t(l(a.as), o(v.value, {
|
|
32
|
+
class: g.value,
|
|
33
|
+
style: _.value
|
|
34
|
+
}), {
|
|
35
|
+
default: d(() => [i("div", f, [c(e.$slots, "default")]), e.$slots.aside ? (s(), r("div", p, [c(e.$slots, "aside")])) : n("", !0)]),
|
|
36
|
+
_: 3
|
|
37
|
+
}, 16, ["class", "style"]));
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
//#endregion
|
|
41
|
+
export { m as default };
|
|
42
|
+
|
|
43
|
+
//# sourceMappingURL=TSplit.vue_vue_type_script_setup_true_lang.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TSplit.vue_vue_type_script_setup_true_lang.js","names":["$slots"],"sources":["../../src/components/TSplit.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, useAttrs } from 'vue';\n\ndefineOptions({\n inheritAttrs: false,\n});\n\nconst props = withDefaults(\n defineProps<{\n as?: string;\n gap?: string;\n /** Main pane grows this many times faster than the aside pane. */\n ratio?: number;\n /** Min width each pane keeps before the layout stacks to one column. */\n minWidth?: string;\n /** Which side the aside pane sits on when side-by-side. */\n side?: 'start' | 'end';\n /** Cross-axis alignment (align-items). */\n align?: string;\n }>(),\n {\n as: 'div',\n gap: 'var(--tree-space-5)',\n ratio: 2,\n minWidth: '18rem',\n side: 'end',\n align: 'start',\n },\n);\n\nconst attrs = useAttrs();\n\nconst rootClasses = computed(() => [\n 't-split',\n `t-split--${props.side}`,\n attrs.class,\n]);\n\nconst rootStyle = computed(() => [\n {\n '--tree-split-gap': props.gap,\n '--tree-split-ratio': String(props.ratio),\n '--tree-split-min': props.minWidth,\n '--tree-split-align': props.align,\n },\n attrs.style,\n]);\n\nconst rootAttrs = computed(() => {\n const { class: _class, style: _style, ...rest } = attrs;\n return rest;\n});\n</script>\n\n<template>\n <component\n :is=\"as\"\n v-bind=\"rootAttrs\"\n :class=\"rootClasses\"\n :style=\"rootStyle\"\n >\n <div class=\"t-split__main\">\n <slot />\n </div>\n <div\n v-if=\"$slots.aside\"\n class=\"t-split__aside\"\n >\n <slot name=\"aside\" />\n </div>\n </component>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;EAOA,IAAM,IAAQ,GAuBR,IAAQ,EAAS,GAEjB,IAAc,QAAe;GACjC;GACA,YAAY,EAAM;GAClB,EAAM;EACR,CAAC,GAEK,IAAY,QAAe,CAC/B;GACE,oBAAoB,EAAM;GAC1B,sBAAsB,OAAO,EAAM,KAAK;GACxC,oBAAoB,EAAM;GAC1B,sBAAsB,EAAM;EAC9B,GACA,EAAM,KACR,CAAC,GAEK,IAAY,QAAe;GAC/B,IAAM,EAAE,OAAO,GAAQ,OAAO,GAAQ,GAAG,MAAS;GAClD,OAAO;EACT,CAAC;yBAIC,EAeY,EAdL,EAAA,EAAE,GADT,EAEU,EAaE,OAbO;GAChB,OAAO,EAAA;GACP,OAAO,EAAA;;oBAIF,CAFN,EAEM,OAFN,GAEM,CADJ,EAAQ,EAAA,QAAA,SAAA,CAAA,CAAA,GAGFA,EAAAA,OAAO,SAAA,EAAA,GADf,EAKM,OALN,GAKM,CADJ,EAAqB,EAAA,QAAA,OAAA,CAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TStack.cjs","names":[],"sources":["../../src/components/TStack.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, useAttrs } from 'vue';\n\ndefineOptions({\n inheritAttrs: false,\n});\n\nconst _treeStackDirections = ['vertical', 'horizontal'] as const;\n\nexport type TStackDirection = (typeof _treeStackDirections)[number];\n\nconst props = withDefaults(\n defineProps<{\n as?: string;\n direction?: TStackDirection;\n gap?: string;\n align?: string;\n justify?: string;\n wrap?: boolean;\n reverse?: boolean;\n }>(),\n {\n as: 'div',\n direction: 'vertical',\n gap: 'var(--tree-space-4)',\n align: 'stretch',\n justify: 'flex-start',\n wrap: false,\n reverse: false,\n },\n);\n\nconst attrs = useAttrs();\n\nconst rootClasses = computed(() => [\n 't-stack',\n `t-stack--${props.direction}`,\n {\n 'is-wrapping': props.wrap,\n 'is-reversed': props.reverse,\n },\n attrs.class,\n]);\n\nconst rootStyle = computed(() => [\n {\n gap: props.gap,\n alignItems: props.align,\n justifyContent: props.justify,\n },\n attrs.style,\n]);\n\nconst rootAttrs = computed(() => {\n const { class: _class, style: _style, ...rest } = attrs;\n return rest;\n});\n</script>\n\n<template>\n <component\n :is=\"as\"\n v-bind=\"rootAttrs\"\n :class=\"rootClasses\"\n :style=\"rootStyle\"\n >\n <slot />\n </component>\n</template>\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"TStack.cjs","names":[],"sources":["../../src/components/TStack.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, useAttrs } from 'vue';\n\ndefineOptions({\n inheritAttrs: false,\n});\n\nconst _treeStackDirections = ['vertical', 'horizontal'] as const;\n\nexport type TStackDirection = (typeof _treeStackDirections)[number];\n\nconst props = withDefaults(\n defineProps<{\n as?: string;\n direction?: TStackDirection;\n gap?: string;\n align?: string;\n justify?: string;\n wrap?: boolean;\n reverse?: boolean;\n /** Expand to fill available space along the parent's main axis. */\n grow?: boolean;\n }>(),\n {\n as: 'div',\n direction: 'vertical',\n gap: 'var(--tree-space-4)',\n align: 'stretch',\n justify: 'flex-start',\n wrap: false,\n reverse: false,\n grow: false,\n },\n);\n\nconst attrs = useAttrs();\n\nconst rootClasses = computed(() => [\n 't-stack',\n `t-stack--${props.direction}`,\n {\n 'is-wrapping': props.wrap,\n 'is-reversed': props.reverse,\n 'is-grow': props.grow,\n },\n attrs.class,\n]);\n\nconst rootStyle = computed(() => [\n {\n gap: props.gap,\n alignItems: props.align,\n justifyContent: props.justify,\n },\n attrs.style,\n]);\n\nconst rootAttrs = computed(() => {\n const { class: _class, style: _style, ...rest } = attrs;\n return rest;\n});\n</script>\n\n<template>\n <component\n :is=\"as\"\n v-bind=\"rootAttrs\"\n :class=\"rootClasses\"\n :style=\"rootStyle\"\n >\n <slot />\n </component>\n</template>\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TStack.js","names":[],"sources":["../../src/components/TStack.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, useAttrs } from 'vue';\n\ndefineOptions({\n inheritAttrs: false,\n});\n\nconst _treeStackDirections = ['vertical', 'horizontal'] as const;\n\nexport type TStackDirection = (typeof _treeStackDirections)[number];\n\nconst props = withDefaults(\n defineProps<{\n as?: string;\n direction?: TStackDirection;\n gap?: string;\n align?: string;\n justify?: string;\n wrap?: boolean;\n reverse?: boolean;\n }>(),\n {\n as: 'div',\n direction: 'vertical',\n gap: 'var(--tree-space-4)',\n align: 'stretch',\n justify: 'flex-start',\n wrap: false,\n reverse: false,\n },\n);\n\nconst attrs = useAttrs();\n\nconst rootClasses = computed(() => [\n 't-stack',\n `t-stack--${props.direction}`,\n {\n 'is-wrapping': props.wrap,\n 'is-reversed': props.reverse,\n },\n attrs.class,\n]);\n\nconst rootStyle = computed(() => [\n {\n gap: props.gap,\n alignItems: props.align,\n justifyContent: props.justify,\n },\n attrs.style,\n]);\n\nconst rootAttrs = computed(() => {\n const { class: _class, style: _style, ...rest } = attrs;\n return rest;\n});\n</script>\n\n<template>\n <component\n :is=\"as\"\n v-bind=\"rootAttrs\"\n :class=\"rootClasses\"\n :style=\"rootStyle\"\n >\n <slot />\n </component>\n</template>\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"TStack.js","names":[],"sources":["../../src/components/TStack.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, useAttrs } from 'vue';\n\ndefineOptions({\n inheritAttrs: false,\n});\n\nconst _treeStackDirections = ['vertical', 'horizontal'] as const;\n\nexport type TStackDirection = (typeof _treeStackDirections)[number];\n\nconst props = withDefaults(\n defineProps<{\n as?: string;\n direction?: TStackDirection;\n gap?: string;\n align?: string;\n justify?: string;\n wrap?: boolean;\n reverse?: boolean;\n /** Expand to fill available space along the parent's main axis. */\n grow?: boolean;\n }>(),\n {\n as: 'div',\n direction: 'vertical',\n gap: 'var(--tree-space-4)',\n align: 'stretch',\n justify: 'flex-start',\n wrap: false,\n reverse: false,\n grow: false,\n },\n);\n\nconst attrs = useAttrs();\n\nconst rootClasses = computed(() => [\n 't-stack',\n `t-stack--${props.direction}`,\n {\n 'is-wrapping': props.wrap,\n 'is-reversed': props.reverse,\n 'is-grow': props.grow,\n },\n attrs.class,\n]);\n\nconst rootStyle = computed(() => [\n {\n gap: props.gap,\n alignItems: props.align,\n justifyContent: props.justify,\n },\n attrs.style,\n]);\n\nconst rootAttrs = computed(() => {\n const { class: _class, style: _style, ...rest } = attrs;\n return rest;\n});\n</script>\n\n<template>\n <component\n :is=\"as\"\n v-bind=\"rootAttrs\"\n :class=\"rootClasses\"\n :style=\"rootStyle\"\n >\n <slot />\n </component>\n</template>\n"],"mappings":""}
|
|
@@ -8,6 +8,8 @@ type __VLS_Props = {
|
|
|
8
8
|
justify?: string;
|
|
9
9
|
wrap?: boolean;
|
|
10
10
|
reverse?: boolean;
|
|
11
|
+
/** Expand to fill available space along the parent's main axis. */
|
|
12
|
+
grow?: boolean;
|
|
11
13
|
};
|
|
12
14
|
declare function __VLS_template(): {
|
|
13
15
|
attrs: Partial<{}>;
|
|
@@ -26,6 +28,7 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}
|
|
|
26
28
|
justify: string;
|
|
27
29
|
wrap: boolean;
|
|
28
30
|
direction: TStackDirection;
|
|
31
|
+
grow: boolean;
|
|
29
32
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
30
33
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
31
34
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TStack.vue.d.ts","sourceRoot":"","sources":["../../src/components/TStack.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TStack.vue.d.ts","sourceRoot":"","sources":["../../src/components/TStack.vue"],"names":[],"mappings":"AAiFA,QAAA,MAAM,oBAAoB,qCAAsC,CAAC;AAEjE,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEpE,KAAK,WAAW,GAAG;IACf,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,SAAS,CAAC,EAAE,eAAe,CAAC;IAC5B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,mEAAmE;IACnE,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB,CAAC;AAsDJ,iBAAS,cAAc;WAkCT,OAAO,IAA6B;;yBAVrB,GAAG;;;;EAe/B;AAYD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;aA7GP,OAAO;SAJX,MAAM;QAFP,MAAM;WAGH,MAAM;aACJ,MAAM;UACT,OAAO;eAJF,eAAe;UAOpB,OAAO;6EAkHhB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAapG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
let e=require("vue");var t=(0,e.defineComponent)({inheritAttrs:!1,__name:`TStack`,props:{as:{default:`div`},direction:{default:`vertical`},gap:{default:`var(--tree-space-4)`},align:{default:`stretch`},justify:{default:`flex-start`},wrap:{type:Boolean,default:!1},reverse:{type:Boolean,default:!1}},setup(t){let n=t,r=(0,e.useAttrs)(),i=(0,e.computed)(()=>[`t-stack`,`t-stack--${n.direction}`,{"is-wrapping":n.wrap,"is-reversed":n.reverse},r.class]),a=(0,e.computed)(()=>[{gap:n.gap,alignItems:n.align,justifyContent:n.justify},r.style]),o=(0,e.computed)(()=>{let{class:e,style:t,...n}=r;return n});return(n,r)=>((0,e.openBlock)(),(0,e.createBlock)((0,e.resolveDynamicComponent)(t.as),(0,e.mergeProps)(o.value,{class:i.value,style:a.value}),{default:(0,e.withCtx)(()=>[(0,e.renderSlot)(n.$slots,`default`)]),_:3},16,[`class`,`style`]))}});exports.default=t;
|
|
1
|
+
let e=require("vue");var t=(0,e.defineComponent)({inheritAttrs:!1,__name:`TStack`,props:{as:{default:`div`},direction:{default:`vertical`},gap:{default:`var(--tree-space-4)`},align:{default:`stretch`},justify:{default:`flex-start`},wrap:{type:Boolean,default:!1},reverse:{type:Boolean,default:!1},grow:{type:Boolean,default:!1}},setup(t){let n=t,r=(0,e.useAttrs)(),i=(0,e.computed)(()=>[`t-stack`,`t-stack--${n.direction}`,{"is-wrapping":n.wrap,"is-reversed":n.reverse,"is-grow":n.grow},r.class]),a=(0,e.computed)(()=>[{gap:n.gap,alignItems:n.align,justifyContent:n.justify},r.style]),o=(0,e.computed)(()=>{let{class:e,style:t,...n}=r;return n});return(n,r)=>((0,e.openBlock)(),(0,e.createBlock)((0,e.resolveDynamicComponent)(t.as),(0,e.mergeProps)(o.value,{class:i.value,style:a.value}),{default:(0,e.withCtx)(()=>[(0,e.renderSlot)(n.$slots,`default`)]),_:3},16,[`class`,`style`]))}});exports.default=t;
|
|
2
2
|
//# sourceMappingURL=TStack.vue_vue_type_script_setup_true_lang.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TStack.vue_vue_type_script_setup_true_lang.cjs","names":[],"sources":["../../src/components/TStack.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, useAttrs } from 'vue';\n\ndefineOptions({\n inheritAttrs: false,\n});\n\nconst _treeStackDirections = ['vertical', 'horizontal'] as const;\n\nexport type TStackDirection = (typeof _treeStackDirections)[number];\n\nconst props = withDefaults(\n defineProps<{\n as?: string;\n direction?: TStackDirection;\n gap?: string;\n align?: string;\n justify?: string;\n wrap?: boolean;\n reverse?: boolean;\n }>(),\n {\n as: 'div',\n direction: 'vertical',\n gap: 'var(--tree-space-4)',\n align: 'stretch',\n justify: 'flex-start',\n wrap: false,\n reverse: false,\n },\n);\n\nconst attrs = useAttrs();\n\nconst rootClasses = computed(() => [\n 't-stack',\n `t-stack--${props.direction}`,\n {\n 'is-wrapping': props.wrap,\n 'is-reversed': props.reverse,\n },\n attrs.class,\n]);\n\nconst rootStyle = computed(() => [\n {\n gap: props.gap,\n alignItems: props.align,\n justifyContent: props.justify,\n },\n attrs.style,\n]);\n\nconst rootAttrs = computed(() => {\n const { class: _class, style: _style, ...rest } = attrs;\n return rest;\n});\n</script>\n\n<template>\n <component\n :is=\"as\"\n v-bind=\"rootAttrs\"\n :class=\"rootClasses\"\n :style=\"rootStyle\"\n >\n <slot />\n </component>\n</template>\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"TStack.vue_vue_type_script_setup_true_lang.cjs","names":[],"sources":["../../src/components/TStack.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, useAttrs } from 'vue';\n\ndefineOptions({\n inheritAttrs: false,\n});\n\nconst _treeStackDirections = ['vertical', 'horizontal'] as const;\n\nexport type TStackDirection = (typeof _treeStackDirections)[number];\n\nconst props = withDefaults(\n defineProps<{\n as?: string;\n direction?: TStackDirection;\n gap?: string;\n align?: string;\n justify?: string;\n wrap?: boolean;\n reverse?: boolean;\n /** Expand to fill available space along the parent's main axis. */\n grow?: boolean;\n }>(),\n {\n as: 'div',\n direction: 'vertical',\n gap: 'var(--tree-space-4)',\n align: 'stretch',\n justify: 'flex-start',\n wrap: false,\n reverse: false,\n grow: false,\n },\n);\n\nconst attrs = useAttrs();\n\nconst rootClasses = computed(() => [\n 't-stack',\n `t-stack--${props.direction}`,\n {\n 'is-wrapping': props.wrap,\n 'is-reversed': props.reverse,\n 'is-grow': props.grow,\n },\n attrs.class,\n]);\n\nconst rootStyle = computed(() => [\n {\n gap: props.gap,\n alignItems: props.align,\n justifyContent: props.justify,\n },\n attrs.style,\n]);\n\nconst rootAttrs = computed(() => {\n const { class: _class, style: _style, ...rest } = attrs;\n return rest;\n});\n</script>\n\n<template>\n <component\n :is=\"as\"\n v-bind=\"rootAttrs\"\n :class=\"rootClasses\"\n :style=\"rootStyle\"\n >\n <slot />\n </component>\n</template>\n"],"mappings":"kVAWA,IAAM,EAAQ,EAwBR,GAAA,EAAA,EAAA,SAAA,CAAiB,EAEjB,GAAA,EAAA,EAAA,SAAA,KAA6B,CACjC,UACA,YAAY,EAAM,YAClB,CACE,cAAe,EAAM,KACrB,cAAe,EAAM,QACrB,UAAW,EAAM,IACnB,EACA,EAAM,KACR,CAAC,EAEK,GAAA,EAAA,EAAA,SAAA,KAA2B,CAC/B,CACE,IAAK,EAAM,IACX,WAAY,EAAM,MAClB,eAAgB,EAAM,OACxB,EACA,EAAM,KACR,CAAC,EAEK,GAAA,EAAA,EAAA,SAAA,KAA2B,CAC/B,GAAM,CAAE,MAAO,EAAQ,MAAO,EAAQ,GAAG,GAAS,EAClD,OAAO,CACT,CAAC,kFAKQ,EAAA,EAAE,GAAA,EAAA,EAAA,WAAA,CACC,EAKE,MALO,CAChB,MAAO,EAAA,MACP,MAAO,EAAA,mCAEA,EAAA,EAAA,EAAA,WAAA,CAAA,EAAA,OAAA,SAAA,CAAA,CAAA"}
|
|
@@ -16,6 +16,10 @@ var l = /*@__PURE__*/ n({
|
|
|
16
16
|
reverse: {
|
|
17
17
|
type: Boolean,
|
|
18
18
|
default: !1
|
|
19
|
+
},
|
|
20
|
+
grow: {
|
|
21
|
+
type: Boolean,
|
|
22
|
+
default: !1
|
|
19
23
|
}
|
|
20
24
|
},
|
|
21
25
|
setup(n) {
|
|
@@ -24,7 +28,8 @@ var l = /*@__PURE__*/ n({
|
|
|
24
28
|
`t-stack--${l.direction}`,
|
|
25
29
|
{
|
|
26
30
|
"is-wrapping": l.wrap,
|
|
27
|
-
"is-reversed": l.reverse
|
|
31
|
+
"is-reversed": l.reverse,
|
|
32
|
+
"is-grow": l.grow
|
|
28
33
|
},
|
|
29
34
|
u.class
|
|
30
35
|
]), f = e(() => [{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TStack.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../src/components/TStack.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, useAttrs } from 'vue';\n\ndefineOptions({\n inheritAttrs: false,\n});\n\nconst _treeStackDirections = ['vertical', 'horizontal'] as const;\n\nexport type TStackDirection = (typeof _treeStackDirections)[number];\n\nconst props = withDefaults(\n defineProps<{\n as?: string;\n direction?: TStackDirection;\n gap?: string;\n align?: string;\n justify?: string;\n wrap?: boolean;\n reverse?: boolean;\n }>(),\n {\n as: 'div',\n direction: 'vertical',\n gap: 'var(--tree-space-4)',\n align: 'stretch',\n justify: 'flex-start',\n wrap: false,\n reverse: false,\n },\n);\n\nconst attrs = useAttrs();\n\nconst rootClasses = computed(() => [\n 't-stack',\n `t-stack--${props.direction}`,\n {\n 'is-wrapping': props.wrap,\n 'is-reversed': props.reverse,\n },\n attrs.class,\n]);\n\nconst rootStyle = computed(() => [\n {\n gap: props.gap,\n alignItems: props.align,\n justifyContent: props.justify,\n },\n attrs.style,\n]);\n\nconst rootAttrs = computed(() => {\n const { class: _class, style: _style, ...rest } = attrs;\n return rest;\n});\n</script>\n\n<template>\n <component\n :is=\"as\"\n v-bind=\"rootAttrs\"\n :class=\"rootClasses\"\n :style=\"rootStyle\"\n >\n <slot />\n </component>\n</template>\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"TStack.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../src/components/TStack.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, useAttrs } from 'vue';\n\ndefineOptions({\n inheritAttrs: false,\n});\n\nconst _treeStackDirections = ['vertical', 'horizontal'] as const;\n\nexport type TStackDirection = (typeof _treeStackDirections)[number];\n\nconst props = withDefaults(\n defineProps<{\n as?: string;\n direction?: TStackDirection;\n gap?: string;\n align?: string;\n justify?: string;\n wrap?: boolean;\n reverse?: boolean;\n /** Expand to fill available space along the parent's main axis. */\n grow?: boolean;\n }>(),\n {\n as: 'div',\n direction: 'vertical',\n gap: 'var(--tree-space-4)',\n align: 'stretch',\n justify: 'flex-start',\n wrap: false,\n reverse: false,\n grow: false,\n },\n);\n\nconst attrs = useAttrs();\n\nconst rootClasses = computed(() => [\n 't-stack',\n `t-stack--${props.direction}`,\n {\n 'is-wrapping': props.wrap,\n 'is-reversed': props.reverse,\n 'is-grow': props.grow,\n },\n attrs.class,\n]);\n\nconst rootStyle = computed(() => [\n {\n gap: props.gap,\n alignItems: props.align,\n justifyContent: props.justify,\n },\n attrs.style,\n]);\n\nconst rootAttrs = computed(() => {\n const { class: _class, style: _style, ...rest } = attrs;\n return rest;\n});\n</script>\n\n<template>\n <component\n :is=\"as\"\n v-bind=\"rootAttrs\"\n :class=\"rootClasses\"\n :style=\"rootStyle\"\n >\n <slot />\n </component>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;EAWA,IAAM,IAAQ,GAwBR,IAAQ,EAAS,GAEjB,IAAc,QAAe;GACjC;GACA,YAAY,EAAM;GAClB;IACE,eAAe,EAAM;IACrB,eAAe,EAAM;IACrB,WAAW,EAAM;GACnB;GACA,EAAM;EACR,CAAC,GAEK,IAAY,QAAe,CAC/B;GACE,KAAK,EAAM;GACX,YAAY,EAAM;GAClB,gBAAgB,EAAM;EACxB,GACA,EAAM,KACR,CAAC,GAEK,IAAY,QAAe;GAC/B,IAAM,EAAE,OAAO,GAAQ,OAAO,GAAQ,GAAG,MAAS;GAClD,OAAO;EACT,CAAC;yBAIC,EAOY,EANL,EAAA,EAAE,GADT,EAEU,EAKE,OALO;GAChB,OAAO,EAAA;GACP,OAAO,EAAA;;oBAEA,CAAR,EAAQ,EAAA,QAAA,SAAA,CAAA,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TStackItem.cjs","names":[],"sources":["../../src/components/TStackItem.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, useAttrs } from 'vue';\n\ndefineOptions({\n inheritAttrs: false,\n});\n\nconst props = withDefaults(\n defineProps<{\n as?: string;\n /** Expand to fill free space. `true` = flex-grow 1; a number sets the factor. */\n grow?: boolean | number;\n /** Allow shrinking. `false` prevents it; a number sets the factor. */\n shrink?: boolean | number;\n /** flex-basis (initial main-axis size). */\n basis?: string;\n /** Minimum main-axis size before it wraps/shrinks. */\n minWidth?: string;\n /** Per-item cross-axis alignment (align-self). */\n align?: string;\n }>(),\n {\n as: 'div',\n grow: false,\n shrink: undefined,\n basis: undefined,\n minWidth: undefined,\n align: undefined,\n },\n);\n\nconst attrs = useAttrs();\n\nconst toFactor = (value: boolean | number | undefined, truthy: number, falsy: number) => {\n if (value === undefined) return undefined;\n if (value === true) return truthy;\n if (value === false) return falsy;\n return value;\n};\n\nconst rootStyle = computed(() => [\n {\n flexGrow: toFactor(props.grow, 1, 0),\n flexShrink: toFactor(props.shrink, 1, 0),\n flexBasis: props.basis,\n minInlineSize: props.minWidth,\n alignSelf: props.align,\n },\n attrs.style,\n]);\n\nconst rootAttrs = computed(() => {\n const { class: _class, style: _style, ...rest } = attrs;\n return rest;\n});\n</script>\n\n<template>\n <component\n :is=\"as\"\n v-bind=\"rootAttrs\"\n class=\"t-stack-item\"\n :class=\"attrs.class\"\n :style=\"rootStyle\"\n >\n <slot />\n </component>\n</template>\n"],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TStackItem.js","names":[],"sources":["../../src/components/TStackItem.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, useAttrs } from 'vue';\n\ndefineOptions({\n inheritAttrs: false,\n});\n\nconst props = withDefaults(\n defineProps<{\n as?: string;\n /** Expand to fill free space. `true` = flex-grow 1; a number sets the factor. */\n grow?: boolean | number;\n /** Allow shrinking. `false` prevents it; a number sets the factor. */\n shrink?: boolean | number;\n /** flex-basis (initial main-axis size). */\n basis?: string;\n /** Minimum main-axis size before it wraps/shrinks. */\n minWidth?: string;\n /** Per-item cross-axis alignment (align-self). */\n align?: string;\n }>(),\n {\n as: 'div',\n grow: false,\n shrink: undefined,\n basis: undefined,\n minWidth: undefined,\n align: undefined,\n },\n);\n\nconst attrs = useAttrs();\n\nconst toFactor = (value: boolean | number | undefined, truthy: number, falsy: number) => {\n if (value === undefined) return undefined;\n if (value === true) return truthy;\n if (value === false) return falsy;\n return value;\n};\n\nconst rootStyle = computed(() => [\n {\n flexGrow: toFactor(props.grow, 1, 0),\n flexShrink: toFactor(props.shrink, 1, 0),\n flexBasis: props.basis,\n minInlineSize: props.minWidth,\n alignSelf: props.align,\n },\n attrs.style,\n]);\n\nconst rootAttrs = computed(() => {\n const { class: _class, style: _style, ...rest } = attrs;\n return rest;\n});\n</script>\n\n<template>\n <component\n :is=\"as\"\n v-bind=\"rootAttrs\"\n class=\"t-stack-item\"\n :class=\"attrs.class\"\n :style=\"rootStyle\"\n >\n <slot />\n </component>\n</template>\n"],"mappings":""}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
as?: string;
|
|
3
|
+
/** Expand to fill free space. `true` = flex-grow 1; a number sets the factor. */
|
|
4
|
+
grow?: boolean | number;
|
|
5
|
+
/** Allow shrinking. `false` prevents it; a number sets the factor. */
|
|
6
|
+
shrink?: boolean | number;
|
|
7
|
+
/** flex-basis (initial main-axis size). */
|
|
8
|
+
basis?: string;
|
|
9
|
+
/** Minimum main-axis size before it wraps/shrinks. */
|
|
10
|
+
minWidth?: string;
|
|
11
|
+
/** Per-item cross-axis alignment (align-self). */
|
|
12
|
+
align?: string;
|
|
13
|
+
};
|
|
14
|
+
declare function __VLS_template(): {
|
|
15
|
+
attrs: Partial<{}>;
|
|
16
|
+
slots: {
|
|
17
|
+
default?(_: {}): any;
|
|
18
|
+
};
|
|
19
|
+
refs: {};
|
|
20
|
+
rootEl: any;
|
|
21
|
+
};
|
|
22
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
23
|
+
declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
24
|
+
as: string;
|
|
25
|
+
align: string;
|
|
26
|
+
grow: boolean | number;
|
|
27
|
+
shrink: boolean | number;
|
|
28
|
+
basis: string;
|
|
29
|
+
minWidth: string;
|
|
30
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
31
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
32
|
+
export default _default;
|
|
33
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
34
|
+
new (): {
|
|
35
|
+
$slots: S;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
//# sourceMappingURL=TStackItem.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TStackItem.vue.d.ts","sourceRoot":"","sources":["../../src/components/TStackItem.vue"],"names":[],"mappings":"AA4EA,KAAK,WAAW,GAAG;IACf,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,iFAAiF;IACjF,IAAI,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IACxB,sEAAsE;IACtE,MAAM,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IAC1B,2CAA2C;IAC3C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,sDAAsD;IACtD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,kDAAkD;IAClD,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAgDJ,iBAAS,cAAc;WAqCT,OAAO,IAA6B;;yBAVrB,GAAG;;;;EAe/B;AAYD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;QAlHZ,MAAM;WAUH,MAAM;UARP,OAAO,GAAG,MAAM;YAEd,OAAO,GAAG,MAAM;WAEjB,MAAM;cAEH,MAAM;6EAiHnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAapG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
let e=require("vue");var t=(0,e.defineComponent)({inheritAttrs:!1,__name:`TStackItem`,props:{as:{default:`div`},grow:{type:[Boolean,Number],default:!1},shrink:{type:[Boolean,Number],default:void 0},basis:{default:void 0},minWidth:{default:void 0},align:{default:void 0}},setup(t){let n=t,r=(0,e.useAttrs)(),i=(e,t,n)=>{if(e!==void 0)return e===!0?t:e===!1?n:e},a=(0,e.computed)(()=>[{flexGrow:i(n.grow,1,0),flexShrink:i(n.shrink,1,0),flexBasis:n.basis,minInlineSize:n.minWidth,alignSelf:n.align},r.style]),o=(0,e.computed)(()=>{let{class:e,style:t,...n}=r;return n});return(n,i)=>((0,e.openBlock)(),(0,e.createBlock)((0,e.resolveDynamicComponent)(t.as),(0,e.mergeProps)(o.value,{class:[`t-stack-item`,(0,e.unref)(r).class],style:a.value}),{default:(0,e.withCtx)(()=>[(0,e.renderSlot)(n.$slots,`default`)]),_:3},16,[`class`,`style`]))}});exports.default=t;
|
|
2
|
+
//# sourceMappingURL=TStackItem.vue_vue_type_script_setup_true_lang.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TStackItem.vue_vue_type_script_setup_true_lang.cjs","names":[],"sources":["../../src/components/TStackItem.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, useAttrs } from 'vue';\n\ndefineOptions({\n inheritAttrs: false,\n});\n\nconst props = withDefaults(\n defineProps<{\n as?: string;\n /** Expand to fill free space. `true` = flex-grow 1; a number sets the factor. */\n grow?: boolean | number;\n /** Allow shrinking. `false` prevents it; a number sets the factor. */\n shrink?: boolean | number;\n /** flex-basis (initial main-axis size). */\n basis?: string;\n /** Minimum main-axis size before it wraps/shrinks. */\n minWidth?: string;\n /** Per-item cross-axis alignment (align-self). */\n align?: string;\n }>(),\n {\n as: 'div',\n grow: false,\n shrink: undefined,\n basis: undefined,\n minWidth: undefined,\n align: undefined,\n },\n);\n\nconst attrs = useAttrs();\n\nconst toFactor = (value: boolean | number | undefined, truthy: number, falsy: number) => {\n if (value === undefined) return undefined;\n if (value === true) return truthy;\n if (value === false) return falsy;\n return value;\n};\n\nconst rootStyle = computed(() => [\n {\n flexGrow: toFactor(props.grow, 1, 0),\n flexShrink: toFactor(props.shrink, 1, 0),\n flexBasis: props.basis,\n minInlineSize: props.minWidth,\n alignSelf: props.align,\n },\n attrs.style,\n]);\n\nconst rootAttrs = computed(() => {\n const { class: _class, style: _style, ...rest } = attrs;\n return rest;\n});\n</script>\n\n<template>\n <component\n :is=\"as\"\n v-bind=\"rootAttrs\"\n class=\"t-stack-item\"\n :class=\"attrs.class\"\n :style=\"rootStyle\"\n >\n <slot />\n </component>\n</template>\n"],"mappings":"wRAOA,IAAM,EAAQ,EAwBR,GAAA,EAAA,EAAA,SAAA,CAAiB,EAEjB,GAAY,EAAqC,EAAgB,IAAkB,CACnF,OAAU,IAAA,GAGd,OAFI,IAAU,GAAa,EACvB,IAAU,GAAc,EACrB,CACT,EAEM,GAAA,EAAA,EAAA,SAAA,KAA2B,CAC/B,CACE,SAAU,EAAS,EAAM,KAAM,EAAG,CAAC,EACnC,WAAY,EAAS,EAAM,OAAQ,EAAG,CAAC,EACvC,UAAW,EAAM,MACjB,cAAe,EAAM,SACrB,UAAW,EAAM,KACnB,EACA,EAAM,KACR,CAAC,EAEK,GAAA,EAAA,EAAA,SAAA,KAA2B,CAC/B,GAAM,CAAE,MAAO,EAAQ,MAAO,EAAQ,GAAG,GAAS,EAClD,OAAO,CACT,CAAC,kFAKQ,EAAA,EAAE,GAAA,EAAA,EAAA,WAAA,CACC,EAME,MANO,CACjB,MAAK,CAAC,gBAAA,EAAA,EAAA,MAAA,CACE,CAAA,CAAK,CAAC,KAAK,EAClB,MAAO,EAAA,mCAEA,EAAA,EAAA,EAAA,WAAA,CAAA,EAAA,OAAA,SAAA,CAAA,CAAA"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { computed as e, createBlock as t, defineComponent as n, mergeProps as r, openBlock as i, renderSlot as a, resolveDynamicComponent as o, unref as s, useAttrs as c, withCtx as l } from "vue";
|
|
2
|
+
//#region src/components/TStackItem.vue?vue&type=script&setup=true&lang.ts
|
|
3
|
+
var u = /*@__PURE__*/ n({
|
|
4
|
+
inheritAttrs: !1,
|
|
5
|
+
__name: "TStackItem",
|
|
6
|
+
props: {
|
|
7
|
+
as: { default: "div" },
|
|
8
|
+
grow: {
|
|
9
|
+
type: [Boolean, Number],
|
|
10
|
+
default: !1
|
|
11
|
+
},
|
|
12
|
+
shrink: {
|
|
13
|
+
type: [Boolean, Number],
|
|
14
|
+
default: void 0
|
|
15
|
+
},
|
|
16
|
+
basis: { default: void 0 },
|
|
17
|
+
minWidth: { default: void 0 },
|
|
18
|
+
align: { default: void 0 }
|
|
19
|
+
},
|
|
20
|
+
setup(n) {
|
|
21
|
+
let u = n, d = c(), f = (e, t, n) => {
|
|
22
|
+
if (e !== void 0) return e === !0 ? t : e === !1 ? n : e;
|
|
23
|
+
}, p = e(() => [{
|
|
24
|
+
flexGrow: f(u.grow, 1, 0),
|
|
25
|
+
flexShrink: f(u.shrink, 1, 0),
|
|
26
|
+
flexBasis: u.basis,
|
|
27
|
+
minInlineSize: u.minWidth,
|
|
28
|
+
alignSelf: u.align
|
|
29
|
+
}, d.style]), m = e(() => {
|
|
30
|
+
let { class: e, style: t, ...n } = d;
|
|
31
|
+
return n;
|
|
32
|
+
});
|
|
33
|
+
return (e, c) => (i(), t(o(n.as), r(m.value, {
|
|
34
|
+
class: ["t-stack-item", s(d).class],
|
|
35
|
+
style: p.value
|
|
36
|
+
}), {
|
|
37
|
+
default: l(() => [a(e.$slots, "default")]),
|
|
38
|
+
_: 3
|
|
39
|
+
}, 16, ["class", "style"]));
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
//#endregion
|
|
43
|
+
export { u as default };
|
|
44
|
+
|
|
45
|
+
//# sourceMappingURL=TStackItem.vue_vue_type_script_setup_true_lang.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TStackItem.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../src/components/TStackItem.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, useAttrs } from 'vue';\n\ndefineOptions({\n inheritAttrs: false,\n});\n\nconst props = withDefaults(\n defineProps<{\n as?: string;\n /** Expand to fill free space. `true` = flex-grow 1; a number sets the factor. */\n grow?: boolean | number;\n /** Allow shrinking. `false` prevents it; a number sets the factor. */\n shrink?: boolean | number;\n /** flex-basis (initial main-axis size). */\n basis?: string;\n /** Minimum main-axis size before it wraps/shrinks. */\n minWidth?: string;\n /** Per-item cross-axis alignment (align-self). */\n align?: string;\n }>(),\n {\n as: 'div',\n grow: false,\n shrink: undefined,\n basis: undefined,\n minWidth: undefined,\n align: undefined,\n },\n);\n\nconst attrs = useAttrs();\n\nconst toFactor = (value: boolean | number | undefined, truthy: number, falsy: number) => {\n if (value === undefined) return undefined;\n if (value === true) return truthy;\n if (value === false) return falsy;\n return value;\n};\n\nconst rootStyle = computed(() => [\n {\n flexGrow: toFactor(props.grow, 1, 0),\n flexShrink: toFactor(props.shrink, 1, 0),\n flexBasis: props.basis,\n minInlineSize: props.minWidth,\n alignSelf: props.align,\n },\n attrs.style,\n]);\n\nconst rootAttrs = computed(() => {\n const { class: _class, style: _style, ...rest } = attrs;\n return rest;\n});\n</script>\n\n<template>\n <component\n :is=\"as\"\n v-bind=\"rootAttrs\"\n class=\"t-stack-item\"\n :class=\"attrs.class\"\n :style=\"rootStyle\"\n >\n <slot />\n </component>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;EAOA,IAAM,IAAQ,GAwBR,IAAQ,EAAS,GAEjB,KAAY,GAAqC,GAAgB,MAAkB;GACnF,UAAU,KAAA,GAGd,OAFI,MAAU,KAAa,IACvB,MAAU,KAAc,IACrB;EACT,GAEM,IAAY,QAAe,CAC/B;GACE,UAAU,EAAS,EAAM,MAAM,GAAG,CAAC;GACnC,YAAY,EAAS,EAAM,QAAQ,GAAG,CAAC;GACvC,WAAW,EAAM;GACjB,eAAe,EAAM;GACrB,WAAW,EAAM;EACnB,GACA,EAAM,KACR,CAAC,GAEK,IAAY,QAAe;GAC/B,IAAM,EAAE,OAAO,GAAQ,OAAO,GAAQ,GAAG,MAAS;GAClD,OAAO;EACT,CAAC;yBAIC,EAQY,EAPL,EAAA,EAAE,GADT,EAEU,EAME,OANO;GACjB,OAAK,CAAC,gBACE,EAAA,CAAA,CAAK,CAAC,KAAK;GAClB,OAAO,EAAA;;oBAEA,CAAR,EAAQ,EAAA,QAAA,SAAA,CAAA,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TText.cjs","names":[],"sources":["../../src/components/TText.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed } from 'vue';\n\nconst _treeTextSizes = ['xs', 'sm', 'md', 'lg', 'xl', '2xl', '3xl'] as const;\nconst _treeTextTones = ['default', 'muted', 'inverse', 'brand'] as const;\nconst _treeTextWeights = ['regular', 'medium', 'semibold', 'bold'] as const;\n\nexport type TTextSize = (typeof _treeTextSizes)[number];\nexport type TTextTone = (typeof _treeTextTones)[number];\nexport type TTextWeight = (typeof _treeTextWeights)[number];\n\nconst props = withDefaults(\n defineProps<{\n /** Element to render. Defaults to `span`; use `p`, `h1`–`h6`, `label`, … */\n as?: string;\n size?: TTextSize;\n tone?: TTextTone;\n weight?: TTextWeight;\n /** Truncate to a single line with an ellipsis. */\n truncate?: boolean;\n }>(),\n {\n as: 'span',\n size: undefined,\n tone: 'default',\n weight: undefined,\n truncate: false,\n },\n);\n\nconst classes = computed(() => [\n 't-text',\n props.size ? `t-text--size-${props.size}` : null,\n props.tone !== 'default' ? `t-text--${props.tone}` : null,\n props.weight ? `t-text--weight-${props.weight}` : null,\n { 'is-truncated': props.truncate },\n]);\n</script>\n\n<template>\n <component\n :is=\"as\"\n :class=\"classes\"\n >\n <slot />\n </component>\n</template>\n"],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TText.js","names":[],"sources":["../../src/components/TText.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed } from 'vue';\n\nconst _treeTextSizes = ['xs', 'sm', 'md', 'lg', 'xl', '2xl', '3xl'] as const;\nconst _treeTextTones = ['default', 'muted', 'inverse', 'brand'] as const;\nconst _treeTextWeights = ['regular', 'medium', 'semibold', 'bold'] as const;\n\nexport type TTextSize = (typeof _treeTextSizes)[number];\nexport type TTextTone = (typeof _treeTextTones)[number];\nexport type TTextWeight = (typeof _treeTextWeights)[number];\n\nconst props = withDefaults(\n defineProps<{\n /** Element to render. Defaults to `span`; use `p`, `h1`–`h6`, `label`, … */\n as?: string;\n size?: TTextSize;\n tone?: TTextTone;\n weight?: TTextWeight;\n /** Truncate to a single line with an ellipsis. */\n truncate?: boolean;\n }>(),\n {\n as: 'span',\n size: undefined,\n tone: 'default',\n weight: undefined,\n truncate: false,\n },\n);\n\nconst classes = computed(() => [\n 't-text',\n props.size ? `t-text--size-${props.size}` : null,\n props.tone !== 'default' ? `t-text--${props.tone}` : null,\n props.weight ? `t-text--weight-${props.weight}` : null,\n { 'is-truncated': props.truncate },\n]);\n</script>\n\n<template>\n <component\n :is=\"as\"\n :class=\"classes\"\n >\n <slot />\n </component>\n</template>\n"],"mappings":""}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
declare const _treeTextSizes: readonly ["xs", "sm", "md", "lg", "xl", "2xl", "3xl"];
|
|
2
|
+
declare const _treeTextTones: readonly ["default", "muted", "inverse", "brand"];
|
|
3
|
+
declare const _treeTextWeights: readonly ["regular", "medium", "semibold", "bold"];
|
|
4
|
+
export type TTextSize = (typeof _treeTextSizes)[number];
|
|
5
|
+
export type TTextTone = (typeof _treeTextTones)[number];
|
|
6
|
+
export type TTextWeight = (typeof _treeTextWeights)[number];
|
|
7
|
+
type __VLS_Props = {
|
|
8
|
+
/** Element to render. Defaults to `span`; use `p`, `h1`–`h6`, `label`, … */
|
|
9
|
+
as?: string;
|
|
10
|
+
size?: TTextSize;
|
|
11
|
+
tone?: TTextTone;
|
|
12
|
+
weight?: TTextWeight;
|
|
13
|
+
/** Truncate to a single line with an ellipsis. */
|
|
14
|
+
truncate?: boolean;
|
|
15
|
+
};
|
|
16
|
+
declare function __VLS_template(): {
|
|
17
|
+
attrs: Partial<{}>;
|
|
18
|
+
slots: {
|
|
19
|
+
default?(_: {}): any;
|
|
20
|
+
};
|
|
21
|
+
refs: {};
|
|
22
|
+
rootEl: any;
|
|
23
|
+
};
|
|
24
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
25
|
+
declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
26
|
+
size: TTextSize;
|
|
27
|
+
tone: TTextTone;
|
|
28
|
+
as: string;
|
|
29
|
+
weight: TTextWeight;
|
|
30
|
+
truncate: boolean;
|
|
31
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
32
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
33
|
+
export default _default;
|
|
34
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
35
|
+
new (): {
|
|
36
|
+
$slots: S;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
//# sourceMappingURL=TText.vue.d.ts.map
|