@knowark/componarkjs 1.13.3 → 1.13.4

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 (160) hide show
  1. package/lib/base/utils/helpers.test.js +2 -2
  2. package/lib/components/audio/components/audio.js +3 -2
  3. package/lib/components/camera/components/camera.js +3 -3
  4. package/lib/components/capture/components/capture.js +3 -3
  5. package/lib/components/droparea/components/droparea-preview.js +9 -8
  6. package/lib/components/droparea/components/droparea-preview.test.js +4 -2
  7. package/lib/components/droparea/components/droparea.js +6 -4
  8. package/lib/components/droparea/components/droparea.test.js +2 -1
  9. package/lib/components/emit/components/emit.js +1 -1
  10. package/lib/components/index.js +1 -1
  11. package/lib/components/list/components/{list.item.js → item.js} +1 -1
  12. package/lib/components/list/components/item.test.js +1 -1
  13. package/lib/components/list/components/list.js +2 -2
  14. package/lib/components/list/index.js +1 -1
  15. package/lib/components/paginator/components/paginator.js +3 -2
  16. package/lib/components/spinner/components/spinner.js +1 -1
  17. package/lib/components/splitview/components/splitview.detail.js +1 -1
  18. package/lib/components/splitview/components/splitview.detail.test.js +3 -1
  19. package/lib/components/splitview/components/splitview.js +4 -2
  20. package/lib/components/splitview/components/splitview.master.js +2 -1
  21. package/lib/components/splitview/components/splitview.master.test.js +1 -1
  22. package/lib/components/splitview/components/splitview.test.js +1 -1
  23. package/lib/components/translate/components/translate.js +4 -2
  24. package/package.json +6 -2
  25. package/showcase/components/index.html +1 -1
  26. package/{jsconfig.json → tsconfig.json} +6 -4
  27. package/types/base/component/component.d.ts +48 -0
  28. package/types/base/component/component.d.ts.map +1 -0
  29. package/types/base/component/component.test.d.ts +2 -0
  30. package/types/base/component/component.test.d.ts.map +1 -0
  31. package/types/base/component/index.d.ts +8 -0
  32. package/types/base/component/index.d.ts.map +1 -0
  33. package/types/base/index.d.ts +2 -0
  34. package/types/base/index.d.ts.map +1 -0
  35. package/types/base/styles/index.d.ts +3 -0
  36. package/types/base/styles/index.d.ts.map +1 -0
  37. package/types/base/styles/styles.d.ts +3 -0
  38. package/types/base/styles/styles.d.ts.map +1 -0
  39. package/types/base/utils/define.d.ts +5 -0
  40. package/types/base/utils/define.d.ts.map +1 -0
  41. package/types/base/utils/define.test.d.ts +2 -0
  42. package/types/base/utils/define.test.d.ts.map +1 -0
  43. package/types/base/utils/format.d.ts +13 -0
  44. package/types/base/utils/format.d.ts.map +1 -0
  45. package/types/base/utils/format.test.d.ts +2 -0
  46. package/types/base/utils/format.test.d.ts.map +1 -0
  47. package/types/base/utils/helpers.d.ts +11 -0
  48. package/types/base/utils/helpers.d.ts.map +1 -0
  49. package/types/base/utils/helpers.test.d.ts +2 -0
  50. package/types/base/utils/helpers.test.d.ts.map +1 -0
  51. package/types/base/utils/index.d.ts +6 -0
  52. package/types/base/utils/index.d.ts.map +1 -0
  53. package/types/base/utils/slots.d.ts +15 -0
  54. package/types/base/utils/slots.d.ts.map +1 -0
  55. package/types/base/utils/slots.test.d.ts +2 -0
  56. package/types/base/utils/slots.test.d.ts.map +1 -0
  57. package/types/base/utils/uuid.d.ts +3 -0
  58. package/types/base/utils/uuid.d.ts.map +1 -0
  59. package/types/base/utils/uuid.test.d.ts +2 -0
  60. package/types/base/utils/uuid.test.d.ts.map +1 -0
  61. package/types/components/audio/components/audio.d.ts +18 -0
  62. package/types/components/audio/components/audio.d.ts.map +1 -0
  63. package/types/components/audio/components/audio.test.d.ts +2 -0
  64. package/types/components/audio/components/audio.test.d.ts.map +1 -0
  65. package/types/components/audio/index.d.ts +2 -0
  66. package/types/components/audio/index.d.ts.map +1 -0
  67. package/types/components/audio/styles/ark.css.d.ts +3 -0
  68. package/types/components/audio/styles/ark.css.d.ts.map +1 -0
  69. package/types/components/audio/styles/index.d.ts +3 -0
  70. package/types/components/audio/styles/index.d.ts.map +1 -0
  71. package/types/components/camera/components/camera.d.ts +18 -0
  72. package/types/components/camera/components/camera.d.ts.map +1 -0
  73. package/types/components/camera/components/camera.test.d.ts +2 -0
  74. package/types/components/camera/components/camera.test.d.ts.map +1 -0
  75. package/types/components/camera/index.d.ts +2 -0
  76. package/types/components/camera/index.d.ts.map +1 -0
  77. package/types/components/camera/styles/ark.css.d.ts +3 -0
  78. package/types/components/camera/styles/ark.css.d.ts.map +1 -0
  79. package/types/components/camera/styles/index.d.ts +3 -0
  80. package/types/components/camera/styles/index.d.ts.map +1 -0
  81. package/types/components/capture/components/capture.d.ts +10 -0
  82. package/types/components/capture/components/capture.d.ts.map +1 -0
  83. package/types/components/capture/components/capture.test.d.ts +2 -0
  84. package/types/components/capture/components/capture.test.d.ts.map +1 -0
  85. package/types/components/capture/index.d.ts +2 -0
  86. package/types/components/capture/index.d.ts.map +1 -0
  87. package/types/components/droparea/components/droparea-preview.d.ts +21 -0
  88. package/types/components/droparea/components/droparea-preview.d.ts.map +1 -0
  89. package/types/components/droparea/components/droparea-preview.test.d.ts +2 -0
  90. package/types/components/droparea/components/droparea-preview.test.d.ts.map +1 -0
  91. package/types/components/droparea/components/droparea.d.ts +32 -0
  92. package/types/components/droparea/components/droparea.d.ts.map +1 -0
  93. package/types/components/droparea/components/droparea.test.d.ts +2 -0
  94. package/types/components/droparea/components/droparea.test.d.ts.map +1 -0
  95. package/types/components/droparea/index.d.ts +2 -0
  96. package/types/components/droparea/index.d.ts.map +1 -0
  97. package/types/components/droparea/styles/ark.css.d.ts +3 -0
  98. package/types/components/droparea/styles/ark.css.d.ts.map +1 -0
  99. package/types/components/droparea/styles/index.d.ts +3 -0
  100. package/types/components/droparea/styles/index.d.ts.map +1 -0
  101. package/types/components/emit/components/emit.d.ts +10 -0
  102. package/types/components/emit/components/emit.d.ts.map +1 -0
  103. package/types/components/emit/components/emit.test.d.ts +2 -0
  104. package/types/components/emit/components/emit.test.d.ts.map +1 -0
  105. package/types/components/emit/index.d.ts +2 -0
  106. package/types/components/emit/index.d.ts.map +1 -0
  107. package/types/components/index.d.ts +10 -0
  108. package/types/components/index.d.ts.map +1 -0
  109. package/types/components/list/components/item.d.ts +8 -0
  110. package/types/components/list/components/item.d.ts.map +1 -0
  111. package/types/components/list/components/item.test.d.ts +2 -0
  112. package/types/components/list/components/item.test.d.ts.map +1 -0
  113. package/types/components/list/components/list.d.ts +13 -0
  114. package/types/components/list/components/list.d.ts.map +1 -0
  115. package/types/components/list/components/list.test.d.ts +2 -0
  116. package/types/components/list/components/list.test.d.ts.map +1 -0
  117. package/types/components/list/index.d.ts +3 -0
  118. package/types/components/list/index.d.ts.map +1 -0
  119. package/types/components/paginator/components/paginator.d.ts +32 -0
  120. package/types/components/paginator/components/paginator.d.ts.map +1 -0
  121. package/types/components/paginator/components/paginator.test.d.ts +2 -0
  122. package/types/components/paginator/components/paginator.test.d.ts.map +1 -0
  123. package/types/components/paginator/index.d.ts +2 -0
  124. package/types/components/paginator/index.d.ts.map +1 -0
  125. package/types/components/paginator/styles/ark.css.d.ts +3 -0
  126. package/types/components/paginator/styles/ark.css.d.ts.map +1 -0
  127. package/types/components/paginator/styles/index.d.ts +3 -0
  128. package/types/components/paginator/styles/index.d.ts.map +1 -0
  129. package/types/components/spinner/components/spinner.d.ts +11 -0
  130. package/types/components/spinner/components/spinner.d.ts.map +1 -0
  131. package/types/components/spinner/components/spinner.test.d.ts +2 -0
  132. package/types/components/spinner/components/spinner.test.d.ts.map +1 -0
  133. package/types/components/spinner/index.d.ts +2 -0
  134. package/types/components/spinner/index.d.ts.map +1 -0
  135. package/types/components/spinner/styles/ark.css.d.ts +3 -0
  136. package/types/components/spinner/styles/ark.css.d.ts.map +1 -0
  137. package/types/components/spinner/styles/index.d.ts +3 -0
  138. package/types/components/spinner/styles/index.d.ts.map +1 -0
  139. package/types/components/splitview/components/splitview.d.ts +12 -0
  140. package/types/components/splitview/components/splitview.d.ts.map +1 -0
  141. package/types/components/splitview/components/splitview.detail.d.ts +10 -0
  142. package/types/components/splitview/components/splitview.detail.d.ts.map +1 -0
  143. package/types/components/splitview/components/splitview.detail.test.d.ts +2 -0
  144. package/types/components/splitview/components/splitview.detail.test.d.ts.map +1 -0
  145. package/types/components/splitview/components/splitview.master.d.ts +8 -0
  146. package/types/components/splitview/components/splitview.master.d.ts.map +1 -0
  147. package/types/components/splitview/components/splitview.master.test.d.ts +2 -0
  148. package/types/components/splitview/components/splitview.master.test.d.ts.map +1 -0
  149. package/types/components/splitview/components/splitview.test.d.ts +2 -0
  150. package/types/components/splitview/components/splitview.test.d.ts.map +1 -0
  151. package/types/components/splitview/index.d.ts +4 -0
  152. package/types/components/splitview/index.d.ts.map +1 -0
  153. package/types/components/translate/components/translate.d.ts +18 -0
  154. package/types/components/translate/components/translate.d.ts.map +1 -0
  155. package/types/components/translate/components/translate.test.d.ts +2 -0
  156. package/types/components/translate/components/translate.test.d.ts.map +1 -0
  157. package/types/components/translate/index.d.ts +2 -0
  158. package/types/components/translate/index.d.ts.map +1 -0
  159. package/types/index.d.ts +3 -0
  160. package/types/index.d.ts.map +1 -0
