|
1 |
- {"version":3,"sources":["../../src/mixins/positionable.ts"],"names":[],"mappings":";;;;;QAkBgB,O,GAAA,O;;;;;;AAjBhB;;;;AAGA,IAAM,iBAAiB;AACrB,YAAU,OADW;AAErB,UAAQ,OAFa;AAGrB,SAAO,OAHc;AAIrB,QAAM,OAJe;AAKrB,SAAO,OALc;AAMrB,OAAK;AANgB,CAAvB;AAcM,SAAU,OAAV,GAAuC;AAAA,MAApB,QAAoB,uEAAF,EAAE;;AAC3C,SAAO,cAAI,MAAJ,CAAW;AAChB,UAAM,cADU;AAEhB,WAAO,SAAS,MAAT,GAAkB,iCAAmB,cAAnB,EAAmC,QAAnC,CAAlB,GAAiE;AAFxD,GAAX,CAAP;AAID;kBAEc,S;AAEf;AACA","sourcesContent":["import Vue from 'vue'\nimport { filterObjectOnKeys } from '../util/helpers'\nimport { OptionsVue, VueConstructor } from 'vue/types/vue'\n\nconst availableProps = {\n absolute: Boolean,\n bottom: Boolean,\n fixed: Boolean,\n left: Boolean,\n right: Boolean,\n top: Boolean\n}\ntype props = Record<keyof typeof availableProps, boolean>\n\nexport type Positionable<S extends keyof props> = VueConstructor<Vue & { [P in S]: boolean }, { [P in S]: BooleanConstructor }>\n\nexport function factory <S extends keyof props> (selected?: S[]): Positionable<S>\nexport function factory (selected: undefined): OptionsVue<Vue, {}, {}, {}, props, typeof availableProps>\nexport function factory (selected: any[] = []): any {\n return Vue.extend({\n name: 'positionable',\n props: selected.length ? filterObjectOnKeys(availableProps, selected) : availableProps\n })\n}\n\nexport default factory()\n\n// Add a `*` before the second `/`\n/* Tests /\nlet single = factory(['top']).extend({\n created () {\n this.top\n this.bottom\n this.absolute\n }\n})\n\nlet some = factory(['top', 'bottom']).extend({\n created () {\n this.top\n this.bottom\n this.absolute\n }\n})\n\nlet all = factory().extend({\n created () {\n this.top\n this.bottom\n this.absolute\n this.foobar\n }\n})\n/**/\n"],"sourceRoot":""}
|