admins-components 9.0.59 → 9.0.61

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.
@@ -9,7 +9,12 @@ var m = t({
9
9
  setup(e, t) {
10
10
  let { value: n } = t.element;
11
11
  (n.value == null || n.value === "") && (n.value = /* @__PURE__ */ new Date());
12
- let r = t.attrs.placeholder, i = s(null), a = s(!1);
12
+ let r = {
13
+ showTime: !0,
14
+ ...t.attrs.config || {}
15
+ };
16
+ t.attrs.placeholder !== void 0 && r.placeholder === void 0 && (r.placeholder = t.attrs.placeholder);
17
+ let i = s(null), a = s(!1);
13
18
  return f(n, () => {
14
19
  i.value = {
15
20
  local: n.value ? new Date(n.value) : null,
@@ -20,7 +25,7 @@ var m = t({
20
25
  immediate: !0
21
26
  }), {
22
27
  display: a,
23
- placeholder: r,
28
+ pickerConfig: r,
24
29
  initial: i,
25
30
  value: n,
26
31
  setValue: (e) => {
@@ -35,10 +40,7 @@ function h(e, t, n, s, f, m) {
35
40
  element: p(() => [e.display ? (o(), r(h, {
36
41
  key: 0,
37
42
  "model-value": e.initial,
38
- config: {
39
- showTime: !0,
40
- placeholder: e.placeholder
41
- },
43
+ config: e.pickerConfig,
42
44
  "onUpdate:modelValue": t[0] ||= (t) => e.setValue(t)
43
45
  }, null, 8, ["model-value", "config"])) : i("", !0)]),
44
46
  _: 2
@@ -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\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"}
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 // Build the inner DatePicker config.\n // - Anything under `config` attr is forwarded verbatim.\n // - `placeholder` attr is also accepted as a shorthand for convenience.\n // - `showTime` defaults to true (this is the whole point of the element).\n const userConfig = context.attrs.config || {}\n const pickerConfig = {\n showTime: true,\n ...userConfig,\n }\n if (context.attrs.placeholder !== undefined && pickerConfig.placeholder === undefined) {\n pickerConfig.placeholder = context.attrs.placeholder\n }\n\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 pickerConfig,\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=\"pickerConfig\"\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;EAQzB,IAAM,IAAe;GACnB,UAAU;GACV,GAHiB,EAAQ,MAAM,UAAU,CAAC;EAI5C;EACA,AAAI,EAAQ,MAAM,gBAAgB,KAAA,KAAa,EAAa,gBAAgB,KAAA,MAC1E,EAAa,cAAc,EAAQ,MAAM;EAG3C,IAAM,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,QAAQ,EAAA;GACR,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"}
@@ -1 +1 @@
1
- .ac-component .c-modal-backdrop{z-index:1100;-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);background:#0006;justify-content:center;align-items:center;display:flex;position:fixed;inset:0}.ac-component .c-modal{background:var(--neutral-0);border-radius:.75rem;flex-direction:column;min-width:20rem;max-width:calc(100dvw - 2rem);max-height:calc(100dvh - 4rem);animation:.15s ease-out c-modal-enter;display:flex;overflow:hidden;box-shadow:0 8px 32px #0000001f}.ac-component .c-modal-header{border-bottom:1px solid var(--neutral-100);justify-content:space-between;align-items:center;padding:.5rem;display:flex}.ac-component .c-modal-title{color:var(--neutral-900);padding-left:.5rem;font-size:1rem;font-weight:600}.ac-component .c-modal-close{color:var(--neutral-600);cursor:pointer;background:0 0;border:none;border-radius:999px;justify-content:center;align-items:center;padding:.5rem .625rem;font-size:1rem;transition:background-color .15s,color .15s;display:inline-flex}.ac-component .c-modal-close i{transform:translate(.5px)}.ac-component .c-modal-close:hover{background:var(--neutral-100);color:var(--neutral-900)}.ac-component .c-modal-close:focus-visible{outline:none;box-shadow:0 0 0 2px #f265221f}.ac-component .c-modal-body{flex-direction:column;flex:1;padding:1rem;display:flex;overflow-y:auto}.ac-component .c-modal-footer{border-top:1px solid var(--neutral-100);justify-content:flex-end;align-items:center;gap:.5rem;padding:.75rem 1.25rem;display:flex}.ac-component .c-confirm-modal-message{color:var(--neutral-700);margin:0;font-size:.875rem;line-height:1.5}@keyframes c-modal-enter{0%{opacity:0;transform:scale(.95)translateY(-.5rem)}to{opacity:1;transform:scale(1)translateY(0)}}
1
+ .ac-component .c-modal-backdrop{z-index:1100;-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);background:#0006;justify-content:center;align-items:center;display:flex;position:fixed;inset:0}.ac-component .c-modal{background:var(--neutral-0);border-radius:.75rem;flex-direction:column;min-width:clamp(18rem,60dvw,26rem);max-width:calc(100dvw - 2rem);max-height:calc(100dvh - 4rem);animation:.15s ease-out c-modal-enter;display:flex;overflow:hidden;box-shadow:0 8px 32px #0000001f}.ac-component .c-modal-header{border-bottom:1px solid var(--neutral-100);justify-content:space-between;align-items:center;padding:.5rem;display:flex}.ac-component .c-modal-title{color:var(--neutral-900);padding-left:.5rem;font-size:1rem;font-weight:600}.ac-component .c-modal-close{color:var(--neutral-600);cursor:pointer;background:0 0;border:none;border-radius:999px;justify-content:center;align-items:center;padding:.5rem .625rem;font-size:1rem;transition:background-color .15s,color .15s;display:inline-flex}.ac-component .c-modal-close i{transform:translate(.5px)}.ac-component .c-modal-close:hover{background:var(--neutral-100);color:var(--neutral-900)}.ac-component .c-modal-close:focus-visible{outline:none;box-shadow:0 0 0 2px #f265221f}.ac-component .c-modal-body{flex-direction:column;flex:1;padding:1rem;display:flex;overflow-y:auto}.ac-component .c-modal-footer{border-top:1px solid var(--neutral-100);justify-content:flex-end;align-items:center;gap:.5rem;padding:.75rem 1.25rem;display:flex}.ac-component .c-confirm-modal-message{color:var(--neutral-700);margin:0;font-size:.875rem;line-height:1.5}@keyframes c-modal-enter{0%{opacity:0;transform:scale(.95)translateY(-.5rem)}to{opacity:1;transform:scale(1)translateY(0)}}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "admins-components",
3
- "version": "9.0.59",
3
+ "version": "9.0.61",
4
4
  "type": "module",
5
5
  "module": "./dist/admins-components.js",
6
6
  "types": "./dist/index.d.ts",