lexgui 0.7.15 → 8.1.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.
Files changed (134) hide show
  1. package/LICENSE +201 -21
  2. package/README.md +14 -5
  3. package/build/components/AlertDialog.d.ts +7 -0
  4. package/build/components/ArrayInput.d.ts +9 -0
  5. package/build/components/BaseComponent.d.ts +73 -0
  6. package/build/components/Button.d.ts +14 -0
  7. package/build/components/Calendar.d.ts +41 -0
  8. package/build/components/CalendarRange.d.ts +16 -0
  9. package/build/components/CanvasCurve.d.ts +10 -0
  10. package/build/components/CanvasDial.d.ts +11 -0
  11. package/build/components/CanvasMap2D.d.ts +61 -0
  12. package/build/components/Card.d.ts +8 -0
  13. package/build/components/Checkbox.d.ts +8 -0
  14. package/build/components/Color.d.ts +20 -0
  15. package/build/components/ColorInput.d.ts +13 -0
  16. package/build/components/ColorPicker.d.ts +29 -0
  17. package/build/components/ComboButtons.d.ts +8 -0
  18. package/build/components/ContextMenu.d.ts +16 -0
  19. package/build/components/Counter.d.ts +9 -0
  20. package/build/components/Curve.d.ts +10 -0
  21. package/build/components/DatePicker.d.ts +13 -0
  22. package/build/components/Dial.d.ts +10 -0
  23. package/build/components/Dialog.d.ts +20 -0
  24. package/build/components/DropdownMenu.d.ts +32 -0
  25. package/build/components/FileInput.d.ts +8 -0
  26. package/build/components/Footer.d.ts +14 -0
  27. package/build/components/Form.d.ts +8 -0
  28. package/build/components/Layers.d.ts +9 -0
  29. package/build/components/List.d.ts +9 -0
  30. package/build/components/Map2D.d.ts +12 -0
  31. package/build/components/Menubar.d.ts +59 -0
  32. package/build/components/NodeTree.d.ts +26 -0
  33. package/build/components/NumberInput.d.ts +9 -0
  34. package/build/components/OTPInput.d.ts +8 -0
  35. package/build/components/Pad.d.ts +8 -0
  36. package/build/components/Pagination.d.ts +26 -0
  37. package/build/components/PocketDialog.d.ts +11 -0
  38. package/build/components/Popover.d.ts +20 -0
  39. package/build/components/Progress.d.ts +8 -0
  40. package/build/components/RadioGroup.d.ts +8 -0
  41. package/build/components/RangeInput.d.ts +11 -0
  42. package/build/components/Rate.d.ts +8 -0
  43. package/build/components/Select.d.ts +10 -0
  44. package/build/components/Sheet.d.ts +10 -0
  45. package/build/components/Sidebar.d.ts +84 -0
  46. package/build/components/SizeInput.d.ts +8 -0
  47. package/build/components/Skeleton.d.ts +5 -0
  48. package/build/components/Spinner.d.ts +9 -0
  49. package/build/components/TabSections.d.ts +11 -0
  50. package/build/components/Table.d.ts +34 -0
  51. package/build/components/Tabs.d.ts +20 -0
  52. package/build/components/Tags.d.ts +9 -0
  53. package/build/components/TextArea.d.ts +8 -0
  54. package/build/components/TextInput.d.ts +11 -0
  55. package/build/components/Title.d.ts +8 -0
  56. package/build/components/Toggle.d.ts +8 -0
  57. package/build/components/Tour.d.ts +36 -0
  58. package/build/components/Vector.d.ts +9 -0
  59. package/build/core/Area.d.ts +143 -0
  60. package/build/core/Branch.d.ts +19 -0
  61. package/build/core/Core.d.ts +1 -0
  62. package/build/core/Event.d.ts +26 -0
  63. package/build/core/Icons.d.ts +4 -0
  64. package/build/core/Namespace.d.ts +2 -0
  65. package/build/core/Namespace.js +34 -0
  66. package/build/core/Namespace.js.map +1 -0
  67. package/build/core/Panel.d.ts +538 -0
  68. package/build/core/Utils.d.ts +1 -0
  69. package/build/core/Vec2.d.ts +21 -0
  70. package/build/extensions/AssetView.d.ts +136 -0
  71. package/build/extensions/AssetView.js +1367 -0
  72. package/build/extensions/AssetView.js.map +1 -0
  73. package/build/extensions/Audio.d.ts +9 -0
  74. package/build/extensions/Audio.js +163 -0
  75. package/build/extensions/Audio.js.map +1 -0
  76. package/build/extensions/CodeEditor.d.ts +350 -0
  77. package/build/extensions/CodeEditor.js +5022 -0
  78. package/build/extensions/CodeEditor.js.map +1 -0
  79. package/build/extensions/DocMaker.d.ts +27 -0
  80. package/build/extensions/DocMaker.js +327 -0
  81. package/build/extensions/DocMaker.js.map +1 -0
  82. package/build/extensions/GraphEditor.d.ts +276 -0
  83. package/build/extensions/GraphEditor.js +2770 -0
  84. package/build/extensions/GraphEditor.js.map +1 -0
  85. package/build/extensions/ImUi.d.ts +46 -0
  86. package/build/extensions/ImUi.js +227 -0
  87. package/build/extensions/ImUi.js.map +1 -0
  88. package/build/extensions/Timeline.d.ts +670 -0
  89. package/build/extensions/Timeline.js +3955 -0
  90. package/build/extensions/Timeline.js.map +1 -0
  91. package/build/extensions/VideoEditor.d.ts +128 -0
  92. package/build/extensions/VideoEditor.js +898 -0
  93. package/build/extensions/VideoEditor.js.map +1 -0
  94. package/build/extensions/index.d.ts +8 -0
  95. package/build/extensions/index.js +10 -0
  96. package/build/extensions/index.js.map +1 -0
  97. package/build/index.all.d.ts +2 -0
  98. package/build/index.css.d.ts +4 -0
  99. package/build/index.d.ts +56 -0
  100. package/build/lexgui.all.js +28498 -0
  101. package/build/lexgui.all.js.map +1 -0
  102. package/build/lexgui.all.min.js +1 -0
  103. package/build/lexgui.all.module.js +28422 -0
  104. package/build/lexgui.all.module.js.map +1 -0
  105. package/build/lexgui.all.module.min.js +1 -0
  106. package/build/lexgui.css +939 -346
  107. package/build/lexgui.js +13406 -17286
  108. package/build/lexgui.js.map +1 -0
  109. package/build/lexgui.min.css +3 -10
  110. package/build/lexgui.min.js +1 -1
  111. package/build/lexgui.module.js +12762 -16698
  112. package/build/lexgui.module.js.map +1 -0
  113. package/build/lexgui.module.min.js +1 -1
  114. package/changelog.md +170 -74
  115. package/demo.js +162 -48
  116. package/examples/all-components.html +45 -14
  117. package/examples/asset-view.html +110 -47
  118. package/examples/code-editor.html +5 -5
  119. package/examples/dialogs.html +3 -3
  120. package/examples/editor.html +27 -13
  121. package/examples/index.html +19 -14
  122. package/examples/node-graph.html +2 -2
  123. package/examples/previews/video-editor.png +0 -0
  124. package/examples/timeline.html +1 -1
  125. package/examples/video-editor.html +2 -2
  126. package/package.json +25 -9
  127. package/build/extensions/audio.js +0 -212
  128. package/build/extensions/codeeditor.js +0 -6319
  129. package/build/extensions/docmaker.js +0 -432
  130. package/build/extensions/imui.js +0 -325
  131. package/build/extensions/nodegraph.js +0 -3696
  132. package/build/extensions/timeline.js +0 -4636
  133. package/build/extensions/videoeditor.js +0 -953
  134. package/build/lexgui-docs.css +0 -352
