agnosticui-core 2.0.0-alpha.14 → 2.0.0-alpha.16

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.
Files changed (105) hide show
  1. package/dist/{VueCombobox.vue_vue_type_script_setup_true_lang-C7gDMrYJ.js → VueCombobox.vue_vue_type_script_setup_true_lang-BSTZGX2X.js} +15 -13
  2. package/dist/{VueInput.vue_vue_type_script_setup_true_lang-cOALNmlO.js → VueInput.vue_vue_type_script_setup_true_lang-fMqllTsp.js} +1 -0
  3. package/dist/{VueRating.vue_vue_type_script_setup_true_lang-CICncp71.js → VueRating.vue_vue_type_script_setup_true_lang-Bm2nRrqr.js} +11 -9
  4. package/dist/{VueSelectionButtonGroup.vue_vue_type_script_setup_true_lang-CLuww2Ac.js → VueSelectionButtonGroup.vue_vue_type_script_setup_true_lang-DwYrIMVO.js} +15 -11
  5. package/dist/VueSelectionCardGroup.vue_vue_type_script_setup_true_lang-D5CycLY5.js +40 -0
  6. package/dist/{VueToggle.vue_vue_type_script_setup_true_lang-BxrvAsse.js → VueToggle.vue_vue_type_script_setup_true_lang-DLPCBOqZ.js} +18 -16
  7. package/dist/components/Card/core/_Card.d.ts +7 -0
  8. package/dist/components/Card/core/_Card.d.ts.map +1 -1
  9. package/dist/components/Card/core/_Card.js +88 -41
  10. package/dist/components/Card/vue/VueCard.js +26 -13
  11. package/dist/components/Card/vue/VueCard.vue.d.ts +21 -1
  12. package/dist/components/Card/vue/VueCard.vue.d.ts.map +1 -1
  13. package/dist/components/Checkbox/core/_Checkbox.d.ts +14 -2
  14. package/dist/components/Checkbox/core/_Checkbox.d.ts.map +1 -1
  15. package/dist/components/Checkbox/core/_Checkbox.js +58 -43
  16. package/dist/components/Combobox/core/_Combobox.d.ts +24 -1
  17. package/dist/components/Combobox/core/_Combobox.d.ts.map +1 -1
  18. package/dist/components/Combobox/core/_Combobox.js +140 -91
  19. package/dist/components/Combobox/vue/VueCombobox.js +1 -1
  20. package/dist/components/Combobox/vue/index.js +1 -1
  21. package/dist/components/Input/core/_Input.d.ts +21 -2
  22. package/dist/components/Input/core/_Input.d.ts.map +1 -1
  23. package/dist/components/Input/core/_Input.js +37 -9
  24. package/dist/components/Input/vue/VueInput.js +1 -1
  25. package/dist/components/Input/vue/index.js +1 -1
  26. package/dist/components/Pagination/core/_Pagination.d.ts +0 -1
  27. package/dist/components/Pagination/core/_Pagination.d.ts.map +1 -1
  28. package/dist/components/Pagination/core/_Pagination.js +6 -9
  29. package/dist/components/Radio/core/_Radio.d.ts +24 -2
  30. package/dist/components/Radio/core/_Radio.d.ts.map +1 -1
  31. package/dist/components/Radio/core/_Radio.js +119 -89
  32. package/dist/components/Rating/core/_Rating.d.ts +23 -2
  33. package/dist/components/Rating/core/_Rating.d.ts.map +1 -1
  34. package/dist/components/Rating/core/_Rating.js +97 -64
  35. package/dist/components/Rating/vue/VueRating.js +1 -1
  36. package/dist/components/Rating/vue/VueRating.vue.d.ts +2 -0
  37. package/dist/components/Rating/vue/VueRating.vue.d.ts.map +1 -1
  38. package/dist/components/Rating/vue/index.js +1 -1
  39. package/dist/components/Select/core/_Select.d.ts +20 -2
  40. package/dist/components/Select/core/_Select.d.ts.map +1 -1
  41. package/dist/components/Select/core/_Select.js +99 -69
  42. package/dist/components/SelectionButtonGroup/core/_SelectionButtonGroup.d.ts +21 -2
  43. package/dist/components/SelectionButtonGroup/core/_SelectionButtonGroup.d.ts.map +1 -1
  44. package/dist/components/SelectionButtonGroup/core/_SelectionButtonGroup.js +74 -38
  45. package/dist/components/SelectionButtonGroup/vue/VueSelectionButtonGroup.js +1 -1
  46. package/dist/components/SelectionButtonGroup/vue/VueSelectionButtonGroup.vue.d.ts +7 -0
  47. package/dist/components/SelectionButtonGroup/vue/VueSelectionButtonGroup.vue.d.ts.map +1 -1
  48. package/dist/components/SelectionButtonGroup/vue/index.js +1 -1
  49. package/dist/components/SelectionCardGroup/core/_SelectionCardGroup.d.ts +12 -2
  50. package/dist/components/SelectionCardGroup/core/_SelectionCardGroup.d.ts.map +1 -1
  51. package/dist/components/SelectionCardGroup/core/_SelectionCardGroup.js +73 -46
  52. package/dist/components/SelectionCardGroup/vue/VueSelectionCardGroup.js +1 -1
  53. package/dist/components/SelectionCardGroup/vue/VueSelectionCardGroup.vue.d.ts +7 -0
  54. package/dist/components/SelectionCardGroup/vue/VueSelectionCardGroup.vue.d.ts.map +1 -1
  55. package/dist/components/SelectionCardGroup/vue/index.js +1 -1
  56. package/dist/components/Slider/core/_Slider.d.ts +10 -16
  57. package/dist/components/Slider/core/_Slider.d.ts.map +1 -1
  58. package/dist/components/Slider/core/_Slider.js +28 -39
  59. package/dist/components/Toggle/core/_Toggle.d.ts +21 -6
  60. package/dist/components/Toggle/core/_Toggle.d.ts.map +1 -1
  61. package/dist/components/Toggle/core/_Toggle.js +30 -9
  62. package/dist/components/Toggle/vue/VueToggle.js +1 -1
  63. package/dist/components/Toggle/vue/VueToggle.vue.d.ts.map +1 -1
  64. package/dist/components/Toggle/vue/index.js +1 -1
  65. package/dist/shared/face-mixin.d.ts +76 -0
  66. package/dist/shared/face-mixin.d.ts.map +1 -0
  67. package/dist/shared/face-mixin.js +68 -0
  68. package/dist/styles/ag-tokens.css +13 -13
  69. package/dist/test-setup.js +340 -255
  70. package/package.json +1 -1
  71. package/src/components/Card/core/_Card.ts +51 -1
  72. package/src/components/Card/vue/VueCard.vue +17 -1
  73. package/src/components/Checkbox/core/_Checkbox.ts +40 -5
  74. package/src/components/Combobox/core/_Combobox.ts +83 -1
  75. package/src/components/Combobox/vue/VueCombobox.vue +1 -0
  76. package/src/components/Drawer/v1/dialog--drawer-bottom.hbs +48 -0
  77. package/src/components/Drawer/v1/dialog--drawer-end.hbs +48 -0
  78. package/src/components/Drawer/v1/dialog--drawer-start.hbs +48 -0
  79. package/src/components/Drawer/v1/dialog--drawer-top.hbs +48 -0
  80. package/src/components/Drawer/v1/dialog-demo.css +13 -0
  81. package/src/components/Drawer/v1/dialog.config.yml +5 -0
  82. package/src/components/Drawer/v1/dialog.css +99 -0
  83. package/src/components/Drawer/v1/dialog.hbs +48 -0
  84. package/src/components/Drawer/v1/drawer-animations.css +52 -0
  85. package/src/components/Drawer/v1/drawer.css +50 -0
  86. package/src/components/Input/core/_Input.ts +49 -2
  87. package/src/components/Pagination/core/_Pagination.ts +10 -18
  88. package/src/components/Radio/core/_Radio.ts +61 -4
  89. package/src/components/Rating/core/_Rating.ts +62 -5
  90. package/src/components/Rating/vue/VueRating.vue +3 -0
  91. package/src/components/Select/core/_Select.ts +55 -6
  92. package/src/components/SelectionButtonGroup/core/_SelectionButtonGroup.ts +78 -5
  93. package/src/components/SelectionButtonGroup/vue/VueSelectionButtonGroup.vue +7 -0
  94. package/src/components/SelectionCardGroup/core/_SelectionCardGroup.ts +69 -5
  95. package/src/components/SelectionCardGroup/vue/VueSelectionCardGroup.vue +7 -0
  96. package/src/components/Slider/core/_Slider.ts +28 -28
  97. package/src/components/Toggle/core/_Toggle.ts +49 -9
  98. package/src/components/Toggle/vue/VueToggle.vue +2 -0
  99. package/src/shared/face-mixin.ts +203 -0
  100. package/src/styles/ag-tokens.css +13 -13
  101. package/dist/VueSelectionCardGroup.vue_vue_type_script_setup_true_lang-B2uA4jdK.js +0 -36
  102. package/dist/components/Input/core/_Input.BACKUP.d.ts +0 -114
  103. package/dist/components/Input/core/_Input.BACKUP.d.ts.map +0 -1
  104. package/dist/components/Input/core/_Input.BACKUP.js +0 -511
  105. package/src/components/Input/core/_Input.BACKUP.ts +0 -710
