Major overhaul to the theme and now functioning.

This commit is contained in:
david committed 2026-01-05 16:07:30 -05:00
1 parent 5823ca3c39
commit a475dfeab6
5218 files changed
+1643729 -13229

No files matched your search

@@ -0,0 +1,6 @@
// @ts-nocheck
/* eslint-disable */
// Styles
declare const _default: any;
export default _default;
@@ -0,0 +1,94 @@
// @ts-nocheck
/* eslint-disable */
// Styles
import "./VOverflowBtn.css";
// Extensions
import VSelect from "../VSelect/VSelect.js";
import VAutocomplete from "../VAutocomplete/index.js";
import VTextField from "../VTextField/VTextField.js"; // Components
import VBtn from "../VBtn/index.js"; // Utilities
import { consoleWarn } from "../../util/console.js";
/* @vue/component */
export default VAutocomplete.extend({
name: 'v-overflow-btn',
props: {
editable: Boolean,
segmented: Boolean
},
computed: {
classes() {
return {
...VAutocomplete.options.computed.classes.call(this),
'v-overflow-btn': true,
'v-overflow-btn--segmented': this.segmented,
'v-overflow-btn--editable': this.editable
};
},
isAnyValueAllowed() {
return this.editable || VAutocomplete.options.computed.isAnyValueAllowed.call(this);
},
isSingle() {
return true;
},
computedItems() {
return this.segmented ? this.allItems : this.filteredItems;
},
labelValue() {
return this.isFocused && !this.persistentPlaceholder || this.isLabelActive;
}
},
methods: {
genSelections() {
return this.editable ? VAutocomplete.options.methods.genSelections.call(this) : VSelect.options.methods.genSelections.call(this); // Override v-autocomplete's override
},
genCommaSelection(item, index, last) {
return this.segmented ? this.genSegmentedBtn(item) : VSelect.options.methods.genCommaSelection.call(this, item, index, last);
},
genInput() {
const input = VTextField.options.methods.genInput.call(this);
input.data = input.data || {};
input.data.domProps.value = this.editable ? this.internalSearch : '';
input.data.attrs.readonly = !this.isAnyValueAllowed;
return input;
},
genLabel() {
if (this.editable && this.isFocused) return null;
const label = VTextField.options.methods.genLabel.call(this);
if (!label) return label;
label.data = label.data || {};
// Reset previously set styles from parent
label.data.style = {};
return label;
},
genSegmentedBtn(item) {
const itemValue = this.getValue(item);
const itemObj = this.computedItems.find(i => this.getValue(i) === itemValue) || item;
if (!itemObj.text || !itemObj.callback) {
consoleWarn('When using "segmented" prop without a selection slot, items must contain both a text and callback property', this);
return null;
}
return this.$createElement(VBtn, {
props: {
text: true
},
on: {
click(e) {
e.stopPropagation();
itemObj.callback(e);
}
}
}, [itemObj.text]);
},
updateValue(val) {
if (val) {
this.initialValue = this.lazyValue;
} else if (this.initialValue !== this.lazyValue) {
this.$emit('change', this.lazyValue);
}
}
}
});
//# sourceMappingURL=VOverflowBtn.js.map
@@ -0,0 +1 @@
{"version":3,"file":"VOverflowBtn.js","names":["VSelect","VAutocomplete","VTextField","VBtn","consoleWarn","extend","name","props","editable","Boolean","segmented","computed","classes","options","call","isAnyValueAllowed","isSingle","computedItems","allItems","filteredItems","labelValue","isFocused","persistentPlaceholder","isLabelActive","methods","genSelections","genCommaSelection","item","index","last","genSegmentedBtn","genInput","input","data","domProps","value","internalSearch","attrs","readonly","genLabel","label","style","itemValue","getValue","itemObj","find","i","text","callback","$createElement","on","click","e","stopPropagation","updateValue","val","initialValue","lazyValue","$emit"],"sources":["../../../src/components/VOverflowBtn/VOverflowBtn.ts"],"sourcesContent":["// @ts-nocheck\n/* eslint-disable */\n\n// Styles\nimport './VOverflowBtn.sass'\n\n// Extensions\nimport VSelect from '../VSelect/VSelect'\nimport VAutocomplete from '../VAutocomplete'\nimport VTextField from '../VTextField/VTextField'\n\n// Components\nimport VBtn from '../VBtn'\n\n// Utilities\nimport { consoleWarn } from '../../util/console'\n\n/* @vue/component */\nexport default VAutocomplete.extend({\n name: 'v-overflow-btn',\n\n props: {\n editable: Boolean,\n segmented: Boolean,\n },\n\n computed: {\n classes (): object {\n return {\n ...VAutocomplete.options.computed.classes.call(this),\n 'v-overflow-btn': true,\n 'v-overflow-btn--segmented': this.segmented,\n 'v-overflow-btn--editable': this.editable,\n }\n },\n isAnyValueAllowed (): boolean {\n return this.editable ||\n VAutocomplete.options.computed.isAnyValueAllowed.call(this)\n },\n isSingle (): true {\n return true\n },\n computedItems (): object[] {\n return this.segmented ? this.allItems : this.filteredItems\n },\n labelValue (): boolean {\n return (this.isFocused && !this.persistentPlaceholder) || this.isLabelActive\n },\n },\n\n methods: {\n genSelections () {\n return this.editable\n ? VAutocomplete.options.methods.genSelections.call(this)\n : VSelect.options.methods.genSelections.call(this) // Override v-autocomplete's override\n },\n genCommaSelection (item: any, index: number, last: boolean) {\n return this.segmented\n ? this.genSegmentedBtn(item)\n : VSelect.options.methods.genCommaSelection.call(this, item, index, last)\n },\n genInput () {\n const input = VTextField.options.methods.genInput.call(this)\n\n input.data = input.data || {}\n input.data.domProps!.value = this.editable ? this.internalSearch : ''\n input.data.attrs!.readonly = !this.isAnyValueAllowed\n\n return input\n },\n genLabel () {\n if (this.editable && this.isFocused) return null\n\n const label = VTextField.options.methods.genLabel.call(this)\n\n if (!label) return label\n\n label.data = label.data || {}\n\n // Reset previously set styles from parent\n label.data.style = {}\n\n return label\n },\n genSegmentedBtn (item: any) {\n const itemValue = this.getValue(item)\n const itemObj = this.computedItems.find(i => this.getValue(i) === itemValue) || item\n\n if (!itemObj.text || !itemObj.callback) {\n consoleWarn('When using \"segmented\" prop without a selection slot, items must contain both a text and callback property', this)\n return null\n }\n\n return this.$createElement(VBtn, {\n props: { text: true },\n on: {\n click (e: Event) {\n e.stopPropagation()\n itemObj.callback(e)\n },\n },\n }, [itemObj.text])\n },\n updateValue (val: boolean) {\n if (val) {\n this.initialValue = this.lazyValue\n } else if (this.initialValue !== this.lazyValue) {\n this.$emit('change', this.lazyValue)\n }\n },\n },\n})\n"],"mappings":"AAAA;AACA;;AAEA;AACA;;AAEA;AAAA,OACOA,OAAO;AAAA,OACPC,aAAa;AAAA,OACbC,UAAU,qCAEjB;AAAA,OACOC,IAAI,0BAEX;AAAA,SACSC,WAAW;AAEpB;AACA,eAAeH,aAAa,CAACI,MAAM,CAAC;EAClCC,IAAI,EAAE,gBAAgB;EAEtBC,KAAK,EAAE;IACLC,QAAQ,EAAEC,OAAO;IACjBC,SAAS,EAAED;EACb,CAAC;EAEDE,QAAQ,EAAE;IACRC,OAAOA,CAAA,EAAY;MACjB,OAAO;QACL,GAAGX,aAAa,CAACY,OAAO,CAACF,QAAQ,CAACC,OAAO,CAACE,IAAI,CAAC,IAAI,CAAC;QACpD,gBAAgB,EAAE,IAAI;QACtB,2BAA2B,EAAE,IAAI,CAACJ,SAAS;QAC3C,0BAA0B,EAAE,IAAI,CAACF;MACnC,CAAC;IACH,CAAC;IACDO,iBAAiBA,CAAA,EAAa;MAC5B,OAAO,IAAI,CAACP,QAAQ,IAClBP,aAAa,CAACY,OAAO,CAACF,QAAQ,CAACI,iBAAiB,CAACD,IAAI,CAAC,IAAI,CAAC;IAC/D,CAAC;IACDE,QAAQA,CAAA,EAAU;MAChB,OAAO,IAAI;IACb,CAAC;IACDC,aAAaA,CAAA,EAAc;MACzB,OAAO,IAAI,CAACP,SAAS,GAAG,IAAI,CAACQ,QAAQ,GAAG,IAAI,CAACC,aAAa;IAC5D,CAAC;IACDC,UAAUA,CAAA,EAAa;MACrB,OAAQ,IAAI,CAACC,SAAS,IAAI,CAAC,IAAI,CAACC,qBAAqB,IAAK,IAAI,CAACC,aAAa;IAC9E;EACF,CAAC;EAEDC,OAAO,EAAE;IACPC,aAAaA,CAAA,EAAI;MACf,OAAO,IAAI,CAACjB,QAAQ,GAChBP,aAAa,CAACY,OAAO,CAACW,OAAO,CAACC,aAAa,CAACX,IAAI,CAAC,IAAI,CAAC,GACtDd,Line truncated
@@ -0,0 +1,134 @@
@use 'sass:map'
@use './variables' as *
// Theme
@include theme(v-overflow-btn) using ($material)
&#{&} > .v-input__control > .v-input__slot
border-color: map.get($material, 'dividers')
&:not(.v-input--is-focused):not(.v-input--has-state)
> .v-input__control > .v-input__slot:hover
background: map.get($material, 'cards')
&.v-overflow-btn--segmented
.v-input__append-inner
border-left: thin solid map.get($material, 'dividers')
.v-autocomplete__content.v-menu__content
box-shadow: $overflow-menu-content-box-shadow
.v-select-list
border-radius: $overflow-menu-content-select-list-border-radius
.v-overflow-btn
margin-top: $overflow-margin-top
padding-top: 0
&:not(.v-overflow-btn--editable) > .v-input__control > .v-input__slot
cursor: pointer
.v-input__slot
border-width: $overflow-input-slot-border-width
border-style: solid
&:before
display: none
.v-select__slot
height: $overflow-slot-height
&.v-input--dense
.v-select__slot
height: $overflow-dense-slot-height
input
cursor: pointer
margin-inline-start: $overflow-dense-input-margin-x
.v-select__selection--comma:first-child
margin-inline-start: $overflow-selection-comma-margin-x
.v-input__slot
transition: .3s map.get($transition, 'swing')
&::before,
&::after
display: none
.v-label
top: $overflow-label-top
margin-inline-start: $overflow-label-margin-x
.v-input__append-inner
align-items: center
align-self: auto
flex-shrink: 0
height: $overflow-append-inner-height
margin-top: 0
padding: 0 4px
width: $overflow-append-inner-width
.v-input__append-outer,
.v-input__prepend-outer
margin-bottom: $overflow-append-prepend-margin-bottom
margin-top: $overflow-append-prepend-margin-top
.v-input__control::before
// TODO: move to mixin
height: 1px
top: -1px
content: ''
left: 0
position: absolute
transition: $primary-transition
width: 100%
&.v-input--is-focused,
&.v-select--is-menu-active
.v-input__slot
border-color: transparent !important
box-shadow: $overflow-focused-active-slot-box-shadow
&.v-input--is-focused
.v-input__slot
border-radius: $overflow-focused-active-border-radius
&.v-select--is-menu-active
.v-input__slot
border-radius: $overflow-active-slot-border-radius
.v-select__selections
width: 0px
&--segmented
.v-input__slot
border-width: $overflow-segmented-input-slot-border-width
.v-select__selections
flex-wrap: nowrap
.v-btn
border-radius: 0
margin: 0
height: $overflow-segmented-selections-btn-height
width: 100%
// push past the input's padding
margin-inline-end: $overflow-segmented-selections-btn-margin-x
&__content
justify-content: start
&::before
background-color: transparent
&--editable
.v-select__slot
input
cursor: text
padding: $overflow-editable-select-slot-padding
.v-input__append-inner,
.v-input__append-inner *
cursor: pointer
@@ -0,0 +1,24 @@
@import '../../styles/styles.sass';
$overflow-active-slot-border-radius: $border-radius-root $border-radius-root 0 0 !default;
$overflow-append-inner-height: 48px !default;
$overflow-append-inner-width: 42px !default;
$overflow-append-prepend-margin-bottom: 12px !default;
$overflow-append-prepend-margin-top: 12px !default;
$overflow-dense-input-margin-x: 16px !default;
$overflow-dense-slot-height: 38px !default;
$overflow-focused-active-border-radius: $border-radius-root !default;
$overflow-focused-active-slot-box-shadow: 0 1px 6px 0 rgba(32,33,36,0.28) !default;
$overflow-focused-active-slot-elevation: 2 !default;
$overflow-input-slot-border-width: 2px 0 !default;
$overflow-label-margin-x: 16px !default;
$overflow-label-top: calc(50% - 10px) !default;
$overflow-margin-top: 12px !default;
$overflow-menu-content-box-shadow: 0 4px 6px 0 rgba(32,33,36,0.28) !default;
$overflow-menu-content-select-list-border-radius: 0 0 $border-radius-root $border-radius-root !default;
$overflow-segmented-input-slot-border-width: thin 0 !default;
$overflow-segmented-selections-btn-height: 48px !default;
$overflow-segmented-selections-btn-margin-x: -16px !default;
$overflow-selection-comma-margin-x: 16px !default;
$overflow-slot-height: 48px !default;
$overflow-editable-select-slot-padding: 8px 16px !default;
@@ -0,0 +1,3 @@
import VOverflowBtn from './VOverflowBtn.js';
export { VOverflowBtn };
export default VOverflowBtn;
@@ -0,0 +1,4 @@
import VOverflowBtn from "./VOverflowBtn.js";
export { VOverflowBtn };
export default VOverflowBtn;
//# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
{"version":3,"file":"index.js","names":["VOverflowBtn"],"sources":["../../../src/components/VOverflowBtn/index.ts"],"sourcesContent":["import VOverflowBtn from './VOverflowBtn'\n\nexport { VOverflowBtn }\nexport default VOverflowBtn\n"],"mappings":"OAAOA,YAAY;AAEnB,SAASA,YAAY;AACrB,eAAeA,YAAY","ignoreList":[]}