@@ -0,0 +1,538 @@
1
+ import { Branch } from './Branch';
2
+ /**
3
+ * @class Panel
4
+ */
5
+ export declare class Panel {
6
+ root: any;
7
+ branches: Branch[];
8
+ components: Record<string, any>;
9
+ signals: any[];
10
+ queuedContainer: any;
11
+ _branchOpen: boolean;
12
+ _currentBranch: any;
13
+ _queue: any[];
14
+ _inlineComponentsLeft: number;
15
+ _inlineQueuedContainer: any;
16
+ _inlineExtraClass: string | null;
17
+ _inlineContainer: any;
18
+ _inlineComponents: any[];
19
+ /**
20
+ * @param {Object} options
21
+ * id: Id of the element
22
+ * className: Add class to the element
23
+ * width: Width of the panel element [fit space]
24
+ * height: Height of the panel element [fit space]
25
+ * style: CSS Style object to be applied to the panel
26
+ */
27
+ constructor(options?: any);
28
+ get(name: string): any;
29
+ getValue(name: string): any;
30
+ setValue(name: string, value: any, skipCallback?: boolean): any;
31
+ /**
32
+ * @method attach
33
+ * @param {Element} content child element to append to panel
34
+ */
35
+ attach(content: any): void;
36
+ /**
37
+ * @method clear
38
+ */
39
+ clear(): void;
40
+ /**
41
+ * @method sameLine
42
+ * @param {Number} numberOfComponents Of components that will be placed in the same line
43
+ * @param {String} className Extra class to customize inline components parent container
44
+ * @description Next N components will be in the same line. If no number, it will inline all until calling nextLine()
45
+ */
46
+ sameLine(numberOfComponents: number, className?: string): void;
47
+ /**
48
+ * @method endLine
49
+ * @param {String} className Extra class to customize inline components parent container
50
+ * @description Stop inlining components. Use it only if the number of components to be inlined is NOT specified.
51
+ */
52
+ endLine(className?: string | null): void;
53
+ /**
54
+ * @method branch
55
+ * @param {String} name Name of the branch/section
56
+ * @param {Object} options
57
+ * id: Id of the branch
58
+ * className: Add class to the branch
59
+ * closed: Set branch collapsed/opened [false]
60
+ * icon: Set branch icon (LX.ICONS)
61
+ * filter: Allow filter components in branch by name [false]
62
+ */
63
+ branch(name: string, options?: any): Branch;
64
+ merge(): void;
65
+ _pick(arg: any, def: any): any;
66
+ _attachComponent(component: any, options?: any): any;
67
+ _addFilter(placeholder: string, options?: any): any;
68
+ _searchComponents(branchName: string, value: string): void;
69
+ /**
70
+ * @method getBranch
71
+ * @param {String} name if null, return current branch
72
+ */
73
+ getBranch(name: string): any;
74
+ /**
75
+ * @method queue
76
+ * @param {HTMLElement} domEl container to append elements to
77
+ */
78
+ queue(domEl: any): void;
79
+ /**
80
+ * @method clearQueue
81
+ */
82
+ clearQueue(): void;
83
+ /**
84
+ * @method addSeparator
85
+ */
86
+ addSeparator(): void;
87
+ /**
88
+ * @method addTitle
89
+ * @param {String} name Title name
90
+ * @param {Object} options:
91
+ * link: Href in case title is an hyperlink
92
+ * target: Target name of the iframe (if any)
93
+ * icon: Name of the icon (if any)
94
+ * iconColor: Color of title icon (if any)
95
+ * style: CSS to override
96
+ */
97
+ addTitle(name: string, options?: any): any;
98
+ /**
99
+ * @method addText
100
+ * @param {String} name Component name
101
+ * @param {String} value Text value
102
+ * @param {Function} callback Callback function on change
103
+ * @param {Object} options:
104
+ * hideName: Don't use name as label [false]
105
+ * disabled: Make the component disabled [false]
106
+ * required: Make the input required
107
+ * placeholder: Add input placeholder
108
+ * icon: Icon (if any) to append at the input start
109
+ * pattern: Regular expression that value must match
110
+ * trigger: Choose onchange trigger (default, input) [default]
111
+ * inputWidth: Width of the text input
112
+ * fit: Input widts fits content [false]
113
+ * inputClass: Class to add to the native input element
114
+ * skipReset: Don't add the reset value button when value changes
115
+ * float: Justify input text content
116
+ * justifyName: Justify name content
117
+ */
118
+ addText(name: string | null, value: string, callback: any, options?: any): any;
119
+ /**
120
+ * @method addTextArea
121
+ * @param {String} name Component name
122
+ * @param {String} value Text Area value
123
+ * @param {Function} callback Callback function on change
124
+ * @param {Object} options:
125
+ * hideName: Don't use name as label [false]
126
+ * disabled: Make the component disabled [false]
127
+ * placeholder: Add input placeholder
128
+ * resize: Allow resize [true]
129
+ * trigger: Choose onchange trigger (default, input) [default]
130
+ * inputWidth: Width of the text input
131
+ * float: Justify input text content
132
+ * justifyName: Justify name content
133
+ * fitHeight: Height adapts to text
134
+ */
135
+ addTextArea(name: string | null, value: string, callback: any, options?: any): any;
136
+ /**
137
+ * @method addLabel
138
+ * @param {String} value Information string
139
+ * @param {Object} options Text options
140
+ */
141
+ addLabel(value: string, options?: any): any;
142
+ /**
143
+ * @method addButton
144
+ * @param {String} name Component name
145
+ * @param {String} value Button name
146
+ * @param {Function} callback Callback function on click
147
+ * @param {Object} options:
148
+ * hideName: Don't use name as label [false]
149
+ * disabled: Make the component disabled [false]
150
+ * icon: Icon class to show as button value
151
+ * iconPosition: Icon position (cover|start|end)
152
+ * fileInput: Button click requests a file
153
+ * fileInputType: Type of the requested file
154
+ * img: Path to image to show as button value
155
+ * title: Text to show in native Element title
156
+ * buttonClass: Class to add to the native button element
157
+ * mustConfirm: User must confirm trigger in a popover
158
+ */
159
+ addButton(name: string | null, value: string, callback: any, options?: any): any;
160
+ /**
161
+ * @method addComboButtons
162
+ * @param {String} name Component name
163
+ * @param {Array} values Each of the {value, callback, selected, disabled} items
164
+ * @param {Object} options:
165
+ * hideName: Don't use name as label [false]
166
+ * float: Justify content (left, center, right) [center]
167
+ * selected: Selected button by default (String|Array)
168
+ * noSelection: Buttons can be clicked, but they are not selectable
169
+ * toggle: Buttons can be toggled insted of selecting only one
170
+ */
171
+ addComboButtons(name: string, values: any[], options?: any): any;
172
+ /**
173
+ * @method addCard
174
+ * @param {String} name Card Name
175
+ * @param {Object} options:
176
+ * text: Card text
177
+ * link: Card link
178
+ * title: Card dom title
179
+ * src: url of the image
180
+ * callback (Function): function to call on click
181
+ */
182
+ addCard(name: string, options?: any): any;
183
+ /**
184
+ * @method addForm
185
+ * @param {String} name Component name
186
+ * @param {Object} data Form data
187
+ * @param {Function} callback Callback function on submit form
188
+ * @param {Object} options:
189
+ * primaryActionName: Text to be shown in the primary action button ['Submit']
190
+ * primaryButtonClass: Button class for primary action button ['contrast']
191
+ * secondaryActionName: Text to be shown in the secondary action button ['Cancel']
192
+ * secondaryActionCallback: Callback function on press secondary button
193
+ * secondaryButtonClass: Button class for secondary action button ['primary']
194
+ * skipLabels: Do not show input field labels [false]
195
+ */
196
+ addForm(name: string, data: any, callback: any, options?: any): any;
197
+ /**
198
+ * @method addContent
199
+ * @param {String} name Component name
200
+ * @param {HTMLElement/String} element
201
+ * @param {Object} options
202
+ */
203
+ addContent(name: string, element: any, options?: any): any;
204
+ /**
205
+ * @method addImage
206
+ * @param {String} name Component name
207
+ * @param {String} url Image Url
208
+ * @param {Object} options
209
+ * hideName: Don't use name as label [false]
210
+ */
211
+ addImage(name: string, url: string, options?: any): Promise<any>;
212
+ /**
213
+ * @method addSelect
214
+ * @param {String} name Component name
215
+ * @param {Array} values Posible options of the select component -> String (for default select) or Object = {value, url} (for images, gifs..)
216
+ * @param {String} value Select by default option
217
+ * @param {Function} callback Callback function on change
218
+ * @param {Object} options:
219
+ * hideName: Don't use name as label [false]
220
+ * filter: Add a search bar to the component [false]
221
+ * disabled: Make the component disabled [false]
222
+ * skipReset: Don't add the reset value button when value changes
223
+ * placeholder: Placeholder for the filter input
224
+ * emptyMsg: Custom message to show when no filtered results
225
+ */
226
+ addSelect(name: string | null, values: any[], value: string, callback: any, options?: any): any;
227
+ /**
228
+ * @method addCurve
229
+ * @param {String} name Component name
230
+ * @param {Array of Array} values Array of 2N Arrays of each value of the curve
231
+ * @param {Function} callback Callback function on change
232
+ * @param {Object} options:
233
+ * skipReset: Don't add the reset value button when value changes
234
+ * bgColor: Component background color
235
+ * pointsColor: Curve points color
236
+ * lineColor: Curve line color
237
+ * noOverlap: Points do not overlap, replacing themselves if necessary
238
+ * allowAddValues: Support adding values on click
239
+ * smooth: Curve smoothness
240
+ * moveOutAction: Clamp or delete points moved out of the curve (LX.CURVE_MOVEOUT_CLAMP, LX.CURVE_MOVEOUT_DELETE)
241
+ */
242
+ addCurve(name: string, values: any[], callback: any, options?: any): any;
243
+ /**
244
+ * @method addDial
245
+ * @param {String} name Component name
246
+ * @param {Array of Array} values Array of 2N Arrays of each value of the dial
247
+ * @param {Function} callback Callback function on change
248
+ * @param {Object} options:
249
+ * skipReset: Don't add the reset value button when value changes
250
+ * bgColor: Component background color
251
+ * pointsColor: Curve points color
252
+ * lineColor: Curve line color
253
+ * noOverlap: Points do not overlap, replacing themselves if necessary
254
+ * allowAddValues: Support adding values on click
255
+ * smooth: Curve smoothness
256
+ * moveOutAction: Clamp or delete points moved out of the curve (LX.CURVE_MOVEOUT_CLAMP, LX.CURVE_MOVEOUT_DELETE)
257
+ */
258
+ addDial(name: string, values: any[], callback: any, options?: any): any;
259
+ /**
260
+ * @method addLayers
261
+ * @param {String} name Component name
262
+ * @param {Number} value Flag value by default option
263
+ * @param {Function} callback Callback function on change
264
+ * @param {Object} options:
265
+ */
266
+ addLayers(name: string, value: number, callback: any, options?: any): any;
267
+ /**
268
+ * @method addArray
269
+ * @param {String} name Component name
270
+ * @param {Array} values By default values in the array
271
+ * @param {Function} callback Callback function on change
272
+ * @param {Object} options:
273
+ * innerValues (Array): Use select mode and use values as options
274
+ */
275
+ addArray(name: string, values: any[] | undefined, callback: any, options?: any): any;
276
+ /**
277
+ * @method addList
278
+ * @param {String} name Component name
279
+ * @param {Array} values List values
280
+ * @param {String} value Selected list value
281
+ * @param {Function} callback Callback function on change
282
+ * @param {Object} options:
283
+ * hideName: Don't use name as label [false]
284
+ */
285
+ addList(name: string, values: any[], value: any, callback: any, options?: any): any;
286
+ /**
287
+ * @method addTags
288
+ * @param {String} name Component name
289
+ * @param {String} value Comma separated tags
290
+ * @param {Function} callback Callback function on change
291
+ * @param {Object} options:
292
+ * hideName: Don't use name as label [false]
293
+ */
294
+ addTags(name: string, value: string, callback: any, options?: any): any;
295
+ /**
296
+ * @method addCheckbox
297
+ * @param {String} name Component name
298
+ * @param {Boolean} value Value of the checkbox
299
+ * @param {Function} callback Callback function on change
300
+ * @param {Object} options:
301
+ * disabled: Make the component disabled [false]
302
+ * label: Checkbox label
303
+ * suboptions: Callback to add components in case of TRUE value
304
+ * className: Extra classes to customize style
305
+ */
306
+ addCheckbox(name: string | null, value: boolean, callback: any, options?: any): any;
307
+ /**
308
+ * @method addToggle
309
+ * @param {String} name Component name
310
+ * @param {Boolean} value Value of the checkbox
311
+ * @param {Function} callback Callback function on change
312
+ * @param {Object} options:
313
+ * disabled: Make the component disabled [false]
314
+ * label: Toggle label
315
+ * suboptions: Callback to add components in case of TRUE value
316
+ * className: Customize colors
317
+ */
318
+ addToggle(name: string, value: boolean, callback: any, options?: any): any;
319
+ /**
320
+ * @method addRadioGroup
321
+ * @param {String} name Component name
322
+ * @param {String} label Radio label
323
+ * @param {Array} values Radio options
324
+ * @param {Function} callback Callback function on change
325
+ * @param {Object} options:
326
+ * disabled: Make the component disabled [false]
327
+ * className: Customize colors
328
+ * selected: Index of the default selected option
329
+ */
330
+ addRadioGroup(name: string, label: string, values: any[], callback: any, options?: any): any;
331
+ /**
332
+ * @method addColor
333
+ * @param {String} name Component name
334
+ * @param {String} value Default color (hex)
335
+ * @param {Function} callback Callback function on change
336
+ * @param {Object} options:
337
+ * disabled: Make the component disabled [false]
338
+ * useRGB: The callback returns color as Array (r, g, b) and not hex [false]
339
+ */
340
+ addColor(name: string, value: any, callback: any, options?: any): any;
341
+ /**
342
+ * @method addRange
343
+ * @param {String} name Component name
344
+ * @param {Number} value Default number value
345
+ * @param {Function} callback Callback function on change
346
+ * @param {Object} options:
347
+ * hideName: Don't use name as label [false]
348
+ * className: Extra classes to customize style
349
+ * disabled: Make the component disabled [false]
350
+ * left: The slider goes to the left instead of the right
351
+ * fill: Fill slider progress [true]
352
+ * step: Step of the input
353
+ * min, max: Min and Max values for the input
354
+ */
355
+ addRange(name: string, value: number, callback: any, options?: any): any;
356
+ /**
357
+ * @method addNumber
358
+ * @param {String} name Component name
359
+ * @param {Number} value Default number value
360
+ * @param {Function} callback Callback function on change
361
+ * @param {Object} options:
362
+ * hideName: Don't use name as label [false]
363
+ * disabled: Make the component disabled [false]
364
+ * step: Step of the input
365
+ * precision: The number of digits to appear after the decimal point
366
+ * min, max: Min and Max values for the input
367
+ * skipSlider: If there are min and max values, skip the slider
368
+ * units: Unit as string added to the end of the value
369
+ * onPress: Callback function on mouse down
370
+ * onRelease: Callback function on mouse up
371
+ */
372
+ addNumber(name: string | null, value: number, callback: any, options?: any): any;
373
+ static VECTOR_COMPONENTS: {
374
+ 0: string;
375
+ 1: string;
376
+ 2: string;
377
+ 3: string;
378
+ };
379
+ _addVector(numComponents: number, name: string, value: any[], callback: any, options?: any): any;
380
+ /**
381
+ * @method addVector N (2, 3, 4)
382
+ * @param {String} name Component name
383
+ * @param {Array} value Array of N components
384
+ * @param {Function} callback Callback function on change
385
+ * @param {Object} options:
386
+ * disabled: Make the component disabled [false]
387
+ * step: Step of the inputs
388
+ * min, max: Min and Max values for the inputs
389
+ * onPress: Callback function on mouse down
390
+ * onRelease: Callback function on mouse is released
391
+ */
392
+ addVector2(name: string, value: any[], callback: any, options: any): any;
393
+ addVector3(name: string, value: any[], callback: any, options: any): any;
394
+ addVector4(name: string, value: any[], callback: any, options: any): any;
395
+ /**
396
+ * @method addSize
397
+ * @param {String} name Component name
398
+ * @param {Number} value Default number value
399
+ * @param {Function} callback Callback function on change
400
+ * @param {Object} options:
401
+ * hideName: Don't use name as label [false]
402
+ * disabled: Make the component disabled [false]
403
+ * units: Unit as string added to the end of the value
404
+ */
405
+ addSize(name: string, value: any, callback: any, options?: any): any;
406
+ /**
407
+ * @method addOTP
408
+ * @param {String} name Component name
409
+ * @param {String} value Default numeric value in string format
410
+ * @param {Function} callback Callback function on change
411
+ * @param {Object} options:
412
+ * hideName: Don't use name as label [false]
413
+ * disabled: Make the component disabled [false]
414
+ * pattern: OTP numeric pattern
415
+ */
416
+ addOTP(name: string, value: string, callback: any, options?: any): any;
417
+ /**
418
+ * @method addPad
419
+ * @param {String} name Component name
420
+ * @param {Array} value Pad value
421
+ * @param {Function} callback Callback function on change
422
+ * @param {Object} options:
423
+ * disabled: Make the component disabled [false]
424
+ * min, max: Min and Max values
425
+ * padSize: Size of the pad (css)
426
+ * onPress: Callback function on mouse down
427
+ * onRelease: Callback function on mouse up
428
+ */
429
+ addPad(name: string, value: any[], callback: any, options?: any): any;
430
+ /**
431
+ * @method addProgress
432
+ * @param {String} name Component name
433
+ * @param {Number} value Progress value
434
+ * @param {Object} options:
435
+ * min, max: Min and Max values
436
+ * low, optimum, high: Low and High boundary values, Optimum point in the range
437
+ * showValue: Show current value
438
+ * editable: Allow edit value
439
+ * callback: Function called on change value
440
+ */
441
+ addProgress(name: string, value: number, options?: any): any;
442
+ /**
443
+ * @method addFile
444
+ * @param {String} name Component name
445
+ * @param {Function} callback Callback function on change
446
+ * @param {Object} options:
447
+ * local: Ask for local file
448
+ * disabled: Make the component disabled [false]
449
+ * read: Return the file itself (False) or the contents (True)
450
+ * type: type to read as [text (Default), buffer, bin, url]
451
+ */
452
+ addFile(name: string, callback: any, options?: any): any;
453
+ /**
454
+ * @method addTree
455
+ * @param {String} name Component name
456
+ * @param {Object} data Data of the tree
457
+ * @param {Object} options:
458
+ * icons: Array of objects with icon button information {name, icon, callback}
459
+ * filter: Add nodes filter [true]
460
+ * rename: Boolean to allow rename [true]
461
+ * onevent(tree_event): Called when node is selected, dbl clicked, contextmenu opened, changed visibility, parent or name
462
+ */
463
+ addTree(name: string, data: any, options?: any): any;
464
+ /**
465
+ * @method addTabSections
466
+ * @param {String} name Component name
467
+ * @param {Array} tabs Contains objects with {
468
+ * name: Name of the tab (if icon, use as title)
469
+ * icon: Icon to be used as the tab icon (optional)
470
+ * iconClass: Class to be added to the icon (optional)
471
+ * svgClass: Class to be added to the inner SVG of the icon (optional)
472
+ * onCreate: Func to be called at tab creation
473
+ * onSelect: Func to be called on select tab (optional)
474
+ * }
475
+ * @param {Object} options
476
+ * vertical: Use vertical or horizontal tabs (vertical by default)
477
+ * showNames: Show tab name only in horizontal tabs
478
+ */
479
+ addTabSections(name: string, tabs: any[], options?: any): any;
480
+ /**
481
+ * @method addCounter
482
+ * @param {String} name Component name
483
+ * @param {Number} value Counter value
484
+ * @param {Function} callback Callback function on change
485
+ * @param {Object} options:
486
+ * disabled: Make the component disabled [false]
487
+ * min, max: Min and Max values
488
+ * step: Step for adding/substracting
489
+ */
490
+ addCounter(name: string, value: number, callback: any, options?: any): any;
491
+ /**
492
+ * @method addTable
493
+ * @param {String} name Component name
494
+ * @param {Number} data Table data
495
+ * @param {Object} options:
496
+ * hideName: Don't use name as label [false]
497
+ * head: Table headers (each of the headers per column)
498
+ * body: Table body (data per row for each column)
499
+ * rowActions: Allow to add actions per row
500
+ * onMenuAction: Function callback to fill the "menu" context
501
+ * selectable: Each row can be selected
502
+ * sortable: Rows can be sorted by the user manually
503
+ * centered: Center text within columns. true for all, Array for center selected cols
504
+ * toggleColumns: Columns visibility can be toggled
505
+ * filter: Name of the column to filter by text input (if any)
506
+ * filterValue: Initial filter value
507
+ * customFilters: Add selectors to filter by specific option values
508
+ */
509
+ addTable(name: string, data: any, options?: any): any;
510
+ /**
511
+ * @method addDate
512
+ * @param {String} name Component name
513
+ * @param {String} dateValue
514
+ * @param {Function} callback
515
+ * @param {Object} options:
516
+ * hideName: Don't use name as label [false]
517
+ * today: Set current day as selected by default
518
+ * untilToday: Allow dates only until current day
519
+ * fromToday: Allow dates only from current day
520
+ */
521
+ addDate(name: string, dateValue: string, callback: any, options?: any): any;
522
+ /**
523
+ * @method addMap2D
524
+ * @param {String} name Component name
525
+ * @param {Array} points
526
+ * @param {Function} callback
527
+ * @param {Object} options:
528
+ */
529
+ addMap2D(name: string, points: any[], callback: any, options?: any): any;
530
+ /**
531
+ * @method addRate
532
+ * @param {String} name Component name
533
+ * @param {Number} value
534
+ * @param {Function} callback
535
+ * @param {Object} options:
536
+ */
537
+ addRate(name: string, value: number, callback: any, options?: any): any;
538
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,21 @@
1
+ export declare class vec2 {
2
+ x: number;
3
+ y: number;
4
+ constructor(x?: number, y?: number);
5
+ get xy(): number[];
6
+ get yx(): number[];
7
+ set(x: number, y: number): void;
8
+ add(v: vec2, v0?: vec2): vec2;
9
+ sub(v: vec2, v0?: vec2): vec2;
10
+ mul(v: number | vec2, v0?: vec2): vec2;
11
+ div(v: vec2, v0?: vec2): vec2;
12
+ abs(v0?: vec2): vec2;
13
+ dot(v: vec2): number;
14
+ len2(): number;
15
+ len(): number;
16
+ nrm(v0?: vec2): vec2;
17
+ dst(v: vec2): number;
18
+ clp(min: number, max: number, v0?: vec2): vec2;
19
+ fromArray(array: number[]): void;
20
+ toArray(): number[];
21
+ }
@@ -0,0 +1,136 @@
1
+ import { LX } from '../core/Namespace';
2
+ declare const Area: any;
3
+ declare const Panel: any;
4
+ declare const NodeTree: any;
5
+ export type AssetViewAction = 'select' | 'dbl_click' | 'check' | 'clone' | 'move' | 'delete' | 'rename' | 'enter_folder' | 'create-folder';
6
+ export interface AssetViewItem {
7
+ id: string;
8
+ type: string;
9
+ children: AssetViewItem[];
10
+ parent?: AssetViewItem;
11
+ path?: string;
12
+ src?: string;
13
+ dir?: AssetViewItem[];
14
+ domEl?: HTMLElement;
15
+ metadata: any;
16
+ }
17
+ interface AssetViewEvent {
18
+ type: AssetViewAction;
19
+ items?: AssetViewItem[];
20
+ result?: AssetViewItem[];
21
+ from?: AssetViewItem;
22
+ to?: AssetViewItem;
23
+ where?: AssetViewItem;
24
+ oldName?: string;
25
+ newName?: string;
26
+ userInitiated: boolean;
27
+ }
28
+ /**
29
+ * Signature for cancelable events.
30
+ * `resolve()` MUST be called by the user to perform the UI action
31
+ */
32
+ export type AssetViewEventCallback = (event: AssetViewEvent, resolve?: (...args: any[]) => void) => boolean | void | Promise<void>;
33
+ /**
34
+ * @class AssetView
35
+ * @description Asset container with Tree for file system
36
+ */
37
+ export declare class AssetView {
38
+ static LAYOUT_GRID: number;
39
+ static LAYOUT_COMPACT: number;
40
+ static LAYOUT_LIST: number;
41
+ static CONTENT_SORT_ASC: number;
42
+ static CONTENT_SORT_DESC: number;
43
+ root: HTMLElement;
44
+ area: typeof Area | null;
45
+ content: HTMLElement;
46
+ leftPanel: typeof Panel | null;
47
+ toolsPanel: any;
48
+ contentPanel: any;
49
+ previewPanel: any;
50
+ tree: typeof NodeTree | null;
51
+ prevData: AssetViewItem[];
52
+ nextData: AssetViewItem[];
53
+ data: AssetViewItem[];
54
+ currentData: AssetViewItem[];
55
+ currentFolder: AssetViewItem | undefined;
56
+ rootItem: AssetViewItem;
57
+ path: string[];
58
+ rootPath: string;
59
+ selectedItem: AssetViewItem | undefined;
60
+ allowedTypes: any;
61
+ searchValue: string;
62
+ filter: string;
63
+ gridScale: number;
64
+ layout: number;
65
+ sortMode: number;
66
+ skipBrowser: boolean;
67
+ skipPreview: boolean;
68
+ useNativeTitle: boolean;
69
+ onlyFolders: boolean;
70
+ allowMultipleSelection: boolean;
71
+ previewActions: any[];
72
+ contextMenu: any[];
73
+ onRefreshContent: any;
74
+ itemContextMenuOptions: any;
75
+ onItemDragged: any;
76
+ private _assetsPerPage;
77
+ get assetsPerPage(): any;
78
+ set assetsPerPage(v: any);
79
+ _callbacks: Record<string, AssetViewEventCallback>;
80
+ _lastSortBy: string;
81
+ _paginator: typeof LX.Pagination | undefined;
82
+ _scriptCodeDialog: typeof LX.Dialog | undefined;
83
+ _moveItemDialog: typeof LX.Dialog | undefined;
84
+ _movingItem: AssetViewItem | undefined;
85
+ constructor(options?: any);
86
+ /**
87
+ * @method on
88
+ * @description Stores an event callback for the desired action
89
+ */
90
+ on(eventName: string, callback: AssetViewEventCallback): void;
91
+ /**
92
+ * @method load
93
+ * @description Loads and processes the input data
94
+ */
95
+ load(data: any): void;
96
+ /**
97
+ * @method addItem
98
+ * @description Creates an item DOM element
99
+ */
100
+ addItem(item: AssetViewItem, childIndex: number | undefined, updateTree?: boolean): HTMLLIElement;
101
+ /**
102
+ * @method clear
103
+ * @description Creates all AssetView container panels
104
+ */
105
+ clear(): void;
106
+ _processData(data: any, parent?: AssetViewItem): void;
107
+ _updatePath(): void;
108
+ _createNavigationBar(panel: typeof Panel): void;
109
+ _createTreePanel(area: typeof Area): void;
110
+ _setContentLayout(layoutMode: number): void;
111
+ _createContentPanel(area: typeof Area): void;
112
+ _makeNameFilterFn(searchValue: string): (name: string) => boolean;
113
+ _refreshContent(searchValue?: string, filter?: string): void;
114
+ _previewAsset(file: AssetViewItem): void;
115
+ _processDrop(e: DragEvent): void;
116
+ _sortData(sortBy?: string, sortMode?: number): void;
117
+ _enterFolder(folderItem: AssetViewItem | undefined, storeCurrent?: boolean): void;
118
+ _removeItemFromParent(item: AssetViewItem): boolean;
119
+ _requestDeleteItem(item: AssetViewItem): void;
120
+ _deleteItem(item: AssetViewItem): void;
121
+ _requestMoveItemToFolder(item: AssetViewItem, folder: AssetViewItem): void;
122
+ _moveItemToFolder(item: AssetViewItem, folder: AssetViewItem): void;
123
+ _moveItem(item: AssetViewItem, defaultFolder?: AssetViewItem | AssetViewItem[]): void;
124
+ _requestCloneItem(item: AssetViewItem): false | undefined;
125
+ _cloneItem(item: AssetViewItem): AssetViewItem;
126
+ _getClonedName(originalName: string, siblings: any[]): string;
127
+ _requestRenameItem(item: AssetViewItem, newName: string): void;
128
+ _renameItem(item: AssetViewItem, newName: string): void;
129
+ _renameItemPopover(item: AssetViewItem): void;
130
+ _requestCreateFolder(folder?: AssetViewItem): void;
131
+ _createFolder(folder?: AssetViewItem): AssetViewItem;
132
+ _openScriptInEditor(script: any): void;
133
+ _setAssetsPerPage(n: number): void;
134
+ _lastModifiedToStringDate(lm: number): string;
135
+ }
136
+ export {};