@rebilly/revel 4.5.1 → 4.7.0

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.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,17 @@
1
+ ## [4.7.0](https://github.com/Rebilly/rebilly/compare/revel-v4.6.0...revel-v4.7.0) (2023-05-17)
2
+
3
+
4
+ ### Features
5
+
6
+ * **revel:** Update r-button icon loading states ([#264](https://github.com/Rebilly/rebilly/issues/264)) ([97896a5](https://github.com/Rebilly/rebilly/commit/97896a5cabcea9306fe46a377f0cac322661dec1))
7
+
8
+ ## [4.6.0](https://github.com/Rebilly/rebilly/compare/revel-v4.5.1...revel-v4.6.0) (2023-05-16)
9
+
10
+
11
+ ### Features
12
+
13
+ * **revel:** Add icon to r-button component ([#254](https://github.com/Rebilly/rebilly/issues/254)) ([e1aa0c6](https://github.com/Rebilly/rebilly/commit/e1aa0c6ff545f4f14caf8990cedea44bdc4583a5))
14
+
1
15
  ## [4.5.1](https://github.com/Rebilly/rebilly/compare/revel-v4.5.0...revel-v4.5.1) (2023-05-12)
2
16
 
3
17
 
package/dist/revel.es.js CHANGED
@@ -1,4 +1,4 @@
1
- import { openBlock, createElementBlock, normalizeClass, createElementVNode, resolveDirective, mergeProps, withDirectives, renderSlot, vShow, resolveComponent, toDisplayString, createCommentVNode, createVNode, createTextVNode, createBlock, withKeys, withModifiers, reactive, computed, h, Transition, withCtx, normalizeStyle, Fragment, renderList, resolveDynamicComponent, toHandlers, vModelText, inject, toRefs, ref, render } from 'vue';
1
+ import { openBlock, createElementBlock, normalizeClass, createElementVNode, resolveDirective, mergeProps, withDirectives, renderSlot, vShow, resolveComponent, toDisplayString, createCommentVNode, createVNode, createTextVNode, createBlock, withKeys, withModifiers, Fragment, reactive, computed, h, Transition, withCtx, normalizeStyle, renderList, resolveDynamicComponent, toHandlers, vModelText, inject, toRefs, ref, render } from 'vue';
2
2
  import moment$2 from 'moment';
3
3
 
4
4
  var tokens$1 = '';
@@ -1778,6 +1778,27 @@ const _sfc_main$t = {
1778
1778
  type: Boolean,
1779
1779
  default: true,
1780
1780
  },
1781
+ /**
1782
+ * Append icon to the left side of the button
1783
+ */
1784
+ iconLeft: {
1785
+ type: String,
1786
+ default: null,
1787
+ },
1788
+ /**
1789
+ * Append icon to the right side of the button
1790
+ */
1791
+ iconRight: {
1792
+ type: String,
1793
+ default: null,
1794
+ },
1795
+ /**
1796
+ * Displays only icon
1797
+ */
1798
+ icon: {
1799
+ type: String,
1800
+ default: null,
1801
+ },
1781
1802
  },
1782
1803
  data() {
1783
1804
  return {
@@ -1789,14 +1810,23 @@ const _sfc_main$t = {
1789
1810
  },
1790
1811
  computed: {
1791
1812
  classes() {
1813
+ const iconStyles = {
1814
+ 'r-has-icon-left': Boolean(this.iconLeft),
1815
+ 'r-has-icon-right': Boolean(this.iconRight),
1816
+ 'r-has-icon': Boolean(this.icon),
1817
+ };
1792
1818
  if (this.link && this.type === 'unstyled') {
1793
- return 'r-button-type-link';
1819
+ return {
1820
+ 'r-button-type-link': true,
1821
+ ...iconStyles,
1822
+ };
1794
1823
  }
1795
1824
  return {
1796
1825
  [`r-button-size-${this.size}`]: !!this.size,
1797
1826
  [`r-button-type-${this.type}`]: !!this.type,
1798
1827
  'r-button-fluid': !!this.fluid,
1799
1828
  'r-is-active': !!this.active,
1829
+ ...iconStyles,
1800
1830
  };
1801
1831
  },
1802
1832
  title() {
@@ -1829,7 +1859,7 @@ const _hoisted_2$i = {
1829
1859
  };
1830
1860
  const _hoisted_3$c = ["role", "disabled", "title"];
1831
1861
  const _hoisted_4$c = {
1832
- key: 1,
1862
+ key: 0,
1833
1863
  class: "r-capitalize-first-letter",
1834
1864
  role: "button"
1835
1865
  };
@@ -1840,20 +1870,39 @@ function _sfc_render$t(_ctx, _cache, $props, $setup, $data, $options) {
1840
1870
  return ($props.link)
1841
1871
  ? (openBlock(), createElementBlock("a", {
1842
1872
  key: 0,
1843
- role: "button",
1873
+ role: "link",
1844
1874
  class: normalizeClass(["r-button", $options.classes]),
1845
1875
  href: $options.href,
1846
1876
  target: _ctx.$attrs.href ? '_target' : _ctx.$attrs.target || ''
1847
1877
  }, [
1848
- ($props.capitalizeFirstLetter)
1849
- ? (openBlock(), createElementBlock("div", _hoisted_2$i, [
1850
- renderSlot(_ctx.$slots, "default", {}, () => [
1851
- createTextVNode("Link")
1852
- ])
1853
- ]))
1854
- : renderSlot(_ctx.$slots, "default", { key: 1 }, () => [
1855
- createTextVNode("Apply")
1856
- ])
1878
+ ($props.iconLeft)
1879
+ ? (openBlock(), createBlock(_component_r_icon, {
1880
+ key: 0,
1881
+ icon: $props.iconLeft
1882
+ }, null, 8, ["icon"]))
1883
+ : createCommentVNode("", true),
1884
+ ($props.icon)
1885
+ ? (openBlock(), createBlock(_component_r_icon, {
1886
+ key: 1,
1887
+ icon: $props.icon
1888
+ }, null, 8, ["icon"]))
1889
+ : (openBlock(), createElementBlock(Fragment, { key: 2 }, [
1890
+ ($props.capitalizeFirstLetter)
1891
+ ? (openBlock(), createElementBlock("div", _hoisted_2$i, [
1892
+ renderSlot(_ctx.$slots, "default", {}, () => [
1893
+ createTextVNode("Link")
1894
+ ])
1895
+ ]))
1896
+ : renderSlot(_ctx.$slots, "default", { key: 1 }, () => [
1897
+ createTextVNode("Apply")
1898
+ ])
1899
+ ], 64)),
1900
+ ($props.iconRight)
1901
+ ? (openBlock(), createBlock(_component_r_icon, {
1902
+ key: 3,
1903
+ icon: $props.iconRight
1904
+ }, null, 8, ["icon"]))
1905
+ : createCommentVNode("", true)
1857
1906
  ], 10, _hoisted_1$o))
1858
1907
  : (openBlock(), createElementBlock("button", mergeProps({
1859
1908
  key: 1,
@@ -1865,18 +1914,39 @@ function _sfc_render$t(_ctx, _cache, $props, $setup, $data, $options) {
1865
1914
  ? (openBlock(), createBlock(_component_r_icon, {
1866
1915
  key: 0,
1867
1916
  icon: "loading",
1868
- class: "r-is-spinning r-icon-light-gray r-inline-3"
1869
- }))
1917
+ class: normalizeClass(["r-is-spinning r-icon-light-gray", { 'r-inline-3': !$props.icon }])
1918
+ }, null, 8, ["class"]))
1870
1919
  : createCommentVNode("", true),
1871
- ($props.capitalizeFirstLetter)
1872
- ? (openBlock(), createElementBlock("div", _hoisted_4$c, [
1873
- renderSlot(_ctx.$slots, "default", {}, () => [
1874
- createTextVNode("Apply")
1875
- ])
1876
- ]))
1877
- : renderSlot(_ctx.$slots, "default", { key: 2 }, () => [
1878
- createTextVNode("Apply")
1879
- ])
1920
+ ($props.iconLeft && !$props.loading)
1921
+ ? (openBlock(), createBlock(_component_r_icon, {
1922
+ key: 1,
1923
+ icon: $props.iconLeft
1924
+ }, null, 8, ["icon"]))
1925
+ : createCommentVNode("", true),
1926
+ ($props.icon && !$props.loading)
1927
+ ? (openBlock(), createBlock(_component_r_icon, {
1928
+ key: 2,
1929
+ icon: $props.icon
1930
+ }, null, 8, ["icon"]))
1931
+ : (!$props.icon)
1932
+ ? (openBlock(), createElementBlock(Fragment, { key: 3 }, [
1933
+ ($props.capitalizeFirstLetter)
1934
+ ? (openBlock(), createElementBlock("div", _hoisted_4$c, [
1935
+ renderSlot(_ctx.$slots, "default", {}, () => [
1936
+ createTextVNode("Apply")
1937
+ ])
1938
+ ]))
1939
+ : renderSlot(_ctx.$slots, "default", { key: 1 }, () => [
1940
+ createTextVNode("Apply")
1941
+ ])
1942
+ ], 64))
1943
+ : createCommentVNode("", true),
1944
+ ($props.iconRight && !$props.loading)
1945
+ ? (openBlock(), createBlock(_component_r_icon, {
1946
+ key: 4,
1947
+ icon: $props.iconRight
1948
+ }, null, 8, ["icon"]))
1949
+ : createCommentVNode("", true)
1880
1950
  ], 16, _hoisted_3$c))
1881
1951
  }
1882
1952
  var RButton = /*#__PURE__*/_export_sfc$1(_sfc_main$t, [['render',_sfc_render$t]]);
@@ -17248,7 +17318,6 @@ const _sfc_main$b = {
17248
17318
  components: {
17249
17319
  RLoader,
17250
17320
  RButton,
17251
- RIcon: rIcon,
17252
17321
  },
17253
17322
  props: {
17254
17323
  /**
@@ -17391,7 +17460,6 @@ const _hoisted_8$2 = {
17391
17460
  };
17392
17461
 
17393
17462
  function _sfc_render$b(_ctx, _cache, $props, $setup, $data, $options) {
17394
- const _component_r_icon = resolveComponent("r-icon");
17395
17463
  const _component_r_button = resolveComponent("r-button");
17396
17464
  const _component_r_loader = resolveComponent("r-loader");
17397
17465
 
@@ -17435,15 +17503,12 @@ function _sfc_render$b(_ctx, _cache, $props, $setup, $data, $options) {
17435
17503
  ]))
17436
17504
  : createCommentVNode("", true),
17437
17505
  createVNode(_component_r_button, {
17438
- type: "link",
17506
+ type: "plain",
17507
+ size: "small",
17439
17508
  class: "r-modal-btn-close",
17440
17509
  "aria-label": "close",
17510
+ icon: "close",
17441
17511
  onClick: _cache[0] || (_cache[0] = $event => (_ctx.$emit('close')))
17442
- }, {
17443
- default: withCtx(() => [
17444
- createVNode(_component_r_icon, { icon: "close" })
17445
- ]),
17446
- _: 1
17447
17512
  })
17448
17513
  ]))
17449
17514
  : createCommentVNode("", true),