@@ -52,7 +52,7 @@ describe('Helpers', () => {
52
52
 
53
53
  it('can listen events', () => {
54
54
  const element = document.createElement('div')
55
- element.binding = 'listen'
55
+ Object.defineProperty(element, 'binding', {value: 'listen'})
56
56
  element.innerHTML = /* html */`
57
57
  <button listen on-click="myMethod"></button>
58
58
  `
@@ -69,7 +69,7 @@ describe('Helpers', () => {
69
69
 
70
70
  it('ignores missing methods when listening', () => {
71
71
  const element = document.createElement('div')
72
- element.binding = 'listen'
72
+ Object.defineProperty(element, 'binding', {value: 'listen'})
73
73
  element.innerHTML = /* html */`
74
74
  <button listen on-click="missing"></button>
75
75
  `
@@ -1,4 +1,4 @@
1
- import { Component } from '../../../base/component/index.js'
1
+ import { Component } from '#base/index.js'
2
2
  import styles from '../styles/index.js'
3
3
 
4
4
  const tag = 'ark-audio'
@@ -93,7 +93,8 @@ export class Audio extends Component {
93
93
 
94
94
  /** @param {any} event */
95
95
  _onData (event) {
96
- const audio = this.select('.ark-audio__audio')
96
+ const audio = /** @type {HTMLAudioElement} */ (
97
+ this.querySelector('.ark-audio__audio'))
97
98
  audio.src = this.global.URL.createObjectURL(event.data)
98
99
  const reader = new this.global.FileReader()
99
100
  reader.readAsDataURL(event.data)
@@ -1,4 +1,4 @@
1
- import { Component } from '../../../base/component/index.js'
1
+ import { Component } from '#base/index.js'
2
2
  import styles from '../styles/index.js'
3
3
 
4
4
  const tag = 'ark-camera'
@@ -34,8 +34,8 @@ export class Camera extends Component {
34
34
 
35
35
  /** @returns {string} */
36
36
  dataURL (width = null, height = null) {
37
- /** @type {HTMLCanvasElement} */
38
- const canvas = (this.canvas.cloneNode(true))
37
+ const canvas = /** @type {HTMLCanvasElement} */ (
38
+ this.canvas.cloneNode(true))
39
39
 
40
40
  canvas.width = width || this.width
41
41
  canvas.height = height || this.height
@@ -1,11 +1,11 @@
1
- import { Component } from '../../../base/component/index.js'
1
+ import { Component } from "#base/index.js"
2
2
 
3
3
  const tag = 'ark-capture'
4
4
  export class Capture extends Component {
5
5
  constructor () {
6
6
  super()
7
- const type = this.receive || 'emit'
8
- this.addEventListener(type, this.handle.bind(this))
7
+ this.receive = this.receive || 'emit'
8
+ this.addEventListener(this.receive, this.handle.bind(this))
9
9
  }
10
10
 
11
11
  reflectedProperties () {
@@ -1,6 +1,8 @@
1
- import { Component } from '../../../base/component/index.js'
1
+ import { Component } from '#base/index.js'
2
2
  import './droparea.js'
3
- // @ts-ignore
3
+
4
+ /** @import {Droparea} from './droparea.js' */
5
+
4
6
  const tag = 'ark-droparea-preview'
5
7
 
6
8
  export class DropareaPreview extends Component {
@@ -38,7 +40,7 @@ export class DropareaPreview extends Component {
38
40
  this.toggleVisibility()
39
41
 
40
42
  if (!this.droparea.hasAttribute('single')) {
41
- picture.setAttribute('index', this.fileIndex(file))
43
+ picture.setAttribute('index', String(this.fileIndex(file)))
42
44
  this.enableDragSort('drag-sort-enable')
43
45
  }
44
46
  }
@@ -109,14 +111,13 @@ export class DropareaPreview extends Component {
109
111
  const newList = []
110
112
  nodeList.forEach((item, index) => {
111
113
  newList.push(this.droparea.fileList[item.getAttribute('index')])
112
- item.setAttribute('index', index)
114
+ item.setAttribute('index', String(index))
113
115
  })
114
116
  this.droparea.fileList = newList
115
117
  }
116
118
 
117
119
  fileExists (file) {
118
- const present = this.files.some((item) => item.name === file.name)
119
- return present
120
+ return this.files.some((item) => item.name === file.name)
120
121
  }
121
122
 
122
123
  removeFile (file, event) {
@@ -125,7 +126,7 @@ export class DropareaPreview extends Component {
125
126
  this.droparea.fileList.splice(fileIndex, 1)
126
127
  element.parentNode.remove()
127
128
  this.selectAll('li').forEach((item, index) =>
128
- item.setAttribute('index', index)
129
+ item.setAttribute('index', String(index))
129
130
  )
130
131
  this.toggleVisibility()
131
132
  this.dispatchAlterEvent()
@@ -136,7 +137,7 @@ export class DropareaPreview extends Component {
136
137
  }
137
138
 
138
139
  get droparea () {
139
- return this.closest('.ark-droparea')
140
+ return /** @type {Droparea} */ (this.closest('.ark-droparea'))
140
141
  }
141
142
 
142
143
  get mediaList () {
@@ -10,8 +10,10 @@ describe('Droparea', () => {
10
10
  return event
11
11
  }
12
12
 
13
- global.URL.createObjectURL = jest.fn()
14
- global.document.elementFromPoint = jest.fn()
13
+ global.URL.createObjectURL = (
14
+ /** @type {(obj: Blob | MediaSource) => string} */ (jest.fn()))
15
+ global.document.elementFromPoint = (
16
+ /** @type {(x: number, y: number) => Element} */ (jest.fn()))
15
17
 
16
18
  let container = null
17
19
 
@@ -1,7 +1,9 @@
1
- import { Component } from '../../../base/component/index.js'
2
- import './droparea-preview.js'
1
+ import { Component } from '#base/index.js'
3
2
  import styles from '../styles/index.js'
4
- // @ts-ignore
3
+ import './droparea-preview.js'
4
+
5
+ /** @import {DropareaPreview} from './droparea-preview.js' */
6
+
5
7
  const tag = 'ark-droparea'
6
8
 
7
9
  export class Droparea extends Component {
@@ -169,7 +171,7 @@ export class Droparea extends Component {
169
171
  }
170
172
 
171
173
  get preview () {
172
- return this.select('ark-droparea-preview')
174
+ return /** @type {DropareaPreview} */ (this.select('ark-droparea-preview'))
173
175
  }
174
176
 
175
177
  get mediaList () {
@@ -10,7 +10,8 @@ describe('Droparea', () => {
10
10
  return event
11
11
  }
12
12
 
13
- global.URL.createObjectURL = jest.fn()
13
+ global.URL.createObjectURL = (
14
+ /** @type {(obj: Blob | MediaSource) => string} */ (jest.fn()))
14
15
 
15
16
  let container = null
16
17
 
@@ -1,4 +1,4 @@
1
- import { Component } from '../../../base/component/index.js'
1
+ import { Component } from "#base/index.js"
2
2
 
3
3
  const tag = 'ark-emit'
4
4
  export class Emit extends Component {
@@ -6,4 +6,4 @@ export * from './list/index.js'
6
6
  export * from './paginator/index.js'
7
7
  export * from './spinner/index.js'
8
8
  export * from './splitview/index.js'
9
- export * from './translate/index.js'
9
+ export * from './translate/index.js'
@@ -1,4 +1,4 @@
1
- import { Component } from '../../../base/component/index.js'
1
+ import { Component } from "#base/index.js"
2
2
 
3
3
  const tag = 'ark-list-item'
4
4
  export class ListItem extends Component {
@@ -1,5 +1,5 @@
1
1
  import './list.js'
2
- import { ListItem } from './list.item.js'
2
+ import { ListItem } from './item.js'
3
3
 
4
4
  describe('List item', () => {
5
5
  let container = null
@@ -1,5 +1,5 @@
1
- import { Component } from '../../../base/component/index.js'
2
- import { ListItem } from './list.item.js'
1
+ import { Component } from '#base/index.js'
2
+ import { ListItem } from './item.js'
3
3
 
4
4
  const tag = 'ark-list'
5
5
 
@@ -1,2 +1,2 @@
1
- export { ListItem } from './components/list.item.js'
1
+ export { ListItem } from './components/item.js'
2
2
  export { List } from './components/list.js'
@@ -1,4 +1,4 @@
1
- import { Component } from '../../../base/component/index.js'
1
+ import { Component } from '#base/index.js'
2
2
  import styles from '../styles/index.js'
3
3
 
4
4
  const tag = 'ark-paginator'
@@ -103,7 +103,8 @@ export class Paginator extends Component {
103
103
  /** @param {Event} event */
104
104
  _move (event) {
105
105
  event.stopPropagation()
106
- const page = parseInt(event.target.dataset.page)
106
+ const target = /** @type {HTMLElement} */ (event.target)
107
+ const page = parseInt(target.dataset.page)
107
108
  this._setCurrentPage(page)
108
109
  }
109
110
 
@@ -1,4 +1,4 @@
1
- import { Component } from '../../../base/component/index.js'
1
+ import { Component } from '#base/index.js'
2
2
  import styles from '../styles/index.js'
3
3
 
4
4
  const tag = 'ark-spinner'
@@ -1,4 +1,4 @@
1
- import { Component } from '../../../base/component/index.js'
1
+ import { Component } from "#base/index.js"
2
2
 
3
3
  const tag = 'ark-splitview-detail'
4
4
  export class SplitViewDetail extends Component {
@@ -1,6 +1,8 @@
1
- import { Component } from 'base/component'
1
+ import { Component } from '#base/index.js'
2
2
  import './splitview.detail.js'
3
3
 
4
+ /** @import {SplitViewDetail} from './splitview.detail.js' */
5
+
4
6
  class MockMain extends Component {
5
7
  init (context = {}) {
6
8
  this.name = this.name || context.name || null
@@ -1,4 +1,6 @@
1
- import { Component, css } from '../../../base/component/index.js'
1
+ import { Component, css } from "#base/index.js"
2
+
3
+ /** @import {SplitViewDetail} from './splitview.detail.js' */
2
4
 
3
5
  const tag = 'ark-splitview'
4
6
  export class SplitView extends Component {
@@ -19,7 +21,7 @@ export class SplitView extends Component {
19
21
  }
20
22
 
21
23
  get detail () {
22
- return this.select('ark-splitview-detail')
24
+ return /** @type {SplitViewDetail} */ (this.select('ark-splitview-detail'))
23
25
  }
24
26
 
25
27
  render () {
@@ -1,9 +1,10 @@
1
- import { Component } from '../../../base/component/index.js'
1
+ import { Component } from "#base/index.js"
2
2
 
3
3
  const tag = 'ark-splitview-master'
4
4
  export class SplitViewMaster extends Component {
5
5
  constructor () {
6
6
  super()
7
+ this.masterEvent = this.masterEvent
7
8
  this.addEventListener(
8
9
  this.masterEvent, this.onMasterEvent.bind(this))
9
10
  }
@@ -23,7 +23,7 @@ describe('SplitViewMaster', () => {
23
23
 
24
24
  expect(master).toBeTruthy()
25
25
  expect(master).toBe(master.init())
26
- expect(master.getAttribute('master-event')).toBeNull()
26
+ expect(master.getAttribute('master-event')).toEqual('')
27
27
  })
28
28
 
29
29
  it('can be instantiated with master-event attribute', () => {
@@ -1,4 +1,4 @@
1
- import { Component } from 'base/component'
1
+ import { Component } from '#base/index.js'
2
2
  import './splitview.js'
3
3
  import './splitview.detail'
4
4
  import './splitview.master.js'
@@ -1,15 +1,17 @@
1
- import { Component } from '../../../base/component/index.js'
1
+ import { Component } from "#base/index.js"
2
2
 
3
3
  const tag = 'ark-translate'
4
4
  export class Translate extends Component {
5
5
  init (context = {}) {
6
+ this.languages = this.languages
6
7
  this.global = context.global || window
7
8
  this.endpoint = context.endpoint || this.endpoint || '/locales'
8
9
  this.namespace = context.namespace || this.namespace || 'default'
9
10
  this.root = context.root || this.root || 'body'
10
11
  this.dictionary = context.dictionary || {}
11
12
 
12
- const dictionary = this.select('template')
13
+ const dictionary = (
14
+ /** @type {HTMLTemplateElement} */ (this.querySelector('template')))
13
15
  if (dictionary) {
14
16
  const content = dictionary.content.textContent
15
17
  this.dictionary = JSON.parse(content)
package/package.json CHANGED
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "name": "@knowark/componarkjs",
3
- "version": "1.13.3",
3
+ "version": "1.13.4",
4
4
  "author": "Knowark",
5
5
  "description": "Knowark's Web Components Library",
6
6
  "license": "ISC",
7
- "main": "lib/index.js",
8
7
  "type": "module",
8
+ "main": "lib/index.js",
9
+ "types": "types/index.d.ts",
9
10
  "scripts": {
10
11
  "test": "NODE_OPTIONS='--experimental-vm-modules --no-warnings' npx jest --coverage",
11
12
  "dev": "NODE_OPTIONS='--experimental-vm-modules --no-warnings' webpack serve --mode development --env development",
@@ -63,5 +64,8 @@
63
64
  "transformIgnorePatterns": [
64
65
  "node_modules/(?!@knowark)"
65
66
  ]
67
+ },
68
+ "imports": {
69
+ "#base/*": "./lib/base/*"
66
70
  }
67
71
  }
@@ -8,7 +8,7 @@
8
8
  <script type="importmap">
9
9
  {
10
10
  "imports": {
11
- "@knowark/componarkjs": "https://unpkg.com/@knowark/componarkjs@1.13.3/lib/index.js"
11
+ "@knowark/componarkjs": "https://unpkg.com/@knowark/componarkjs@1.13.4/lib/index.js"
12
12
  }
13
13
  }
14
14
  </script>
@@ -1,4 +1,5 @@
1
1
  {
2
+ "include": ["lib/**/*"],
2
3
  "compilerOptions": {
3
4
  "target": "esnext",
4
5
  "module": "nodenext",
@@ -6,13 +7,14 @@
6
7
  "allowJs": true,
7
8
  "checkJs": true,
8
9
  "baseUrl": "lib",
10
+ "declaration": true,
11
+ "emitDeclarationOnly": true,
12
+ "declarationMap": true,
13
+ "outDir": "types",
9
14
  "paths": {
10
- "@base*": [
15
+ "#base*": [
11
16
  "base",
12
17
  "base*"
13
- ],
14
- "*": [
15
- "*"
16
18
  ]
17
19
  }
18
20
  }
@@ -0,0 +1,48 @@
1
+ export class Component extends HTMLElement {
2
+ /**
3
+ * @param {string} tag
4
+ * @param {CustomElementConstructor} element
5
+ * @param {string} styles **/
6
+ static define(tag: string, element: CustomElementConstructor, styles?: string): void;
7
+ binding: string;
8
+ local: {};
9
+ /**
10
+ * @param {object} styleMap
11
+ * @return {string} **/
12
+ styleNames(styleMap: object): string;
13
+ /**
14
+ * @param {object} context
15
+ * @return {Component} */
16
+ init(context?: object): Component;
17
+ /** @return {string[]} */
18
+ reflectedProperties(): string[];
19
+ get slots(): {
20
+ [x: string]: HTMLElement[];
21
+ };
22
+ /** @param {string} content */
23
+ set content(content: string);
24
+ /** @return {string} */
25
+ get content(): string;
26
+ connectedCallback(): void;
27
+ /** @return {Component} */
28
+ render(): Component;
29
+ /** @param {object} context */
30
+ load(context?: object): Promise<void>;
31
+ /**
32
+ * @param {string} selectors
33
+ * @return {Component} */
34
+ select(selectors: string): Component;
35
+ /**
36
+ * @param {string} selectors
37
+ * @return {NodeListOf<Component>} */
38
+ selectAll(selectors: string): NodeListOf<Component>;
39
+ /**
40
+ * @param {string} type
41
+ * @param {any} detail */
42
+ emit(type: string, detail: any): void;
43
+ /**
44
+ * @param {string} resource
45
+ * @return {any} */
46
+ resolve(resource: string): any;
47
+ }
48
+ //# sourceMappingURL=component.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../../lib/base/component/component.js"],"names":[],"mappings":"AAIA;IAQE;;;iCAG6B;IAC7B,mBAHW,MAAM,WACN,wBAAwB,WACxB,MAAM,QAGhB;IAXC,gBAAuB;IACvB,UAAe;IAYjB;;2BAEuB;IACvB,qBAFW,MAAM,GACL,MAAM,CAGjB;IAED;;6BAEyB;IACzB,eAFW,MAAM,GACL,SAAS,CAGpB;IAED,yBAAyB;IACzB,uBADa,MAAM,EAAE,CAGpB;IAED;;MAEC;IAED,8BAA8B;IAC9B,6BAEC;IAED,uBAAuB;IACvB,sBAEC;IAED,0BASC;IAED,0BAA0B;IAC1B,UADa,SAAS,CAKrB;IAED,8BAA8B;IAC9B,eADY,MAAM,iBACU;IAE5B;;6BAEyB;IACzB,kBAFW,MAAM,GACL,SAAS,CAGpB;IAED;;yCAEqC;IACrC,qBAFW,MAAM,GACL,UAAU,CAAC,SAAS,CAAC,CAKhC;IAED;;6BAEyB;IACzB,WAFW,MAAM,UACN,GAAG,QASb;IAED;;uBAEmB;IACnB,kBAFW,MAAM,GACL,GAAG,CASd;CACF"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=component.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"component.test.d.ts","sourceRoot":"","sources":["../../../lib/base/component/component.test.js"],"names":[],"mappings":""}
@@ -0,0 +1,8 @@
1
+ export { Component } from "./component.js";
2
+ export const css: (template: {
3
+ raw: readonly string[] | ArrayLike<string>;
4
+ }, ...substitutions: any[]) => string;
5
+ export const html: (template: {
6
+ raw: readonly string[] | ArrayLike<string>;
7
+ }, ...substitutions: any[]) => string;
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/base/component/index.js"],"names":[],"mappings":";AACA;;sCAA6B;AAC7B;;sCAA8B"}
@@ -0,0 +1,2 @@
1
+ export { Component, css, html } from "./component/index.js";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/base/index.js"],"names":[],"mappings":""}
@@ -0,0 +1,3 @@
1
+ export default styles;
2
+ import styles from './styles.js';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/base/styles/index.js"],"names":[],"mappings":";mBAAmB,aAAa"}
@@ -0,0 +1,3 @@
1
+ declare const _default: string;
2
+ export default _default;
3
+ //# sourceMappingURL=styles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../lib/base/styles/styles.js"],"names":[],"mappings":""}
@@ -0,0 +1,5 @@
1
+ /** @param {string} tag
2
+ * @param {CustomElementConstructor} element
3
+ * @param {string} styles **/
4
+ export function define(tag: string, element: CustomElementConstructor, styles?: string): CSSStyleSheet[];
5
+ //# sourceMappingURL=define.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"define.d.ts","sourceRoot":"","sources":["../../../lib/base/utils/define.js"],"names":[],"mappings":"AAEA;;6BAE6B;AAC7B,4BAHY,MAAM,WACP,wBAAwB,WACxB,MAAM,mBAehB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=define.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"define.test.d.ts","sourceRoot":"","sources":["../../../lib/base/utils/define.test.js"],"names":[],"mappings":""}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Convert Strings from camelCase to kebab-case
3
+ * @param {string} input @returns {string} */
4
+ export function camelToKebab(input: string): string;
5
+ /**
6
+ * Convert Strings from kebab-case to camelCase
7
+ * @param {string} input @returns {string} */
8
+ export function kebabToCamel(input: string): string;
9
+ /**
10
+ * Convert Strings from snake to camelCase
11
+ * @param {string} input @returns {string} */
12
+ export function snakeToCamel(input: string): string;
13
+ //# sourceMappingURL=format.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../../lib/base/utils/format.js"],"names":[],"mappings":"AAAA;;6CAE6C;AAC7C,oCADW,MAAM,GAAkB,MAAM,CAGxC;AAED;;6CAE6C;AAC7C,oCADW,MAAM,GAAkB,MAAM,CAKxC;AAED;;6CAE6C;AAC7C,oCADW,MAAM,GAAkB,MAAM,CAKxC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=format.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"format.test.d.ts","sourceRoot":"","sources":["../../../lib/base/utils/format.test.js"],"names":[],"mappings":""}
@@ -0,0 +1,11 @@
1
+ /** @param {HTMLElement} self */
2
+ export function listen(self: HTMLElement): void;
3
+ /** @param {HTMLElement} self @param {string[]} properties */
4
+ export function reflect(self: HTMLElement, properties: string[]): void;
5
+ /** @param {object} object @param {string} path @param {any} value */
6
+ export function set(object: object, path: string, value: any): void;
7
+ /** @param {object} object @param {string} path @param {any} fallback */
8
+ export function get(object: object, path: string, fallback: any): any;
9
+ /** @param {object} object @return {string} */
10
+ export function keys(object: object): string;
11
+ //# sourceMappingURL=helpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../lib/base/utils/helpers.js"],"names":[],"mappings":"AAEA,gCAAgC;AAChC,6BADY,WAAW,QAyDtB;AAeD,6DAA6D;AAC7D,8BADY,WAAW,cAAe,MAAM,EAAE,QAiB7C;AAUD,qEAAqE;AACrE,4BADY,MAAM,QAAiB,MAAM,SAAe,GAAG,QAS1D;AAED,wEAAwE;AACxE,4BADY,MAAM,QAAiB,MAAM,YAAe,GAAG,OAM1D;AAED,8CAA8C;AAC9C,6BADY,MAAM,GAAkB,MAAM,CAIzC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=helpers.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helpers.test.d.ts","sourceRoot":"","sources":["../../../lib/base/utils/helpers.test.js"],"names":[],"mappings":""}
@@ -0,0 +1,6 @@
1
+ export * from "./define.js";
2
+ export * from "./format.js";
3
+ export * from "./helpers.js";
4
+ export * from "./slots.js";
5
+ export * from "./uuid.js";
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/base/utils/index.js"],"names":[],"mappings":""}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * @param {HTMLElement} container
3
+ * @return {Object<string, Array<HTMLElement>>}
4
+ * */
5
+ export function getSlots(container: HTMLElement): {
6
+ [x: string]: Array<HTMLElement>;
7
+ };
8
+ /**
9
+ * @param {HTMLElement} container
10
+ * @return {Object<string, Array<HTMLElement>>}
11
+ * */
12
+ export function slot(container: HTMLElement): {
13
+ [x: string]: Array<HTMLElement>;
14
+ };
15
+ //# sourceMappingURL=slots.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"slots.d.ts","sourceRoot":"","sources":["../../../lib/base/utils/slots.js"],"names":[],"mappings":"AAAA;;;KAGK;AACL,oCAHW,WAAW,GACV;QAAO,MAAM,GAAE,KAAK,CAAC,WAAW,CAAC;CAAC,CAa7C;AAfD;;;KAGK;AACL,gCAHW,WAAW,GACV;QAAO,MAAM,GAAE,KAAK,CAAC,WAAW,CAAC;CAAC,CAa7C"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=slots.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"slots.test.d.ts","sourceRoot":"","sources":["../../../lib/base/utils/slots.test.js"],"names":[],"mappings":""}
@@ -0,0 +1,3 @@
1
+ /** @returns {string} */
2
+ export function uuid(): string;
3
+ //# sourceMappingURL=uuid.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"uuid.d.ts","sourceRoot":"","sources":["../../../lib/base/utils/uuid.js"],"names":[],"mappings":"AAAA,wBAAwB;AACxB,wBADc,MAAM,CAQnB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=uuid.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"uuid.test.d.ts","sourceRoot":"","sources":["../../../lib/base/utils/uuid.test.js"],"names":[],"mappings":""}