admins-components 9.0.57 → 9.0.58
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.
|
@@ -8,7 +8,7 @@ var m = t({
|
|
|
8
8
|
components: { DatePicker: e },
|
|
9
9
|
setup(e, t) {
|
|
10
10
|
let { value: n } = t.element;
|
|
11
|
-
n.value = /* @__PURE__ */ new Date();
|
|
11
|
+
(n.value == null || n.value === "") && (n.value = /* @__PURE__ */ new Date());
|
|
12
12
|
let r = t.attrs.placeholder, i = s(null), a = s(!1);
|
|
13
13
|
return f(n, () => {
|
|
14
14
|
i.value = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admins-components170.js","names":[],"sources":["../src/vueformelements/DateTimePickerElement.vue"],"sourcesContent":["<!-- eslint-disable-next-line vue/block-lang -->\n<script>\nimport { defineElement } from '@vueform/vueform'\nimport { ref, watch } from 'vue'\nimport DatePicker from '@/components/DatePicker.vue'\n\nexport default defineElement({\n name: 'DateTimePickerElement',\n components: {\n DatePicker,\n },\n setup(props, context) {\n const { value } = context.element\n value.value = new Date()\n\n const placeholder = context.attrs.placeholder\n const initial = ref(null)\n const display = ref(false)\n\n const setValue = (v) => {\n if (v && v.utc) {\n value.value = v.utc\n }\n }\n\n watch(\n value,\n () => {\n initial.value = {\n local: value.value ? new Date(value.value) : null,\n utc: value.value,\n }\n display.value = true\n },\n { deep: true, immediate: true }
|
|
1
|
+
{"version":3,"file":"admins-components170.js","names":[],"sources":["../src/vueformelements/DateTimePickerElement.vue"],"sourcesContent":["<!-- eslint-disable-next-line vue/block-lang -->\n<script>\nimport { defineElement } from '@vueform/vueform'\nimport { ref, watch } from 'vue'\nimport DatePicker from '@/components/DatePicker.vue'\n\nexport default defineElement({\n name: 'DateTimePickerElement',\n components: {\n DatePicker,\n },\n setup(props, context) {\n const { value } = context.element\n\n // Only default to \"now\" if no value was provided (create mode).\n // Otherwise keep the pre-filled value intact (edit mode).\n if (value.value == null || value.value === '') {\n value.value = new Date()\n }\n\n const placeholder = context.attrs.placeholder\n const initial = ref(null)\n const display = ref(false)\n\n const setValue = (v) => {\n if (v && v.utc) {\n value.value = v.utc\n }\n }\n\n watch(\n value,\n () => {\n initial.value = {\n local: value.value ? new Date(value.value) : null,\n utc: value.value,\n }\n display.value = true\n },\n { deep: true, immediate: true },\n )\n\n return {\n display,\n placeholder,\n initial,\n value,\n setValue,\n }\n },\n})\n</script>\n\n<template>\n <ElementLayout>\n <template #element>\n <DatePicker\n v-if=\"display\"\n :model-value=\"initial\"\n :config=\"{ showTime: true, placeholder: placeholder }\"\n @update:model-value=\"setValue($event)\"\n />\n </template>\n\n <template v-for=\"(component, slot) in elementSlots\" #[slot]>\n <!-- eslint-disable-next-line vue/valid-attribute-name -->\n <slot :name=\"slot\" :el$=\"el$\">\n <component :is=\"component\" :el$=\"el$\" />\n </slot>\n </template>\n </ElementLayout>\n</template>\n"],"mappings":";;;;;AAMA,IAAK,IAAa,EAAW;CAC3B,MAAM;CACN,YAAY,EACV,YAAA,EACF;CACA,MAAM,GAAO,GAAS;EACpB,IAAM,EAAE,aAAU,EAAQ;EAI1B,CAAI,EAAM,SAAS,QAAQ,EAAM,UAAU,QACzC,EAAM,wBAAQ,IAAI,KAAK;EAGzB,IAAM,IAAc,EAAQ,MAAM,aAC5B,IAAU,EAAI,IAAI,GAClB,IAAU,EAAI,EAAK;EAoBzB,OAZA,EACE,SACM;GAKJ,AAJA,EAAQ,QAAQ;IACd,OAAO,EAAM,QAAQ,IAAI,KAAK,EAAM,KAAK,IAAI;IAC7C,KAAK,EAAM;GACb,GACA,EAAQ,QAAQ;EAClB,GACA;GAAE,MAAM;GAAM,WAAW;EAAK,CAChC,GAEO;GACL;GACA;GACA;GACA;GACA,WAvBgB,MAAM;IACtB,AAAI,KAAK,EAAE,QACT,EAAM,QAAQ,EAAE;GAEpB;EAoBA;CACF;AACF,CAAC;;;aAIC,EAgBgB,GAAA,MAAA,EAAA;EAfH,SAAO,QAMd,CAJM,EAAA,WAAA,EAAA,GADR,EAKE,GAAA;;GAHC,eAAa,EAAA;GACb,QAAM;IAAA,UAAA;IAAA,aAAiC,EAAA;GAAW;GAClD,uBAAkB,AAAA,EAAA,QAAA,MAAE,EAAA,SAAS,CAAM;;;OAIF,EAAA,eAApB,GAAW;QAAwB;cAI5C,CAFP,EAEO,EAAA,QAFM,GAAI,EAAG,KAAK,EAAA,IAAG,SAErB,EAAA,EAAA,GADL,EAAwC,EAAxB,CAAS,GAAA,EAAG,KAAK,EAAA,IAAG,GAAA,MAAA,GAAA,CAAA,KAAA,CAAA,EAAA,CAAA,CAAA,CAAA"}
|