@dnncommunity/dnn-elements 0.13.0-beta.1

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 (244) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +24 -0
  3. package/dist/cjs/app-globals-3a1e7e63.js +7 -0
  4. package/dist/cjs/app-globals-3a1e7e63.js.map +1 -0
  5. package/dist/cjs/css-shim-3bfdba4f.js +8 -0
  6. package/dist/cjs/css-shim-3bfdba4f.js.map +1 -0
  7. package/dist/cjs/debounce-1de79bc7.js +24 -0
  8. package/dist/cjs/debounce-1de79bc7.js.map +1 -0
  9. package/dist/cjs/dnn-button.cjs.entry.js +88 -0
  10. package/dist/cjs/dnn-button.cjs.entry.js.map +1 -0
  11. package/dist/cjs/dnn-button_14.cjs.entry.js +1580 -0
  12. package/dist/cjs/dnn-button_14.cjs.entry.js.map +1 -0
  13. package/dist/cjs/dnn-checkbox.cjs.entry.js +58 -0
  14. package/dist/cjs/dnn-checkbox.cjs.entry.js.map +1 -0
  15. package/dist/cjs/dnn-chevron.cjs.entry.js +34 -0
  16. package/dist/cjs/dnn-chevron.cjs.entry.js.map +1 -0
  17. package/dist/cjs/dnn-collapsible.cjs.entry.js +112 -0
  18. package/dist/cjs/dnn-collapsible.cjs.entry.js.map +1 -0
  19. package/dist/cjs/dnn-color-picker.cjs.entry.js +508 -0
  20. package/dist/cjs/dnn-color-picker.cjs.entry.js.map +1 -0
  21. package/dist/cjs/dnn-dropzone.cjs.entry.js +153 -0
  22. package/dist/cjs/dnn-dropzone.cjs.entry.js.map +1 -0
  23. package/dist/cjs/dnn-image-cropper.cjs.entry.js +424 -0
  24. package/dist/cjs/dnn-image-cropper.cjs.entry.js.map +1 -0
  25. package/dist/cjs/dnn-modal.cjs.entry.js +62 -0
  26. package/dist/cjs/dnn-modal.cjs.entry.js.map +1 -0
  27. package/dist/cjs/dnn-searchbox.cjs.entry.js +66 -0
  28. package/dist/cjs/dnn-searchbox.cjs.entry.js.map +1 -0
  29. package/dist/cjs/dnn-sort-icon.cjs.entry.js +43 -0
  30. package/dist/cjs/dnn-sort-icon.cjs.entry.js.map +1 -0
  31. package/dist/cjs/dnn-tab.cjs.entry.js +31 -0
  32. package/dist/cjs/dnn-tab.cjs.entry.js.map +1 -0
  33. package/dist/cjs/dnn-tabs.cjs.entry.js +50 -0
  34. package/dist/cjs/dnn-tabs.cjs.entry.js.map +1 -0
  35. package/dist/cjs/dnn-toggle.cjs.entry.js +37 -0
  36. package/dist/cjs/dnn-toggle.cjs.entry.js.map +1 -0
  37. package/dist/cjs/dnn-treeview-item.cjs.entry.js +48 -0
  38. package/dist/cjs/dnn-treeview-item.cjs.entry.js.map +1 -0
  39. package/dist/cjs/dnn.cjs.js +129 -0
  40. package/dist/cjs/dnn.cjs.js.map +1 -0
  41. package/dist/cjs/dom-8ac1ad03.js +77 -0
  42. package/dist/cjs/dom-8ac1ad03.js.map +1 -0
  43. package/dist/cjs/index-e85ec026.js +1327 -0
  44. package/dist/cjs/index-e85ec026.js.map +1 -0
  45. package/dist/cjs/index-eede7745.js +3069 -0
  46. package/dist/cjs/index-eede7745.js.map +1 -0
  47. package/dist/cjs/index.cjs.js +52 -0
  48. package/dist/cjs/index.cjs.js.map +1 -0
  49. package/dist/cjs/loader.cjs.js +39 -0
  50. package/dist/cjs/loader.cjs.js.map +1 -0
  51. package/dist/cjs/shadow-css-41d9783d.js +392 -0
  52. package/dist/cjs/shadow-css-41d9783d.js.map +1 -0
  53. package/dist/collection/collection-manifest.json +25 -0
  54. package/dist/collection/components/dnn-button/dnn-button.css +87 -0
  55. package/dist/collection/components/dnn-button/dnn-button.js +272 -0
  56. package/dist/collection/components/dnn-button/dnn-button.js.map +1 -0
  57. package/dist/collection/components/dnn-checkbox/dnn-checkbox.css +27 -0
  58. package/dist/collection/components/dnn-checkbox/dnn-checkbox.js +140 -0
  59. package/dist/collection/components/dnn-checkbox/dnn-checkbox.js.map +1 -0
  60. package/dist/collection/components/dnn-chevron/dnn-chevron.css +30 -0
  61. package/dist/collection/components/dnn-chevron/dnn-chevron.js +107 -0
  62. package/dist/collection/components/dnn-chevron/dnn-chevron.js.map +1 -0
  63. package/dist/collection/components/dnn-collapsible/dnn-collapsible.css +8 -0
  64. package/dist/collection/components/dnn-collapsible/dnn-collapsible.js +188 -0
  65. package/dist/collection/components/dnn-collapsible/dnn-collapsible.js.map +1 -0
  66. package/dist/collection/components/dnn-color-picker/dnn-color-picker.css +225 -0
  67. package/dist/collection/components/dnn-color-picker/dnn-color-picker.js +434 -0
  68. package/dist/collection/components/dnn-color-picker/dnn-color-picker.js.map +1 -0
  69. package/dist/collection/components/dnn-dropzone/dnn-dropzone.css +62 -0
  70. package/dist/collection/components/dnn-dropzone/dnn-dropzone.js +266 -0
  71. package/dist/collection/components/dnn-dropzone/dnn-dropzone.js.map +1 -0
  72. package/dist/collection/components/dnn-image-cropper/CornerType.js +9 -0
  73. package/dist/collection/components/dnn-image-cropper/CornerType.js.map +1 -0
  74. package/dist/collection/components/dnn-image-cropper/dnn-image-cropper.css +80 -0
  75. package/dist/collection/components/dnn-image-cropper/dnn-image-cropper.js +539 -0
  76. package/dist/collection/components/dnn-image-cropper/dnn-image-cropper.js.map +1 -0
  77. package/dist/collection/components/dnn-modal/dnn-modal.css +67 -0
  78. package/dist/collection/components/dnn-modal/dnn-modal.js +173 -0
  79. package/dist/collection/components/dnn-modal/dnn-modal.js.map +1 -0
  80. package/dist/collection/components/dnn-searchbox/dnn-searchbox.css +48 -0
  81. package/dist/collection/components/dnn-searchbox/dnn-searchbox.js +137 -0
  82. package/dist/collection/components/dnn-searchbox/dnn-searchbox.js.map +1 -0
  83. package/dist/collection/components/dnn-sort-icon/dnn-sort-icon.css +32 -0
  84. package/dist/collection/components/dnn-sort-icon/dnn-sort-icon.js +81 -0
  85. package/dist/collection/components/dnn-sort-icon/dnn-sort-icon.js.map +1 -0
  86. package/dist/collection/components/dnn-tab/dnn-tab.css +0 -0
  87. package/dist/collection/components/dnn-tab/dnn-tab.js +84 -0
  88. package/dist/collection/components/dnn-tab/dnn-tab.js.map +1 -0
  89. package/dist/collection/components/dnn-tabs/dnn-tabs.css +40 -0
  90. package/dist/collection/components/dnn-tabs/dnn-tabs.js +53 -0
  91. package/dist/collection/components/dnn-tabs/dnn-tabs.js.map +1 -0
  92. package/dist/collection/components/dnn-toggle/dnn-toggle.css +52 -0
  93. package/dist/collection/components/dnn-toggle/dnn-toggle.js +94 -0
  94. package/dist/collection/components/dnn-toggle/dnn-toggle.js.map +1 -0
  95. package/dist/collection/components/dnn-toggle/toggle-interface.js +2 -0
  96. package/dist/collection/components/dnn-toggle/toggle-interface.js.map +1 -0
  97. package/dist/collection/components/dnn-treeview-item/dnn-treeview-item.css +47 -0
  98. package/dist/collection/components/dnn-treeview-item/dnn-treeview-item.js +77 -0
  99. package/dist/collection/components/dnn-treeview-item/dnn-treeview-item.js.map +1 -0
  100. package/dist/collection/index.js +3 -0
  101. package/dist/collection/index.js.map +1 -0
  102. package/dist/collection/utilities/colorInfo.js +191 -0
  103. package/dist/collection/utilities/colorInfo.js.map +1 -0
  104. package/dist/collection/utilities/debounce.js +19 -0
  105. package/dist/collection/utilities/debounce.js.map +1 -0
  106. package/dist/collection/utilities/dnnServicesFramework.js +42 -0
  107. package/dist/collection/utilities/dnnServicesFramework.js.map +1 -0
  108. package/dist/dnn/app-globals-0f993ce5.js +5 -0
  109. package/dist/dnn/app-globals-0f993ce5.js.map +1 -0
  110. package/dist/dnn/css-shim-20dbffa5.js +6 -0
  111. package/dist/dnn/css-shim-20dbffa5.js.map +1 -0
  112. package/dist/dnn/debounce-06f55268.js +22 -0
  113. package/dist/dnn/debounce-06f55268.js.map +1 -0
  114. package/dist/dnn/dnn-button.entry.js +84 -0
  115. package/dist/dnn/dnn-button.entry.js.map +1 -0
  116. package/dist/dnn/dnn-checkbox.entry.js +54 -0
  117. package/dist/dnn/dnn-checkbox.entry.js.map +1 -0
  118. package/dist/dnn/dnn-chevron.entry.js +30 -0
  119. package/dist/dnn/dnn-chevron.entry.js.map +1 -0
  120. package/dist/dnn/dnn-collapsible.entry.js +108 -0
  121. package/dist/dnn/dnn-collapsible.entry.js.map +1 -0
  122. package/dist/dnn/dnn-color-picker.entry.js +504 -0
  123. package/dist/dnn/dnn-color-picker.entry.js.map +1 -0
  124. package/dist/dnn/dnn-dropzone.entry.js +149 -0
  125. package/dist/dnn/dnn-dropzone.entry.js.map +1 -0
  126. package/dist/dnn/dnn-image-cropper.entry.js +420 -0
  127. package/dist/dnn/dnn-image-cropper.entry.js.map +1 -0
  128. package/dist/dnn/dnn-modal.entry.js +58 -0
  129. package/dist/dnn/dnn-modal.entry.js.map +1 -0
  130. package/dist/dnn/dnn-searchbox.entry.js +62 -0
  131. package/dist/dnn/dnn-searchbox.entry.js.map +1 -0
  132. package/dist/dnn/dnn-sort-icon.entry.js +39 -0
  133. package/dist/dnn/dnn-sort-icon.entry.js.map +1 -0
  134. package/dist/dnn/dnn-tab.entry.js +27 -0
  135. package/dist/dnn/dnn-tab.entry.js.map +1 -0
  136. package/dist/dnn/dnn-tabs.entry.js +46 -0
  137. package/dist/dnn/dnn-tabs.entry.js.map +1 -0
  138. package/dist/dnn/dnn-toggle.entry.js +33 -0
  139. package/dist/dnn/dnn-toggle.entry.js.map +1 -0
  140. package/dist/dnn/dnn-treeview-item.entry.js +44 -0
  141. package/dist/dnn/dnn-treeview-item.entry.js.map +1 -0
  142. package/dist/dnn/dnn.esm.js +127 -0
  143. package/dist/dnn/dnn.esm.js.map +1 -0
  144. package/dist/dnn/dom-c5ed0ba5.js +75 -0
  145. package/dist/dnn/dom-c5ed0ba5.js.map +1 -0
  146. package/dist/dnn/index-6c0764e5.js +3033 -0
  147. package/dist/dnn/index-6c0764e5.js.map +1 -0
  148. package/dist/dnn/index.esm.js +47 -0
  149. package/dist/dnn/index.esm.js.map +1 -0
  150. package/dist/dnn/p-0e94f5ee.js +2 -0
  151. package/dist/dnn/p-0e94f5ee.js.map +1 -0
  152. package/dist/dnn/p-7acf3104.entry.js +11 -0
  153. package/dist/dnn/p-7acf3104.entry.js.map +1 -0
  154. package/dist/dnn/p-bd3d3361.js +2 -0
  155. package/dist/dnn/p-bd3d3361.js.map +1 -0
  156. package/dist/dnn/shadow-css-8c625855.js +390 -0
  157. package/dist/dnn/shadow-css-8c625855.js.map +1 -0
  158. package/dist/esm/app-globals-0f993ce5.js +5 -0
  159. package/dist/esm/app-globals-0f993ce5.js.map +1 -0
  160. package/dist/esm/css-shim-20dbffa5.js +6 -0
  161. package/dist/esm/css-shim-20dbffa5.js.map +1 -0
  162. package/dist/esm/debounce-06f55268.js +22 -0
  163. package/dist/esm/debounce-06f55268.js.map +1 -0
  164. package/dist/esm/dnn-button.entry.js +84 -0
  165. package/dist/esm/dnn-button.entry.js.map +1 -0
  166. package/dist/esm/dnn-button_14.entry.js +1563 -0
  167. package/dist/esm/dnn-button_14.entry.js.map +1 -0
  168. package/dist/esm/dnn-checkbox.entry.js +54 -0
  169. package/dist/esm/dnn-checkbox.entry.js.map +1 -0
  170. package/dist/esm/dnn-chevron.entry.js +30 -0
  171. package/dist/esm/dnn-chevron.entry.js.map +1 -0
  172. package/dist/esm/dnn-collapsible.entry.js +108 -0
  173. package/dist/esm/dnn-collapsible.entry.js.map +1 -0
  174. package/dist/esm/dnn-color-picker.entry.js +504 -0
  175. package/dist/esm/dnn-color-picker.entry.js.map +1 -0
  176. package/dist/esm/dnn-dropzone.entry.js +149 -0
  177. package/dist/esm/dnn-dropzone.entry.js.map +1 -0
  178. package/dist/esm/dnn-image-cropper.entry.js +420 -0
  179. package/dist/esm/dnn-image-cropper.entry.js.map +1 -0
  180. package/dist/esm/dnn-modal.entry.js +58 -0
  181. package/dist/esm/dnn-modal.entry.js.map +1 -0
  182. package/dist/esm/dnn-searchbox.entry.js +62 -0
  183. package/dist/esm/dnn-searchbox.entry.js.map +1 -0
  184. package/dist/esm/dnn-sort-icon.entry.js +39 -0
  185. package/dist/esm/dnn-sort-icon.entry.js.map +1 -0
  186. package/dist/esm/dnn-tab.entry.js +27 -0
  187. package/dist/esm/dnn-tab.entry.js.map +1 -0
  188. package/dist/esm/dnn-tabs.entry.js +46 -0
  189. package/dist/esm/dnn-tabs.entry.js.map +1 -0
  190. package/dist/esm/dnn-toggle.entry.js +33 -0
  191. package/dist/esm/dnn-toggle.entry.js.map +1 -0
  192. package/dist/esm/dnn-treeview-item.entry.js +44 -0
  193. package/dist/esm/dnn-treeview-item.entry.js.map +1 -0
  194. package/dist/esm/dnn.js +127 -0
  195. package/dist/esm/dnn.js.map +1 -0
  196. package/dist/esm/dom-c5ed0ba5.js +75 -0
  197. package/dist/esm/dom-c5ed0ba5.js.map +1 -0
  198. package/dist/esm/index-6c0764e5.js +3033 -0
  199. package/dist/esm/index-6c0764e5.js.map +1 -0
  200. package/dist/esm/index-f79d9e82.js +1299 -0
  201. package/dist/esm/index-f79d9e82.js.map +1 -0
  202. package/dist/esm/index.js +47 -0
  203. package/dist/esm/index.js.map +1 -0
  204. package/dist/esm/loader.js +35 -0
  205. package/dist/esm/loader.js.map +1 -0
  206. package/dist/esm/polyfills/core-js.js +11 -0
  207. package/dist/esm/polyfills/css-shim.js +1 -0
  208. package/dist/esm/polyfills/dom.js +79 -0
  209. package/dist/esm/polyfills/es5-html-element.js +1 -0
  210. package/dist/esm/polyfills/index.js +34 -0
  211. package/dist/esm/polyfills/system.js +6 -0
  212. package/dist/esm/shadow-css-8c625855.js +390 -0
  213. package/dist/esm/shadow-css-8c625855.js.map +1 -0
  214. package/dist/index.cjs.js +1 -0
  215. package/dist/index.js +1 -0
  216. package/dist/types/components/dnn-button/dnn-button.d.ts +55 -0
  217. package/dist/types/components/dnn-checkbox/dnn-checkbox.d.ts +16 -0
  218. package/dist/types/components/dnn-chevron/dnn-chevron.d.ts +13 -0
  219. package/dist/types/components/dnn-collapsible/dnn-collapsible.d.ts +22 -0
  220. package/dist/types/components/dnn-color-picker/dnn-color-picker.d.ts +46 -0
  221. package/dist/types/components/dnn-dropzone/dnn-dropzone.d.ts +45 -0
  222. package/dist/types/components/dnn-image-cropper/CornerType.d.ts +6 -0
  223. package/dist/types/components/dnn-image-cropper/dnn-image-cropper.d.ts +62 -0
  224. package/dist/types/components/dnn-modal/dnn-modal.d.ts +35 -0
  225. package/dist/types/components/dnn-searchbox/dnn-searchbox.d.ts +22 -0
  226. package/dist/types/components/dnn-sort-icon/dnn-sort-icon.d.ts +9 -0
  227. package/dist/types/components/dnn-tab/dnn-tab.d.ts +11 -0
  228. package/dist/types/components/dnn-tabs/dnn-tabs.d.ts +11 -0
  229. package/dist/types/components/dnn-toggle/dnn-toggle.d.ts +13 -0
  230. package/dist/types/components/dnn-toggle/toggle-interface.d.ts +3 -0
  231. package/dist/types/components/dnn-treeview-item/dnn-treeview-item.d.ts +16 -0
  232. package/dist/types/components.d.ts +611 -0
  233. package/dist/types/index.d.ts +3 -0
  234. package/dist/types/stencil-public-runtime.d.ts +1565 -0
  235. package/dist/types/utilities/colorInfo.d.ts +52 -0
  236. package/dist/types/utilities/debounce.d.ts +5 -0
  237. package/dist/types/utilities/dnnServicesFramework.d.ts +19 -0
  238. package/loader/cdn.js +3 -0
  239. package/loader/index.cjs.js +3 -0
  240. package/loader/index.d.ts +12 -0
  241. package/loader/index.es2017.js +3 -0
  242. package/loader/index.js +4 -0
  243. package/loader/package.json +10 -0
  244. package/package.json +48 -0