@@ -1,6 +1,6 @@
1
- import { defineComponent as m, ref as v, createElementBlock as h, openBlock as x, renderSlot as g } from "vue";
1
+ import { defineComponent as v, ref as m, createElementBlock as g, openBlock as h, renderSlot as x } from "vue";
2
2
  import "./components/Combobox/core/Combobox.js";
3
- const y = [".labelHidden", ".labelPosition", ".noLabel", ".disabled", ".invalid", ".clearable", ".readonly", ".required", ".loading", ".multiple", ".closeOnSelect", ".options", ".value", ".defaultValue", ".maxOptionsVisible", "placeholder", "label", "ariaLabel", "helpText", "errorMessage", "autocomplete", "filterMode", "size", "variant", "loadingText", "noResultsText"], T = /* @__PURE__ */ m({
3
+ const y = [".labelHidden", ".labelPosition", ".noLabel", ".disabled", ".invalid", ".clearable", ".readonly", ".required", ".validationMessages", ".loading", ".multiple", ".closeOnSelect", ".options", ".value", ".defaultValue", ".maxOptionsVisible", "placeholder", "label", "ariaLabel", "helpText", "errorMessage", "autocomplete", "filterMode", "size", "variant", "loadingText", "noResultsText"], M = /* @__PURE__ */ v({
4
4
  __name: "VueCombobox",
5
5
  props: {
6
6
  options: { default: () => [] },
@@ -30,16 +30,17 @@ const y = [".labelHidden", ".labelPosition", ".noLabel", ".disabled", ".invalid"
30
30
  maxOptionsVisible: { default: 3 },
31
31
  loading: { type: Boolean, default: !1 },
32
32
  loadingText: { default: "Loading..." },
33
- noResultsText: { default: "No results found" }
33
+ noResultsText: { default: "No results found" },
34
+ validationMessages: {}
34
35
  },
35
36
  emits: ["change", "select", "search", "open", "close", "focus", "blur", "update:value"],
36
- setup(e, { expose: n, emit: d }) {
37
- const a = d, t = v(), i = (l) => {
37
+ setup(e, { expose: n, emit: i }) {
38
+ const a = i, t = m(), d = (l) => {
38
39
  const o = l;
39
40
  a("change", o.detail), a("update:value", o.detail.value);
40
- }, u = (l) => {
41
- a("select", l.detail);
42
41
  }, s = (l) => {
42
+ a("select", l.detail);
43
+ }, u = (l) => {
43
44
  a("search", l.detail);
44
45
  }, c = (l) => {
45
46
  a("open", l.detail);
@@ -58,7 +59,7 @@ const y = [".labelHidden", ".labelPosition", ".noLabel", ".disabled", ".invalid"
58
59
  toggle: () => t.value?.toggle?.(),
59
60
  selectOption: (l) => t.value?.selectOption?.(l),
60
61
  clearSelection: () => t.value?.clearSelection?.()
61
- }), (l, o) => (x(), h("ag-combobox", {
62
+ }), (l, o) => (h(), g("ag-combobox", {
62
63
  ref_key: "comboboxRef",
63
64
  ref: t,
64
65
  ".labelHidden": e.labelHidden,
@@ -69,6 +70,7 @@ const y = [".labelHidden", ".labelPosition", ".noLabel", ".disabled", ".invalid"
69
70
  ".clearable": e.clearable,
70
71
  ".readonly": e.readonly,
71
72
  ".required": e.required,
73
+ ".validationMessages": e.validationMessages,
72
74
  ".loading": e.loading,
73
75
  ".multiple": e.multiple,
74
76
  ".closeOnSelect": e.closeOnSelect,
@@ -87,18 +89,18 @@ const y = [".labelHidden", ".labelPosition", ".noLabel", ".disabled", ".invalid"
87
89
  variant: e.variant,
88
90
  loadingText: e.loadingText,
89
91
  noResultsText: e.noResultsText,
90
- onChange: i,
91
- onSelect: u,
92
- onSearch: s,
92
+ onChange: d,
93
+ onSelect: s,
94
+ onSearch: u,
93
95
  onOpen: c,
94
96
  onClose: f,
95
97
  onFocus: r,
96
98
  onBlur: b
97
99
  }, [
98
- g(l.$slots, "default")
100
+ x(l.$slots, "default")
99
101
  ], 40, y));
100
102
  }
101
103
  });
102
104
  export {
103
- T as _
105
+ M as _
104
106
  };
@@ -14,6 +14,7 @@ const g = [".value", ".labelHidden", ".noLabel", ".capsule", ".rounded", ".under
14
14
  labelPosition: {},
15
15
  noLabel: { type: Boolean, default: !1 },
16
16
  ariaLabel: { default: "" },
17
+ name: {},
17
18
  type: { default: "text" },
18
19
  value: { default: "" },
19
20
  placeholder: { default: "" },
@@ -1,6 +1,6 @@
1
- import { defineComponent as r, ref as u, createElementBlock as s, openBlock as f, mergeProps as m, renderSlot as c } from "vue";
1
+ import { defineComponent as r, ref as s, createElementBlock as u, openBlock as f, mergeProps as v, renderSlot as m } from "vue";
2
2
  import "./components/Rating/core/Rating.js";
3
- const v = [".value", ".readonly", ".allowClear", ".required", ".invalid", "max", "precision", "variant", "size", "name", "label", "labelPosition", "labelHidden", "noLabel", "errorMessage", "helpText"], h = /* @__PURE__ */ r({
3
+ const c = [".value", ".readonly", ".allowClear", ".required", ".invalid", ".validationMessages", "max", "precision", "variant", "size", "name", "label", "labelPosition", "labelHidden", "noLabel", "errorMessage", "helpText"], h = /* @__PURE__ */ r({
4
4
  __name: "VueRating",
5
5
  props: {
6
6
  value: { default: 0 },
@@ -18,24 +18,26 @@ const v = [".value", ".readonly", ".allowClear", ".required", ".invalid", "max",
18
18
  required: { type: Boolean, default: !1 },
19
19
  invalid: { type: Boolean, default: !1 },
20
20
  errorMessage: { default: "" },
21
- helpText: { default: "" }
21
+ helpText: { default: "" },
22
+ validationMessages: {}
22
23
  },
23
24
  emits: ["update:value", "change", "hover"],
24
25
  setup(e, { emit: n }) {
25
- const t = n, o = u(), i = (a) => {
26
+ const t = n, i = s(), o = (a) => {
26
27
  const l = a;
27
28
  t("change", l.detail), t("update:value", l.detail.newValue);
28
29
  }, d = (a) => {
29
30
  t("hover", a.detail);
30
31
  };
31
- return (a, l) => (f(), s("ag-rating", m({
32
+ return (a, l) => (f(), u("ag-rating", v({
32
33
  ref_key: "ratingRef",
33
- ref: o,
34
+ ref: i,
34
35
  ".value": e.value,
35
36
  ".readonly": e.readonly,
36
37
  ".allowClear": e.allowClear,
37
38
  ".required": e.required,
38
39
  ".invalid": e.invalid,
40
+ ".validationMessages": e.validationMessages,
39
41
  max: e.max,
40
42
  precision: e.precision,
41
43
  variant: e.variant,
@@ -47,11 +49,11 @@ const v = [".value", ".readonly", ".allowClear", ".required", ".invalid", "max",
47
49
  noLabel: e.noLabel,
48
50
  errorMessage: e.errorMessage,
49
51
  helpText: e.helpText,
50
- onRatingChange: i,
52
+ onRatingChange: o,
51
53
  onRatingHover: d
52
54
  }, a.$attrs), [
53
- c(a.$slots, "default")
54
- ], 48, v));
55
+ m(a.$slots, "default")
56
+ ], 48, c));
55
57
  }
56
58
  });
57
59
  export {
@@ -1,6 +1,6 @@
1
- import { defineComponent as u, createElementBlock as s, openBlock as i, mergeProps as o, renderSlot as c } from "vue";
1
+ import { defineComponent as s, createElementBlock as u, openBlock as i, mergeProps as o, renderSlot as c } from "vue";
2
2
  import "./components/SelectionButtonGroup/core/SelectionButtonGroup.js";
3
- const m = ["type", "name", "legend", "legend-hidden", "theme", "size", "shape", "value", "values", ".disabled"], g = /* @__PURE__ */ u({
3
+ const g = ["type", "name", "legend", "legend-hidden", "theme", "size", "shape", "value", "values", ".disabled", ".required", ".validationMessages"], h = /* @__PURE__ */ s({
4
4
  __name: "VueSelectionButtonGroup",
5
5
  props: {
6
6
  type: { default: "radio" },
@@ -12,15 +12,17 @@ const m = ["type", "name", "legend", "legend-hidden", "theme", "size", "shape",
12
12
  shape: { default: "" },
13
13
  value: { default: "" },
14
14
  values: { default: () => [] },
15
- disabled: { type: Boolean, default: !1 }
15
+ disabled: { type: Boolean, default: !1 },
16
+ required: { type: Boolean, default: !1 },
17
+ validationMessages: {}
16
18
  },
17
19
  emits: ["selection-change", "update:value", "update:values"],
18
20
  setup(e, { emit: d }) {
19
- const l = d, n = (a) => {
20
- const t = a.detail;
21
- l("selection-change", t), t.selectedValues.length <= 1 && l("update:value", t.selectedValues[0] || ""), l("update:values", t.selectedValues);
21
+ const l = d, n = (t) => {
22
+ const a = t.detail;
23
+ l("selection-change", a), a.selectedValues.length <= 1 && l("update:value", a.selectedValues[0] || ""), l("update:values", a.selectedValues);
22
24
  };
23
- return (a, t) => (i(), s("ag-selection-button-group", o({
25
+ return (t, a) => (i(), u("ag-selection-button-group", o({
24
26
  type: e.type,
25
27
  name: e.name,
26
28
  legend: e.legend,
@@ -31,12 +33,14 @@ const m = ["type", "name", "legend", "legend-hidden", "theme", "size", "shape",
31
33
  value: e.value,
32
34
  values: e.values,
33
35
  ".disabled": e.disabled,
36
+ ".required": e.required,
37
+ ".validationMessages": e.validationMessages,
34
38
  onSelectionChange: n
35
- }, a.$attrs), [
36
- c(a.$slots, "default")
37
- ], 48, m));
39
+ }, t.$attrs), [
40
+ c(t.$slots, "default")
41
+ ], 48, g));
38
42
  }
39
43
  });
40
44
  export {
41
- g as _
45
+ h as _
42
46
  };
@@ -0,0 +1,40 @@
1
+ import { defineComponent as s, createElementBlock as i, openBlock as u, mergeProps as o, renderSlot as c } from "vue";
2
+ import "./components/SelectionCardGroup/core/SelectionCardGroup.js";
3
+ const g = ["type", "name", "legend", "legend-hidden", "value", "values", ".disabled", ".required", ".validationMessages"], v = /* @__PURE__ */ s({
4
+ __name: "VueSelectionCardGroup",
5
+ props: {
6
+ type: { default: "radio" },
7
+ name: { default: "" },
8
+ legend: { default: "" },
9
+ legendHidden: { type: Boolean, default: !1 },
10
+ value: { default: "" },
11
+ values: { default: () => [] },
12
+ disabled: { type: Boolean, default: !1 },
13
+ required: { type: Boolean, default: !1 },
14
+ validationMessages: {}
15
+ },
16
+ emits: ["selection-change", "update:value", "update:values"],
17
+ setup(e, { emit: t }) {
18
+ const d = t, n = (l) => {
19
+ const a = l.detail;
20
+ d("selection-change", a), a.selectedValues.length <= 1 && d("update:value", a.selectedValues[0] || ""), d("update:values", a.selectedValues);
21
+ };
22
+ return (l, a) => (u(), i("ag-selection-card-group", o({
23
+ type: e.type,
24
+ name: e.name,
25
+ legend: e.legend,
26
+ "legend-hidden": e.legendHidden,
27
+ value: e.value,
28
+ values: e.values,
29
+ ".disabled": e.disabled,
30
+ ".required": e.required,
31
+ ".validationMessages": e.validationMessages,
32
+ onSelectionChange: n
33
+ }, l.$attrs), [
34
+ c(l.$slots, "default")
35
+ ], 48, g));
36
+ }
37
+ });
38
+ export {
39
+ v as _
40
+ };
@@ -1,6 +1,6 @@
1
- import { defineComponent as r, ref as u, watch as f, createElementBlock as s, openBlock as g, mergeProps as h } from "vue";
1
+ import { defineComponent as s, ref as g, watch as u, createElementBlock as f, openBlock as r, mergeProps as h } from "vue";
2
2
  import "./components/Toggle/core/Toggle.js";
3
- const b = ["label", ".labelPosition", ".labelHidden", ".noLabel", "size", "variant", ".checked", ".disabled", ".readonly", ".required", ".invalid", "errorMessage", "helpText", "name", "value"], v = /* @__PURE__ */ r({
3
+ const b = ["label", ".labelPosition", ".labelHidden", ".noLabel", "size", "variant", ".checked", ".disabled", ".readonly", ".required", ".invalid", "errorMessage", "helpText", "name", "value", ".validationMessages"], m = /* @__PURE__ */ s({
4
4
  __name: "VueToggle",
5
5
  props: {
6
6
  label: {},
@@ -17,24 +17,25 @@ const b = ["label", ".labelPosition", ".labelHidden", ".noLabel", "size", "varia
17
17
  errorMessage: { default: "" },
18
18
  helpText: { default: "" },
19
19
  name: {},
20
- value: {}
20
+ value: {},
21
+ validationMessages: {}
21
22
  },
22
23
  emits: ["click", "toggle-change", "update:checked"],
23
24
  setup(e, { emit: d }) {
24
- const o = e, t = d, a = u(), i = (l) => {
25
- t("click", l);
26
- }, c = (l) => {
27
- const n = l;
25
+ const i = e, t = d, l = g(), o = (a) => {
26
+ t("click", a);
27
+ }, c = (a) => {
28
+ const n = a;
28
29
  t("toggle-change", n.detail), t("update:checked", n.detail.checked);
29
30
  };
30
- return f(
31
- () => o.checked,
32
- (l) => {
33
- a.value && a.value.checked !== l && (a.value.checked = l);
31
+ return u(
32
+ () => i.checked,
33
+ (a) => {
34
+ l.value && l.value.checked !== a && (l.value.checked = a);
34
35
  }
35
- ), (l, n) => (g(), s("ag-toggle", h({
36
+ ), (a, n) => (r(), f("ag-toggle", h({
36
37
  ref_key: "toggleRef",
37
- ref: a,
38
+ ref: l,
38
39
  label: e.label,
39
40
  ".labelPosition": e.labelPosition,
40
41
  ".labelHidden": e.labelHidden,
@@ -50,11 +51,12 @@ const b = ["label", ".labelPosition", ".labelHidden", ".noLabel", "size", "varia
50
51
  helpText: e.helpText,
51
52
  name: e.name,
52
53
  value: e.value,
53
- onClick: i,
54
+ ".validationMessages": e.validationMessages,
55
+ onClick: o,
54
56
  onToggleChange: c
55
- }, l.$attrs), null, 48, b));
57
+ }, a.$attrs), null, 48, b));
56
58
  }
57
59
  });
58
60
  export {
59
- v as _
61
+ m as _
60
62
  };
@@ -2,6 +2,7 @@ import { LitElement } from 'lit';
2
2
 
3
3
  export type CardVariant = 'success' | 'info' | 'error' | 'warning' | 'monochrome' | '';
4
4
  export type CardRounded = 'sm' | 'md' | 'lg' | '';
5
+ export type CardMediaPosition = 'top' | 'bottom';
5
6
  export interface CardProps {
6
7
  stacked?: boolean;
7
8
  shadow?: boolean;
@@ -9,6 +10,10 @@ export interface CardProps {
9
10
  /** Border radius size. Use 'sm', 'md', 'lg' or true (defaults to 'md') */
10
11
  rounded?: CardRounded | boolean;
11
12
  variant?: CardVariant;
13
+ /** Enables the media slot for edge-to-edge image/video rendering */
14
+ hasMedia?: boolean;
15
+ /** Whether media renders above or below the header/content/footer */
16
+ mediaPosition?: CardMediaPosition;
12
17
  }
13
18
  export declare class AgCard extends LitElement implements CardProps {
14
19
  stacked: boolean;
@@ -16,6 +21,8 @@ export declare class AgCard extends LitElement implements CardProps {
16
21
  animated: boolean;
17
22
  rounded: CardRounded;
18
23
  variant: CardVariant;
24
+ hasMedia: boolean;
25
+ mediaPosition: CardMediaPosition;
19
26
  private _hasHeaderSlotContent;
20
27
  private _hasFooterSlotContent;
21
28
  constructor();
@@ -1 +1 @@
1
- {"version":3,"file":"_Card.d.ts","sourceRoot":"","sources":["../../../../src/components/Card/core/_Card.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAa,MAAM,KAAK,CAAC;AAI5C,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,GAAG,YAAY,GAAG,EAAE,CAAC;AACvF,MAAM,MAAM,WAAW,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,EAAE,CAAC;AAkBlD,MAAM,WAAW,SAAS;IACxB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,0EAA0E;IAC1E,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC;IAChC,OAAO,CAAC,EAAE,WAAW,CAAC;CACvB;AAED,qBAAa,MAAO,SAAQ,UAAW,YAAW,SAAS;IACL,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,OAAO,CAAC;IACJ,OAAO,EAAE,WAAW,CAAC;IACpC,OAAO,EAAE,WAAW,CAAC;IAExE,OAAO,CAAC,qBAAqB,CAAS;IACtC,OAAO,CAAC,qBAAqB,CAAS;;IAWtC;;OAEG;IACH,OAAO,CAAC,iBAAiB;IAahB,YAAY;IAUrB,MAAM,CAAC,MAAM,0BAsIX;IAEF,MAAM;CAkBP"}
1
+ {"version":3,"file":"_Card.d.ts","sourceRoot":"","sources":["../../../../src/components/Card/core/_Card.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAsB,MAAM,KAAK,CAAC;AAIrD,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,GAAG,YAAY,GAAG,EAAE,CAAC;AACvF,MAAM,MAAM,WAAW,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,EAAE,CAAC;AAClD,MAAM,MAAM,iBAAiB,GAAG,KAAK,GAAG,QAAQ,CAAC;AAkBjD,MAAM,WAAW,SAAS;IACxB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,0EAA0E;IAC1E,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC;IAChC,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB,oEAAoE;IACpE,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,qEAAqE;IACrE,aAAa,CAAC,EAAE,iBAAiB,CAAC;CACnC;AAED,qBAAa,MAAO,SAAQ,UAAW,YAAW,SAAS;IACL,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,OAAO,CAAC;IACJ,OAAO,EAAE,WAAW,CAAC;IACpC,OAAO,EAAE,WAAW,CAAC;IACI,QAAQ,EAAE,OAAO,CAAC;IACd,aAAa,EAAE,iBAAiB,CAAC;IAEjH,OAAO,CAAC,qBAAqB,CAAS;IACtC,OAAO,CAAC,qBAAqB,CAAS;;IAatC;;OAEG;IACH,OAAO,CAAC,iBAAiB;IAahB,YAAY;IAUrB,MAAM,CAAC,MAAM,0BAqKX;IAEF,MAAM;CA4BP"}
@@ -1,51 +1,61 @@
1
- import { LitElement as g, css as p, html as v } from "lit";
2
- import { n as d } from "../../../property-CemaeiRl.js";
3
- import { hasSlotContent as n } from "../../../utils/slot.js";
4
- var m = Object.defineProperty, s = (t, a, r, i) => {
5
- for (var e = void 0, c = t.length - 1, h; c >= 0; c--)
6
- (h = t[c]) && (e = h(a, r, e) || e);
7
- return e && m(a, r, e), e;
1
+ import { LitElement as p, css as u, nothing as g, html as l } from "lit";
2
+ import { n as o } from "../../../property-CemaeiRl.js";
3
+ import { hasSlotContent as i } from "../../../utils/slot.js";
4
+ var v = Object.defineProperty, d = (a, e, t, n) => {
5
+ for (var s = void 0, c = a.length - 1, m; c >= 0; c--)
6
+ (m = a[c]) && (s = m(e, t, s) || s);
7
+ return s && v(e, t, s), s;
8
8
  };
9
- const u = {
10
- fromAttribute(t) {
11
- return t === "" || t === "true" ? "md" : t === "false" || t === null ? "" : t || "";
9
+ const b = {
10
+ fromAttribute(a) {
11
+ return a === "" || a === "true" ? "md" : a === "false" || a === null ? "" : a || "";
12
12
  },
13
- toAttribute(t) {
14
- return typeof t == "boolean" ? t ? "md" : null : t || null;
13
+ toAttribute(a) {
14
+ return typeof a == "boolean" ? a ? "md" : null : a || null;
15
15
  }
16
- }, l = class l extends g {
16
+ }, h = class h extends p {
17
17
  constructor() {
18
- super(), this._hasHeaderSlotContent = !1, this._hasFooterSlotContent = !1, this.stacked = !1, this.shadow = !1, this.animated = !1, this.rounded = "", this.variant = "";
18
+ super(), this._hasHeaderSlotContent = !1, this._hasFooterSlotContent = !1, this.stacked = !1, this.shadow = !1, this.animated = !1, this.rounded = "", this.variant = "", this.hasMedia = !1, this.mediaPosition = "top";
19
19
  }
20
20
  /**
21
21
  * Handle slot changes to detect if header/footer are empty
22
22
  */
23
- _handleSlotChange(a) {
24
- const r = a.target, i = r.name;
25
- i === "header" ? this._hasHeaderSlotContent = n(r) : i === "footer" && (this._hasFooterSlotContent = n(r)), this.requestUpdate();
23
+ _handleSlotChange(e) {
24
+ const t = e.target, n = t.name;
25
+ n === "header" ? this._hasHeaderSlotContent = i(t) : n === "footer" && (this._hasFooterSlotContent = i(t)), this.requestUpdate();
26
26
  }
27
27
  firstUpdated() {
28
- const a = this.shadowRoot?.querySelector('slot[name="header"]'), r = this.shadowRoot?.querySelector('slot[name="footer"]');
29
- this._hasHeaderSlotContent = n(a), this._hasFooterSlotContent = n(r), this.requestUpdate();
28
+ const e = this.shadowRoot?.querySelector('slot[name="header"]'), t = this.shadowRoot?.querySelector('slot[name="footer"]');
29
+ this._hasHeaderSlotContent = i(e), this._hasFooterSlotContent = i(t), this.requestUpdate();
30
30
  }
31
31
  render() {
32
- const a = this._hasHeaderSlotContent ? "card-header" : "card-header empty", r = this._hasFooterSlotContent ? "card-footer" : "card-footer empty";
33
- return v`
32
+ const e = this._hasHeaderSlotContent ? "card-header" : "card-header empty", t = this._hasFooterSlotContent ? "card-footer" : "card-footer empty";
33
+ return l`
34
34
  <div class="card-wrapper" part="ag-card-wrapper">
35
- <div class="${a}" part="ag-card-header">
35
+ ${this.hasMedia && this.mediaPosition === "top" ? l`
36
+ <div class="card-media card-media--top" part="ag-card-media">
37
+ <slot name="media"></slot>
38
+ </div>` : g}
39
+
40
+ <div class="${e}" part="ag-card-header">
36
41
  <slot name="header" @slotchange=${this._handleSlotChange}></slot>
37
42
  </div>
38
43
  <div class="card-content" part="ag-card-content">
39
44
  <slot></slot>
40
45
  </div>
41
- <div class="${r}" part="ag-card-footer">
46
+ <div class="${t}" part="ag-card-footer">
42
47
  <slot name="footer" @slotchange=${this._handleSlotChange}></slot>
43
48
  </div>
49
+
50
+ ${this.hasMedia && this.mediaPosition === "bottom" ? l`
51
+ <div class="card-media card-media--bottom" part="ag-card-media">
52
+ <slot name="media"></slot>
53
+ </div>` : g}
44
54
  </div>
45
55
  `;
46
56
  }
47
57
  };
48
- l.styles = p`
58
+ h.styles = u`
49
59
  :host {
50
60
  display: block;
51
61
  position: relative;
@@ -179,23 +189,60 @@ l.styles = p`
179
189
  position: relative;
180
190
  z-index: 2;
181
191
  }
192
+
193
+ /* ── Media slot ─────────────────────────────────────────────────── */
194
+
195
+ /* Clip image corners to the card's border-radius for non-shadow cards */
196
+ :host([has-media]) {
197
+ overflow: hidden;
198
+ }
199
+
200
+ .card-media {
201
+ overflow: hidden; /* belt-and-suspenders for non-rounded cards */
202
+ line-height: 0; /* collapses inline whitespace below slotted img */
203
+ }
204
+
205
+ /* Top media: clip only the card's top two corners */
206
+ :host([rounded="sm"]) .card-media--top { border-radius: var(--ag-radius-sm) var(--ag-radius-sm) 0 0; }
207
+ :host([rounded="md"]) .card-media--top { border-radius: var(--ag-radius-md) var(--ag-radius-md) 0 0; }
208
+ :host([rounded="lg"]) .card-media--top { border-radius: var(--ag-radius-lg) var(--ag-radius-lg) 0 0; }
209
+
210
+ /* Bottom media: clip only the card's bottom two corners */
211
+ :host([rounded="sm"]) .card-media--bottom { border-radius: 0 0 var(--ag-radius-sm) var(--ag-radius-sm); }
212
+ :host([rounded="md"]) .card-media--bottom { border-radius: 0 0 var(--ag-radius-md) var(--ag-radius-md); }
213
+ :host([rounded="lg"]) .card-media--bottom { border-radius: 0 0 var(--ag-radius-lg) var(--ag-radius-lg); }
214
+
215
+ /* Sensible defaults for slotted media elements */
216
+ .card-media ::slotted(img),
217
+ .card-media ::slotted(video) {
218
+ display: block;
219
+ width: 100%;
220
+ height: auto;
221
+ object-fit: cover;
222
+ }
182
223
  `;
183
- let o = l;
184
- s([
185
- d({ type: Boolean, reflect: !0 })
186
- ], o.prototype, "stacked");
187
- s([
188
- d({ type: Boolean, reflect: !0 })
189
- ], o.prototype, "shadow");
190
- s([
191
- d({ type: Boolean, reflect: !0 })
192
- ], o.prototype, "animated");
193
- s([
194
- d({ converter: u, reflect: !0 })
195
- ], o.prototype, "rounded");
196
- s([
197
- d({ type: String, reflect: !0 })
198
- ], o.prototype, "variant");
224
+ let r = h;
225
+ d([
226
+ o({ type: Boolean, reflect: !0 })
227
+ ], r.prototype, "stacked");
228
+ d([
229
+ o({ type: Boolean, reflect: !0 })
230
+ ], r.prototype, "shadow");
231
+ d([
232
+ o({ type: Boolean, reflect: !0 })
233
+ ], r.prototype, "animated");
234
+ d([
235
+ o({ converter: b, reflect: !0 })
236
+ ], r.prototype, "rounded");
237
+ d([
238
+ o({ type: String, reflect: !0 })
239
+ ], r.prototype, "variant");
240
+ d([
241
+ o({ type: Boolean, reflect: !0, attribute: "has-media" })
242
+ ], r.prototype, "hasMedia");
243
+ d([
244
+ o({ type: String, reflect: !0, attribute: "media-position" })
245
+ ], r.prototype, "mediaPosition");
199
246
  export {
200
- o as AgCard
247
+ r as AgCard
201
248
  };
@@ -1,7 +1,7 @@
1
- import { defineComponent as o, ref as n, onMounted as d, createElementBlock as r, openBlock as s, mergeProps as l, renderSlot as a } from "vue";
1
+ import { defineComponent as t, ref as d, onMounted as n, createElementBlock as s, openBlock as i, mergeProps as r, renderSlot as a } from "vue";
2
2
  import "../core/Card.js";
3
- import { _ as i } from "../../../_plugin-vue_export-helper-CHgC5LLL.js";
4
- const u = o({
3
+ import { _ as l } from "../../../_plugin-vue_export-helper-CHgC5LLL.js";
4
+ const m = t({
5
5
  name: "VueCard",
6
6
  props: {
7
7
  stacked: {
@@ -23,37 +23,50 @@ const u = o({
23
23
  variant: {
24
24
  type: String,
25
25
  default: ""
26
+ },
27
+ hasMedia: {
28
+ type: Boolean,
29
+ default: !1
30
+ },
31
+ mediaPosition: {
32
+ type: String,
33
+ default: "top"
26
34
  }
27
35
  },
28
36
  setup(e) {
29
- const t = n(null);
30
- return d(async () => {
37
+ const o = d(null);
38
+ return n(async () => {
31
39
  await customElements.whenDefined("ag-card");
32
40
  }), {
33
- agComponent: t,
41
+ agComponent: o,
34
42
  stacked: e.stacked,
35
43
  shadow: e.shadow,
36
44
  animated: e.animated,
37
45
  rounded: e.rounded,
38
- variant: e.variant
46
+ variant: e.variant,
47
+ hasMedia: e.hasMedia,
48
+ mediaPosition: e.mediaPosition
39
49
  };
40
50
  }
41
- }), f = [".stacked", ".shadow", ".animated", "rounded", "variant"];
42
- function m(e, t, c, p, h, k) {
43
- return s(), r("ag-card", l({
51
+ }), f = [".stacked", ".shadow", ".animated", "rounded", "variant", ".hasMedia", ".mediaPosition"];
52
+ function u(e, o, h, p, c, $) {
53
+ return i(), s("ag-card", r({
44
54
  ref: "agComponent",
45
55
  ".stacked": e.stacked,
46
56
  ".shadow": e.shadow,
47
57
  ".animated": e.animated,
48
58
  rounded: e.rounded,
49
- variant: e.variant
59
+ variant: e.variant,
60
+ ".hasMedia": e.hasMedia,
61
+ ".mediaPosition": e.mediaPosition
50
62
  }, e.$attrs), [
63
+ a(e.$slots, "media", { slot: "media" }),
51
64
  a(e.$slots, "header", { slot: "header" }),
52
65
  a(e.$slots, "default"),
53
66
  a(e.$slots, "footer", { slot: "footer" })
54
67
  ], 48, f);
55
68
  }
56
- const v = /* @__PURE__ */ i(u, [["render", m]]);
69
+ const y = /* @__PURE__ */ l(m, [["render", u]]);
57
70
  export {
58
- v as default
71
+ y as default
59
72
  };
@@ -1,5 +1,5 @@
1
1
  import { PropType } from 'vue';
2
- import { CardProps, CardVariant, CardRounded } from '../core/Card';
2
+ import { CardProps, CardVariant, CardRounded, CardMediaPosition } from '../core/Card';
3
3
 
4
4
  declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
5
5
  stacked: {
@@ -22,6 +22,14 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
22
22
  type: PropType<CardVariant>;
23
23
  default: CardVariant;
24
24
  };
25
+ hasMedia: {
26
+ type: BooleanConstructor;
27
+ default: boolean;
28
+ };
29
+ mediaPosition: {
30
+ type: PropType<CardMediaPosition>;
31
+ default: CardMediaPosition;
32
+ };
25
33
  }>, {
26
34
  agComponent: import('vue').Ref<(HTMLElement & CardProps) | null, (HTMLElement & CardProps) | null>;
27
35
  stacked: boolean;
@@ -29,6 +37,8 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
29
37
  animated: boolean;
30
38
  rounded: boolean | CardRounded;
31
39
  variant: CardVariant;
40
+ hasMedia: boolean;
41
+ mediaPosition: CardMediaPosition;
32
42
  }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
33
43
  stacked: {
34
44
  type: BooleanConstructor;
@@ -50,12 +60,22 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
50
60
  type: PropType<CardVariant>;
51
61
  default: CardVariant;
52
62
  };
63
+ hasMedia: {
64
+ type: BooleanConstructor;
65
+ default: boolean;
66
+ };
67
+ mediaPosition: {
68
+ type: PropType<CardMediaPosition>;
69
+ default: CardMediaPosition;
70
+ };
53
71
  }>> & Readonly<{}>, {
54
72
  variant: CardVariant;
55
73
  rounded: boolean | CardRounded;
56
74
  shadow: boolean;
57
75
  stacked: boolean;
58
76
  animated: boolean;
77
+ hasMedia: boolean;
78
+ mediaPosition: CardMediaPosition;
59
79
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
60
80
  export default _default;
61
81
  //# sourceMappingURL=VueCard.vue.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"VueCard.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Card/vue/VueCard.vue"],"names":[],"mappings":"AAqBA;AAEA,OAAO,EAAmC,KAAK,QAAQ,EAAE,MAAM,KAAK,CAAC;AACrE,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AACxE,OAAO,cAAc,CAAC;;;;;;;;;;;;;;;cAkBW,QAAQ,CAAC,WAAW,GAAG,OAAO,CAAC;iBAC3C,WAAW;;;cAGV,QAAQ,CAAC,WAAW,CAAC;iBACtB,WAAW;;;;;;;;;;;;;;;;;;;;;;;cALC,QAAQ,CAAC,WAAW,GAAG,OAAO,CAAC;iBAC3C,WAAW;;;cAGV,QAAQ,CAAC,WAAW,CAAC;iBACtB,WAAW;;;;;;;;;AArBhC,wBA6CG"}
1
+ {"version":3,"file":"VueCard.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Card/vue/VueCard.vue"],"names":[],"mappings":"AA2BA;AAEA,OAAO,EAAmC,KAAK,QAAQ,EAAE,MAAM,KAAK,CAAC;AACrE,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAC3F,OAAO,cAAc,CAAC;;;;;;;;;;;;;;;cAkBW,QAAQ,CAAC,WAAW,GAAG,OAAO,CAAC;iBAC3C,WAAW;;;cAGV,QAAQ,CAAC,WAAW,CAAC;iBACtB,WAAW;;;;;;;cAOV,QAAQ,CAAC,iBAAiB,CAAC;iBACzB,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;cAbR,QAAQ,CAAC,WAAW,GAAG,OAAO,CAAC;iBAC3C,WAAW;;;cAGV,QAAQ,CAAC,WAAW,CAAC;iBACtB,WAAW;;;;;;;cAOV,QAAQ,CAAC,iBAAiB,CAAC;iBACzB,iBAAiB;;;;;;;;;;;AA7BzC,wBAuDG"}