2020-05-15 05:07:59 -04:00
|
|
|
import Vue from 'vue';
|
|
|
|
import ExpiresAtField from './components/expires_at_field.vue';
|
|
|
|
|
2020-12-23 16:10:24 -05:00
|
|
|
const getInputAttrs = (el) => {
|
2020-11-11 19:09:44 -05:00
|
|
|
const input = el.querySelector('input');
|
|
|
|
|
|
|
|
return {
|
|
|
|
id: input.id,
|
|
|
|
name: input.name,
|
|
|
|
placeholder: input.placeholder,
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2020-05-15 05:07:59 -04:00
|
|
|
const initExpiresAtField = () => {
|
2020-11-11 19:09:44 -05:00
|
|
|
const el = document.querySelector('.js-access-tokens-expires-at');
|
|
|
|
|
|
|
|
if (!el) {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
const inputAttrs = getInputAttrs(el);
|
|
|
|
|
|
|
|
return new Vue({
|
|
|
|
el,
|
|
|
|
render(h) {
|
|
|
|
return h(ExpiresAtField, {
|
|
|
|
props: {
|
|
|
|
inputAttrs,
|
|
|
|
},
|
|
|
|
});
|
|
|
|
},
|
2020-05-15 05:07:59 -04:00
|
|
|
});
|
|
|
|
};
|
|
|
|
|
|
|
|
export default initExpiresAtField;
|