@@ -0,0 +1,67 @@
1
+ :host {
2
+ /**
3
+ * @prop --max-width: The maximum width of the module.
4
+ */
5
+ display: block;
6
+ }
7
+ :host .overlay {
8
+ background-color: rgba(0, 0, 0, 0.5);
9
+ position: fixed;
10
+ top: 0;
11
+ left: 0;
12
+ width: 100%;
13
+ height: 100%;
14
+ z-index: 1;
15
+ display: flex;
16
+ justify-content: center;
17
+ align-items: center;
18
+ backdrop-filter: blur(2px);
19
+ transition: all 300ms ease-in-out;
20
+ visibility: hidden;
21
+ opacity: 0;
22
+ }
23
+ :host .overlay .modal {
24
+ max-width: var(--max-width, 1200px);
25
+ background-color: white;
26
+ padding: 30px;
27
+ transform: scale(2);
28
+ transition: all 300ms ease-in-out;
29
+ z-index: 2;
30
+ position: relative;
31
+ margin: 10%;
32
+ max-height: 80%;
33
+ border-radius: var(--dnn-controls-radius, 5px);
34
+ box-shadow: 10px 10px 20px 0 rgba(0, 0, 0, 0.5);
35
+ display: block;
36
+ }
37
+ :host .overlay .modal .close {
38
+ position: absolute;
39
+ background-color: white;
40
+ border: 2px solid white;
41
+ border-radius: 50%;
42
+ padding: 0;
43
+ margin: 0;
44
+ top: -12px;
45
+ right: -12px;
46
+ outline: none;
47
+ display: flex;
48
+ justify-content: center;
49
+ align-items: center;
50
+ }
51
+ :host .overlay .modal .close:focus, :host .overlay .modal .close:hover {
52
+ box-shadow: 0 0 2px 2px var(--dnn-color-primary, blue);
53
+ }
54
+ :host .overlay .modal .close svg {
55
+ width: 24px;
56
+ height: 24px;
57
+ color: grey;
58
+ }
59
+ :host .overlay.visible {
60
+ visibility: visible;
61
+ opacity: 1;
62
+ }
63
+ :host .overlay.visible .modal {
64
+ transform: scale(1);
65
+ box-shadow: 4px 4px 10px 0px rgba(0, 0, 0, 0.5);
66
+ display: block;
67
+ }
@@ -0,0 +1,173 @@
1
+ import { Component, Element, Host, h, Prop, Event, Method, State } from '@stencil/core';
2
+ export class DnnModal {
3
+ constructor() {
4
+ /**
5
+ * Pass false to remove the backdrop click auto-dismiss feature.
6
+ */
7
+ this.backdropDismiss = true;
8
+ /**
9
+ * Optionally pass the aria-label text for the close button.
10
+ * Defaults to "Close modal" if not provided.
11
+ */
12
+ this.closeText = "Close modal";
13
+ /**
14
+ * Optionally you can pass false to not show the close button.
15
+ * If you decide to do so, you should either not also prevent dismissal by clicking the backdrop
16
+ * or provide your own dismissal logic in the modal content.
17
+ */
18
+ this.showCloseButton = true;
19
+ this.visible = false;
20
+ }
21
+ /**
22
+ * Shows the modal
23
+ */
24
+ async show() {
25
+ this.visible = true;
26
+ }
27
+ /**
28
+ * Hides the modal
29
+ */
30
+ async hide() {
31
+ this.visible = false;
32
+ }
33
+ handleDismiss() {
34
+ this.visible = false;
35
+ this.dismissed.emit();
36
+ }
37
+ handleBackdropClick(e) {
38
+ const element = e.target;
39
+ if (element.id === "backdrop" && this.backdropDismiss) {
40
+ this.handleDismiss();
41
+ }
42
+ }
43
+ render() {
44
+ return (h(Host, null,
45
+ h("div", { id: "backdrop", class: this.visible ? 'overlay visible' : 'overlay', onClick: e => this.handleBackdropClick(e) },
46
+ h("div", { class: "modal" },
47
+ this.showCloseButton &&
48
+ h("button", { class: "close", "aria-label": this.closeText, onClick: () => this.handleDismiss() },
49
+ h("svg", { xmlns: "http://www.w3.org/2000/svg", height: "24px", viewBox: "0 0 24 24", width: "24px", fill: "#000000" },
50
+ h("path", { d: "M0 0h24v24H0z", fill: "none" }),
51
+ h("path", { d: "M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z" }))),
52
+ h("slot", null)))));
53
+ }
54
+ static get is() { return "dnn-modal"; }
55
+ static get encapsulation() { return "shadow"; }
56
+ static get originalStyleUrls() { return {
57
+ "$": ["dnn-modal.scss"]
58
+ }; }
59
+ static get styleUrls() { return {
60
+ "$": ["dnn-modal.css"]
61
+ }; }
62
+ static get properties() { return {
63
+ "backdropDismiss": {
64
+ "type": "boolean",
65
+ "mutable": false,
66
+ "complexType": {
67
+ "original": "boolean",
68
+ "resolved": "boolean",
69
+ "references": {}
70
+ },
71
+ "required": false,
72
+ "optional": false,
73
+ "docs": {
74
+ "tags": [],
75
+ "text": "Pass false to remove the backdrop click auto-dismiss feature."
76
+ },
77
+ "attribute": "backdrop-dismiss",
78
+ "reflect": false,
79
+ "defaultValue": "true"
80
+ },
81
+ "closeText": {
82
+ "type": "string",
83
+ "mutable": false,
84
+ "complexType": {
85
+ "original": "string",
86
+ "resolved": "string",
87
+ "references": {}
88
+ },
89
+ "required": false,
90
+ "optional": true,
91
+ "docs": {
92
+ "tags": [],
93
+ "text": "Optionally pass the aria-label text for the close button.\r\nDefaults to \"Close modal\" if not provided."
94
+ },
95
+ "attribute": "close-text",
96
+ "reflect": false,
97
+ "defaultValue": "\"Close modal\""
98
+ },
99
+ "showCloseButton": {
100
+ "type": "boolean",
101
+ "mutable": false,
102
+ "complexType": {
103
+ "original": "boolean",
104
+ "resolved": "boolean",
105
+ "references": {}
106
+ },
107
+ "required": false,
108
+ "optional": true,
109
+ "docs": {
110
+ "tags": [],
111
+ "text": "Optionally you can pass false to not show the close button.\r\nIf you decide to do so, you should either not also prevent dismissal by clicking the backdrop\r\nor provide your own dismissal logic in the modal content."
112
+ },
113
+ "attribute": "show-close-button",
114
+ "reflect": false,
115
+ "defaultValue": "true"
116
+ }
117
+ }; }
118
+ static get states() { return {
119
+ "visible": {}
120
+ }; }
121
+ static get events() { return [{
122
+ "method": "dismissed",
123
+ "name": "dismissed",
124
+ "bubbles": true,
125
+ "cancelable": true,
126
+ "composed": true,
127
+ "docs": {
128
+ "tags": [],
129
+ "text": "Fires when the modal is dismissed."
130
+ },
131
+ "complexType": {
132
+ "original": "any",
133
+ "resolved": "any",
134
+ "references": {}
135
+ }
136
+ }]; }
137
+ static get methods() { return {
138
+ "show": {
139
+ "complexType": {
140
+ "signature": "() => Promise<void>",
141
+ "parameters": [],
142
+ "references": {
143
+ "Promise": {
144
+ "location": "global"
145
+ }
146
+ },
147
+ "return": "Promise<void>"
148
+ },
149
+ "docs": {
150
+ "text": "Shows the modal",
151
+ "tags": []
152
+ }
153
+ },
154
+ "hide": {
155
+ "complexType": {
156
+ "signature": "() => Promise<void>",
157
+ "parameters": [],
158
+ "references": {
159
+ "Promise": {
160
+ "location": "global"
161
+ }
162
+ },
163
+ "return": "Promise<void>"
164
+ },
165
+ "docs": {
166
+ "text": "Hides the modal",
167
+ "tags": []
168
+ }
169
+ }
170
+ }; }
171
+ static get elementRef() { return "el"; }
172
+ }
173
+ //# sourceMappingURL=dnn-modal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dnn-modal.js","sourceRoot":"","sources":["../../../src/components/dnn-modal/dnn-modal.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAgB,MAAM,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAOtG,MAAM,OAAO,QAAQ;EALrB;IASE;;OAEG;IACK,oBAAe,GAAY,IAAI,CAAC;IAExC;;;OAGG;IACK,cAAS,GAAY,aAAa,CAAC;IAE3C;;;;OAIG;IACK,oBAAe,GAAa,IAAI,CAAC;IAEhC,YAAO,GAAY,KAAK,CAAC;GA0DnC;EAxDC;;KAEG;EAEH,KAAK,CAAC,IAAI;IACR,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;EACtB,CAAC;EAED;;KAEG;EAEH,KAAK,CAAC,IAAI;IACR,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;EACvB,CAAC;EAOO,aAAa;IACnB,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;IACrB,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC;EACxB,CAAC;EAEO,mBAAmB,CAAC,CAAa;IACvC,MAAM,OAAO,GAAI,CAAC,CAAC,MAAsB,CAAC;IAC1C,IAAI,OAAO,CAAC,EAAE,KAAK,UAAU,IAAI,IAAI,CAAC,eAAe,EAAC;MACpD,IAAI,CAAC,aAAa,EAAE,CAAC;KACtB;EACH,CAAC;EAED,MAAM;IACJ,OAAO,CACL,EAAC,IAAI;MACH,WAAK,EAAE,EAAC,UAAU,EAChB,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,SAAS,EACnD,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC,CAAC;QAEzC,WAAK,KAAK,EAAC,OAAO;UACf,IAAI,CAAC,eAAe;YACnB,cACE,KAAK,EAAC,OAAO,gBACD,IAAI,CAAC,SAAS,EAC1B,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,aAAa,EAAE;cAEnC,WAAK,KAAK,EAAC,4BAA4B,EAAC,MAAM,EAAC,MAAM,EAAC,OAAO,EAAC,WAAW,EAAC,KAAK,EAAC,MAAM,EAAC,IAAI,EAAC,SAAS;gBAAC,YAAM,CAAC,EAAC,eAAe,EAAC,IAAI,EAAC,MAAM,GAAE;gBAAA,YAAM,CAAC,EAAC,iLAAiL,GAAE,CAAM,CACrU;UAEX,eAAa,CACT,CACF,CACD,CACR,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Host, h, Prop, Event, EventEmitter, Method, State } from '@stencil/core';\r\n\r\n@Component({\r\n tag: 'dnn-modal',\r\n styleUrl: 'dnn-modal.scss',\r\n shadow: true\r\n})\r\nexport class DnnModal {\r\n \r\n @Element() el!: HTMLDnnModalElement;\r\n \r\n /**\r\n * Pass false to remove the backdrop click auto-dismiss feature.\r\n */\r\n @Prop() backdropDismiss: boolean = true;\r\n\r\n /**\r\n * Optionally pass the aria-label text for the close button.\r\n * Defaults to \"Close modal\" if not provided.\r\n */\r\n @Prop() closeText?: string = \"Close modal\";\r\n\r\n /**\r\n * Optionally you can pass false to not show the close button.\r\n * If you decide to do so, you should either not also prevent dismissal by clicking the backdrop\r\n * or provide your own dismissal logic in the modal content.\r\n */\r\n @Prop() showCloseButton?: boolean = true;\r\n\r\n @State() visible: boolean = false;\r\n\r\n /**\r\n * Shows the modal\r\n */\r\n @Method()\r\n async show() {\r\n this.visible = true;\r\n }\r\n\r\n /**\r\n * Hides the modal\r\n */\r\n @Method()\r\n async hide() {\r\n this.visible = false;\r\n }\r\n\r\n /**\r\n * Fires when the modal is dismissed.\r\n */\r\n @Event() dismissed!: EventEmitter;\r\n\r\n private handleDismiss(){\r\n this.visible = false;\r\n this.dismissed.emit();\r\n }\r\n\r\n private handleBackdropClick(e: MouseEvent): void {\r\n const element = (e.target as HTMLElement);\r\n if (element.id === \"backdrop\" && this.backdropDismiss){\r\n this.handleDismiss();\r\n }\r\n }\r\n\r\n render() {\r\n return (\r\n <Host>\r\n <div id=\"backdrop\"\r\n class={this.visible ? 'overlay visible' : 'overlay'}\r\n onClick={e => this.handleBackdropClick(e)}\r\n >\r\n <div class=\"modal\">\r\n {this.showCloseButton &&\r\n <button\r\n class=\"close\"\r\n aria-label={this.closeText}\r\n onClick={() => this.handleDismiss()}\r\n >\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 0 24 24\" width=\"24px\" fill=\"#000000\"><path d=\"M0 0h24v24H0z\" fill=\"none\"/><path d=\"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z\"/></svg>\r\n </button>\r\n }\r\n <slot></slot>\r\n </div>\r\n </div>\r\n </Host>\r\n );\r\n }\r\n}\r\n"]}
@@ -0,0 +1,48 @@
1
+ :host {
2
+ position: relative;
3
+ display: flex;
4
+ justify-content: space-between;
5
+ --background-color: transparent;
6
+ --color: #333;
7
+ --border-size: 1px;
8
+ --border-color: grey;
9
+ --border-active-color: black;
10
+ --border-radius: var(--dnn-controls-radius, 5px);
11
+ --padding: var(--dnn-controls-padding, 5px);
12
+ --focus-color: var(--dnn-color-primary, blue);
13
+ }
14
+ :host input {
15
+ width: 100%;
16
+ border: var(--border-size) solid var(--border-color);
17
+ outline: none;
18
+ border-radius: var(--border-radius);
19
+ padding: var(--padding);
20
+ padding-right: 32px;
21
+ transition: all 300ms ease-in-out;
22
+ }
23
+ :host input:focus, :host input:hover {
24
+ outline: none;
25
+ box-shadow: 0 0 2px 2px var(--focus-color);
26
+ }
27
+ :host svg {
28
+ position: absolute;
29
+ top: 0;
30
+ right: 0;
31
+ height: 100%;
32
+ transform: scale(0.7);
33
+ fill: var(--color);
34
+ outline: var(--color);
35
+ color: var(--color);
36
+ transition: all 300ms ease-in-out;
37
+ }
38
+ :host button {
39
+ background: transparent;
40
+ border: 0;
41
+ margin: 0;
42
+ padding: 0;
43
+ }
44
+ :host button:focus svg, :host button:hover svg {
45
+ fill: var(--focus-color);
46
+ outline: var(--focus-color);
47
+ color: var(--focus-color);
48
+ }
@@ -0,0 +1,137 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ import { Component, Host, h, Event, Watch, Prop } from '@stencil/core';
8
+ import { Debounce } from '../../utilities/debounce';
9
+ export class DnnSearchbox {
10
+ constructor() {
11
+ /**
12
+ * Sets the field placeholder text.
13
+ */
14
+ this.placeholder = "";
15
+ /**
16
+ * Debounces the queryChanged by 500ms.
17
+ */
18
+ this.debounced = true;
19
+ /** Sets the query */
20
+ this.query = "";
21
+ }
22
+ fireQueryChanged() {
23
+ if (this.debounced) {
24
+ this.debouncedHandleQueryChanged();
25
+ }
26
+ else {
27
+ this.handleQueryChanged();
28
+ }
29
+ }
30
+ handleQueryChanged() {
31
+ this.queryChanged.emit(this.query);
32
+ }
33
+ debouncedHandleQueryChanged() {
34
+ this.handleQueryChanged();
35
+ }
36
+ render() {
37
+ return (h(Host, null,
38
+ h("input", { type: "text", value: this.query, placeholder: this.placeholder, onInput: e => this.query = e.target.value }),
39
+ this.query !== "" ?
40
+ h("button", { class: "svg clear", onClick: () => this.query = "" },
41
+ h("svg", { xmlns: "http://www.w3.org/2000/svg", height: "24px", viewBox: "0 0 24 24", width: "24px", fill: "#000000" },
42
+ h("path", { d: "M0 0h24v24H0z", fill: "none" }),
43
+ h("path", { d: "M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z" })))
44
+ :
45
+ h("svg", { xmlns: "http://www.w3.org/2000/svg", height: "24px", viewBox: "0 0 24 24", width: "24px", fill: "#000000" },
46
+ h("path", { d: "M0 0h24v24H0z", fill: "none" }),
47
+ h("path", { d: "M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z" }))));
48
+ }
49
+ static get is() { return "dnn-searchbox"; }
50
+ static get encapsulation() { return "shadow"; }
51
+ static get originalStyleUrls() { return {
52
+ "$": ["dnn-searchbox.scss"]
53
+ }; }
54
+ static get styleUrls() { return {
55
+ "$": ["dnn-searchbox.css"]
56
+ }; }
57
+ static get properties() { return {
58
+ "placeholder": {
59
+ "type": "string",
60
+ "mutable": false,
61
+ "complexType": {
62
+ "original": "string",
63
+ "resolved": "string",
64
+ "references": {}
65
+ },
66
+ "required": false,
67
+ "optional": true,
68
+ "docs": {
69
+ "tags": [],
70
+ "text": "Sets the field placeholder text."
71
+ },
72
+ "attribute": "placeholder",
73
+ "reflect": false,
74
+ "defaultValue": "\"\""
75
+ },
76
+ "debounced": {
77
+ "type": "boolean",
78
+ "mutable": false,
79
+ "complexType": {
80
+ "original": "boolean",
81
+ "resolved": "boolean",
82
+ "references": {}
83
+ },
84
+ "required": false,
85
+ "optional": false,
86
+ "docs": {
87
+ "tags": [],
88
+ "text": "Debounces the queryChanged by 500ms."
89
+ },
90
+ "attribute": "debounced",
91
+ "reflect": false,
92
+ "defaultValue": "true"
93
+ },
94
+ "query": {
95
+ "type": "string",
96
+ "mutable": true,
97
+ "complexType": {
98
+ "original": "string",
99
+ "resolved": "string",
100
+ "references": {}
101
+ },
102
+ "required": false,
103
+ "optional": false,
104
+ "docs": {
105
+ "tags": [],
106
+ "text": "Sets the query"
107
+ },
108
+ "attribute": "query",
109
+ "reflect": false,
110
+ "defaultValue": "\"\""
111
+ }
112
+ }; }
113
+ static get events() { return [{
114
+ "method": "queryChanged",
115
+ "name": "queryChanged",
116
+ "bubbles": true,
117
+ "cancelable": true,
118
+ "composed": true,
119
+ "docs": {
120
+ "tags": [],
121
+ "text": "Fires up each time the search query changes.\r\nThe data passed is the new query."
122
+ },
123
+ "complexType": {
124
+ "original": "any",
125
+ "resolved": "any",
126
+ "references": {}
127
+ }
128
+ }]; }
129
+ static get watchers() { return [{
130
+ "propName": "query",
131
+ "methodName": "fireQueryChanged"
132
+ }]; }
133
+ }
134
+ __decorate([
135
+ Debounce(500)
136
+ ], DnnSearchbox.prototype, "debouncedHandleQueryChanged", null);
137
+ //# sourceMappingURL=dnn-searchbox.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dnn-searchbox.js","sourceRoot":"","sources":["../../../src/components/dnn-searchbox/dnn-searchbox.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAgB,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACrF,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAMpD,MAAM,OAAO,YAAY;EALzB;IAOE;;OAEG;IACK,gBAAW,GAAY,EAAE,CAAC;IAElC;;OAEG;IACK,cAAS,GAAY,IAAI,CAAC;IAElC,qBAAqB;IACE,UAAK,GAAW,EAAE,CAAC;GAgD3C;EAvCC,gBAAgB;IACd,IAAI,IAAI,CAAC,SAAS,EAAC;MACjB,IAAI,CAAC,2BAA2B,EAAE,CAAC;KACpC;SACG;MACF,IAAI,CAAC,kBAAkB,EAAE,CAAC;KAC3B;EACH,CAAC;EAEO,kBAAkB;IACxB,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;EACrC,CAAC;EAGO,2BAA2B;IACjC,IAAI,CAAC,kBAAkB,EAAE,CAAC;EAC5B,CAAC;EAGD,MAAM;IACJ,OAAO,CACL,EAAC,IAAI;MACH,aAAO,IAAI,EAAC,MAAM,EAAC,KAAK,EAAE,IAAI,CAAC,KAAK,EAClC,WAAW,EAAE,IAAI,CAAC,WAAW,EAC7B,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,GAAI,CAAC,CAAC,MAA2B,CAAC,KAAK,GAC/D;MACD,IAAI,CAAC,KAAK,KAAK,EAAE,CAAC,CAAC;QAClB,cAAQ,KAAK,EAAC,WAAW,EACvB,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,KAAK,GAAG,EAAE;UAE9B,WAAK,KAAK,EAAC,4BAA4B,EAAC,MAAM,EAAC,MAAM,EAAC,OAAO,EAAC,WAAW,EAAC,KAAK,EAAC,MAAM,EAAC,IAAI,EAAC,SAAS;YAAC,YAAM,CAAC,EAAC,eAAe,EAAC,IAAI,EAAC,MAAM,GAAE;YAAA,YAAM,CAAC,EAAC,iLAAiL,GAAE,CAAM,CACrU;QACX,CAAC;UACD,WAAK,KAAK,EAAC,4BAA4B,EAAC,MAAM,EAAC,MAAM,EAAC,OAAO,EAAC,WAAW,EAAC,KAAK,EAAC,MAAM,EAAC,IAAI,EAAC,SAAS;YAAC,YAAM,CAAC,EAAC,eAAe,EAAC,IAAI,EAAC,MAAM,GAAE;YAAA,YAAM,CAAC,EAAC,4OAA4O,GAAE,CAAM,CAElY,CACR,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAEF;AAzBC;EADC,QAAQ,CAAC,GAAG,CAAC;+DAGb","sourcesContent":["import { Component, Host, h, Event, EventEmitter, Watch, Prop } from '@stencil/core';\r\nimport { Debounce } from '../../utilities/debounce';\r\n@Component({\r\n tag: 'dnn-searchbox',\r\n styleUrl: 'dnn-searchbox.scss',\r\n shadow: true\r\n})\r\nexport class DnnSearchbox {\r\n\r\n /**\r\n * Sets the field placeholder text.\r\n */\r\n @Prop() placeholder?: string = \"\";\r\n\r\n /**\r\n * Debounces the queryChanged by 500ms.\r\n */\r\n @Prop() debounced: boolean = true;\r\n\r\n /** Sets the query */\r\n @Prop({mutable: true}) query: string = \"\";\r\n\r\n /**\r\n * Fires up each time the search query changes.\r\n * The data passed is the new query.\r\n */\r\n @Event() queryChanged: EventEmitter;\r\n\r\n @Watch('query')\r\n fireQueryChanged(){\r\n if (this.debounced){\r\n this.debouncedHandleQueryChanged();\r\n }\r\n else{\r\n this.handleQueryChanged();\r\n }\r\n }\r\n \r\n private handleQueryChanged(){\r\n this.queryChanged.emit(this.query);\r\n }\r\n\r\n @Debounce(500)\r\n private debouncedHandleQueryChanged(){\r\n this.handleQueryChanged();\r\n }\r\n \r\n\r\n render() {\r\n return (\r\n <Host>\r\n <input type=\"text\" value={this.query}\r\n placeholder={this.placeholder}\r\n onInput={e => this.query = (e.target as HTMLInputElement).value}\r\n />\r\n {this.query !== \"\" ?\r\n <button class=\"svg clear\"\r\n onClick={() => this.query = \"\"}\r\n >\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 0 24 24\" width=\"24px\" fill=\"#000000\"><path d=\"M0 0h24v24H0z\" fill=\"none\"/><path d=\"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z\"/></svg>\r\n </button>\r\n :\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 0 24 24\" width=\"24px\" fill=\"#000000\"><path d=\"M0 0h24v24H0z\" fill=\"none\"/><path d=\"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z\"/></svg>\r\n }\r\n </Host>\r\n );\r\n }\r\n\r\n}\r\n"]}
@@ -0,0 +1,32 @@
1
+ :host {
2
+ /**
3
+ * @prop --color: Normal Color of the inactive sort icon.
4
+ * @prop --color-sorted: Color of the sorted sort icon.
5
+ * @prop --color-hover: Color of the icons when hovered.
6
+ */
7
+ display: inline-block;
8
+ }
9
+
10
+ button {
11
+ outline: none;
12
+ border: none;
13
+ margin: 0;
14
+ padding: 0;
15
+ background-color: transparent;
16
+ outline: none;
17
+ display: inline-block;
18
+ line-height: 1em;
19
+ position: relative;
20
+ top: 0.25em;
21
+ }
22
+ button svg {
23
+ height: 1.5em;
24
+ width: auto;
25
+ fill: var(--color, #888);
26
+ }
27
+ button.active svg {
28
+ fill: var(--color-sorted, var(--dnn-color-primary, #028bff));
29
+ }
30
+ button:hover svg, button:focus svg {
31
+ fill: var(--color-hover, var(--dnn-color-primary-light, #36a1ff));
32
+ }
@@ -0,0 +1,81 @@
1
+ import { Component, Host, h, Prop, Event } from '@stencil/core';
2
+ export class DnnSortIcon {
3
+ constructor() {
4
+ /** Defines the current sort direction */
5
+ this.sortDirection = "none";
6
+ }
7
+ changeSort() {
8
+ switch (this.sortDirection) {
9
+ case "asc":
10
+ this.sortDirection = "desc";
11
+ break;
12
+ case "desc":
13
+ this.sortDirection = "asc";
14
+ break;
15
+ case "none":
16
+ this.sortDirection = "asc";
17
+ break;
18
+ default:
19
+ break;
20
+ }
21
+ this.sortChanged.emit(this.sortDirection);
22
+ }
23
+ render() {
24
+ return (h(Host, null,
25
+ h("button", { class: { "active": this.sortDirection != "none" }, onClick: () => this.changeSort() },
26
+ this.sortDirection == "none" &&
27
+ h("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 12 16" },
28
+ h("path", { d: "M 0 7 H 12 L 6 0 Z M 0 9 H 12 L 6 16 Z" })),
29
+ this.sortDirection == "asc" &&
30
+ h("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 12 16" },
31
+ h("path", { d: "M 0 7 H 12 L 6 0 Z" })),
32
+ this.sortDirection == "desc" &&
33
+ h("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 12 16" },
34
+ h("path", { d: "M 0 9 H 12 L 6 16 Z" })))));
35
+ }
36
+ static get is() { return "dnn-sort-icon"; }
37
+ static get encapsulation() { return "shadow"; }
38
+ static get originalStyleUrls() { return {
39
+ "$": ["dnn-sort-icon.scss"]
40
+ }; }
41
+ static get styleUrls() { return {
42
+ "$": ["dnn-sort-icon.css"]
43
+ }; }
44
+ static get properties() { return {
45
+ "sortDirection": {
46
+ "type": "string",
47
+ "mutable": false,
48
+ "complexType": {
49
+ "original": "\"asc\" | \"desc\" | \"none\"",
50
+ "resolved": "\"asc\" | \"desc\" | \"none\"",
51
+ "references": {}
52
+ },
53
+ "required": false,
54
+ "optional": false,
55
+ "docs": {
56
+ "tags": [],
57
+ "text": "Defines the current sort direction"
58
+ },
59
+ "attribute": "sort-direction",
60
+ "reflect": false,
61
+ "defaultValue": "\"none\""
62
+ }
63
+ }; }
64
+ static get events() { return [{
65
+ "method": "sortChanged",
66
+ "name": "sortChanged",
67
+ "bubbles": true,
68
+ "cancelable": true,
69
+ "composed": true,
70
+ "docs": {
71
+ "tags": [],
72
+ "text": "Emitted when the sort is changed."
73
+ },
74
+ "complexType": {
75
+ "original": "\"asc\"|\"desc\"|\"none\"",
76
+ "resolved": "\"asc\" | \"desc\" | \"none\"",
77
+ "references": {}
78
+ }
79
+ }]; }
80
+ }
81
+ //# sourceMappingURL=dnn-sort-icon.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dnn-sort-icon.js","sourceRoot":"","sources":["../../../src/components/dnn-sort-icon/dnn-sort-icon.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAgB,MAAM,eAAe,CAAC;AAO9E,MAAM,OAAO,WAAW;EALxB;IAME,yCAAyC;IACjC,kBAAa,GAA4B,MAAM,CAAC;GA2CzD;EAtCS,UAAU;IAChB,QAAQ,IAAI,CAAC,aAAa,EAAE;MAC1B,KAAK,KAAK;QACR,IAAI,CAAC,aAAa,GAAG,MAAM,CAAC;QAC5B,MAAM;MACR,KAAK,MAAM;QACT,IAAI,CAAC,aAAa,GAAG,KAAK,CAAC;QAC3B,MAAM;MACR,KAAK,MAAM;QACT,IAAI,CAAC,aAAa,GAAG,KAAK,CAAC;QAC3B,MAAM;MACR;QACE,MAAM;KACT;IAED,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;EAC5C,CAAC;EAED,MAAM;IACJ,OAAO,CACL,EAAC,IAAI;MACH,cACE,KAAK,EAAE,EAAC,QAAQ,EAAE,IAAI,CAAC,aAAa,IAAI,MAAM,EAAC,EAC/C,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,UAAU,EAAE;QAE/B,IAAI,CAAC,aAAa,IAAI,MAAM;UAC3B,WAAK,KAAK,EAAC,4BAA4B,EAAC,OAAO,EAAC,WAAW;YAAC,YAAM,CAAC,EAAC,wCAAwC,GAAQ,CAAM;QAE3H,IAAI,CAAC,aAAa,IAAI,KAAK;UAC1B,WAAK,KAAK,EAAC,4BAA4B,EAAC,OAAO,EAAC,WAAW;YAAC,YAAM,CAAC,EAAC,oBAAoB,GAAQ,CAAM;QAEvG,IAAI,CAAC,aAAa,IAAI,MAAM;UAC3B,WAAK,KAAK,EAAC,4BAA4B,EAAC,OAAO,EAAC,WAAW;YAAC,YAAM,CAAC,EAAC,qBAAqB,GAAQ,CAAM,CAElG,CACJ,CACR,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Host, h, Prop, Event, EventEmitter } from '@stencil/core';\r\n\r\n@Component({\r\n tag: 'dnn-sort-icon',\r\n styleUrl: 'dnn-sort-icon.scss',\r\n shadow: true\r\n})\r\nexport class DnnSortIcon {\r\n /** Defines the current sort direction */\r\n @Prop() sortDirection: \"asc\" | \"desc\" | \"none\" = \"none\";\r\n\r\n /** Emitted when the sort is changed. */\r\n @Event() sortChanged!: EventEmitter<\"asc\"|\"desc\"|\"none\">;\r\n \r\n private changeSort(): void {\r\n switch (this.sortDirection) {\r\n case \"asc\":\r\n this.sortDirection = \"desc\";\r\n break;\r\n case \"desc\":\r\n this.sortDirection = \"asc\";\r\n break;\r\n case \"none\":\r\n this.sortDirection = \"asc\";\r\n break;\r\n default:\r\n break;\r\n }\r\n\r\n this.sortChanged.emit(this.sortDirection);\r\n }\r\n\r\n render() {\r\n return (\r\n <Host>\r\n <button\r\n class={{\"active\": this.sortDirection != \"none\"}}\r\n onClick={() => this.changeSort()}\r\n >\r\n {this.sortDirection == \"none\" &&\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 12 16\"><path d=\"M 0 7 H 12 L 6 0 Z M 0 9 H 12 L 6 16 Z\"></path></svg>\r\n }\r\n {this.sortDirection == \"asc\" &&\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 12 16\"><path d=\"M 0 7 H 12 L 6 0 Z\"></path></svg>\r\n }\r\n {this.sortDirection == \"desc\" &&\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 12 16\"><path d=\"M 0 9 H 12 L 6 16 Z\"></path></svg>\r\n }\r\n </button>\r\n </Host>\r\n );\r\n }\r\n}\r\n"]}
File without changes
@@ -0,0 +1,84 @@
1
+ import { Component, Host, h, Prop, State, Method } from "@stencil/core";
2
+ /** Represents a single tab and must be used inside a dnn-tabs element. */
3
+ export class DnnTab {
4
+ constructor() {
5
+ this.visible = false;
6
+ }
7
+ /** Shows the tab. */
8
+ async show() {
9
+ this.visible = true;
10
+ }
11
+ /** Hides the modal */
12
+ async hide() {
13
+ this.visible = false;
14
+ }
15
+ render() {
16
+ return (h(Host, null, this.visible &&
17
+ h("slot", null)));
18
+ }
19
+ static get is() { return "dnn-tab"; }
20
+ static get encapsulation() { return "shadow"; }
21
+ static get originalStyleUrls() { return {
22
+ "$": ["dnn-tab.scss"]
23
+ }; }
24
+ static get styleUrls() { return {
25
+ "$": ["dnn-tab.css"]
26
+ }; }
27
+ static get properties() { return {
28
+ "tabTitle": {
29
+ "type": "string",
30
+ "mutable": false,
31
+ "complexType": {
32
+ "original": "string",
33
+ "resolved": "string",
34
+ "references": {}
35
+ },
36
+ "required": true,
37
+ "optional": false,
38
+ "docs": {
39
+ "tags": [],
40
+ "text": "Defines the tab title."
41
+ },
42
+ "attribute": "tab-title",
43
+ "reflect": false
44
+ }
45
+ }; }
46
+ static get states() { return {
47
+ "visible": {}
48
+ }; }
49
+ static get methods() { return {
50
+ "show": {
51
+ "complexType": {
52
+ "signature": "() => Promise<void>",
53
+ "parameters": [],
54
+ "references": {
55
+ "Promise": {
56
+ "location": "global"
57
+ }
58
+ },
59
+ "return": "Promise<void>"
60
+ },
61
+ "docs": {
62
+ "text": "Shows the tab.",
63
+ "tags": []
64
+ }
65
+ },
66
+ "hide": {
67
+ "complexType": {
68
+ "signature": "() => Promise<void>",
69
+ "parameters": [],
70
+ "references": {
71
+ "Promise": {
72
+ "location": "global"
73
+ }
74
+ },
75
+ "return": "Promise<void>"
76
+ },
77
+ "docs": {
78
+ "text": "Hides the modal",
79
+ "tags": []
80
+ }
81
+ }
82
+ }; }
83
+ }
84
+ //# sourceMappingURL=dnn-tab.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dnn-tab.js","sourceRoot":"","sources":["../../../src/components/dnn-tab/dnn-tab.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAExE,0EAA0E;AAM1E,MAAM,OAAO,MAAM;EALnB;IASa,YAAO,GAAY,KAAK,CAAC;GAuBrC;EArBG,qBAAqB;EAErB,KAAK,CAAC,IAAI;IACN,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;EACxB,CAAC;EAED,sBAAsB;EAEtB,KAAK,CAAC,IAAI;IACN,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;EACzB,CAAC;EAED,MAAM;IACF,OAAO,CACH,EAAC,IAAI,QACA,IAAI,CAAC,OAAO;MACT,eAAa,CAEd,CACV,CAAC;EACN,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACJ","sourcesContent":["import { Component, Host, h, Prop, State, Method } from \"@stencil/core\";\r\n\r\n/** Represents a single tab and must be used inside a dnn-tabs element. */\r\n@Component({\r\n tag: 'dnn-tab',\r\n styleUrl: 'dnn-tab.scss',\r\n shadow: true,\r\n})\r\nexport class DnnTab {\r\n /** Defines the tab title. */\r\n @Prop() tabTitle!: string;\r\n\r\n @State() visible: boolean = false;\r\n\r\n /** Shows the tab. */\r\n @Method()\r\n async show(){\r\n this.visible = true;\r\n }\r\n\r\n /** Hides the modal */\r\n @Method()\r\n async hide(){\r\n this.visible = false;\r\n }\r\n\r\n render() {\r\n return (\r\n <Host>\r\n {this.visible &&\r\n <slot></slot>\r\n }\r\n </Host>\r\n );\r\n }\r\n}"]}