Skip to content

Commit

Permalink
SVY-19830 Review and update all _doc.js files from documented plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
mvid-servoy committed Jan 23, 2025
1 parent 3c34be7 commit d9b3481
Show file tree
Hide file tree
Showing 10 changed files with 127 additions and 104 deletions.
9 changes: 5 additions & 4 deletions collapse/collapse.spec
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"getCard" : {
"returns" : "card",
"parameters": [
{ "name": "index", "type": "int" },
{ "name": "cardIndex", "type": "int" },
{ "name": "collapsibleIndex", "type": "int", "optional": true }
]
},
Expand All @@ -66,7 +66,7 @@
"getCollapsibleById": {
"returns" : "collapsible",
"parameters": [
{ "name": "collapsibleId", "type": "string" }
{ "name": "collapsibleId", "type": "string", "optional": true }
]
},
"removeCollapsibleById": {
Expand All @@ -78,7 +78,7 @@
"removeCollapsibleAt" : {
"returns" : "boolean",
"parameters": [
{ "name": "index", "type": "int" }
{ "name": "index", "type": "int", "optional": true }
]
},
"removeAllCollapsibles": {
Expand All @@ -87,7 +87,8 @@
"isCollapsed" : {
"parameters": [
{ "name": "index", "type": "int", "optional": true }
]
],
"returns": "boolean"
},
"setCollapsibles" : {
"parameters": [
Expand Down
56 changes: 28 additions & 28 deletions collapse/collapse_doc.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
/**
* Toggles the collapsible at the given index (or the first/only one, if no index is given)
*
* @param {Number} index the index of the collapsible to toggle
* @param {Number} [index] the index of the collapsible to toggle
*/
function toggle(index) {
}

/**
* Shows the collapsible at the given index (or the first/only one, if no index is given)
*
* @param {Number} index the index of the collapsible to show
* @param {Number} [index] The index of the collapsible to show
*/
function show(index) {}


/**
* Hides the collapsible at the given index (or the first/only one, if no index is given)
*
* @param {Number} index the index of the collapsible to hide
* @param {Number} [index] tTe index of the collapsible to hide
*/
function hide(index) {
}
Expand All @@ -26,46 +26,46 @@ function hide(index) {
/**
* Creates a new collapsible that can be added to the Collapse component using <code>addCollapsible</code> / <code>setCollapsibles</code>
*
* @param {String} [headerHtml]
* @param {String} [collapsibleId]
* @param {String} [headerHtml] The HTML content to be used as the header of the collapsible.
* @param {String} [collapsibleId] The unique identifier for the collapsible.
*
* @return {CustomType<svy-collapse.collapsible>}
* @return {CustomType<servoyextra-collapse.collapsible>} Returns a newly created collapsible object with the specified header and ID.
*/
function createCollapsible(headerHtml, collapsibleId) {
}

/**
* Creates a new card that can be added to any collapsible's cards array
*
* @param {String} [textOrHtml]
* @param {String} [cardId]
* @param {String} [styleClass]
* @return {CustomType<svy-collapse.card>}
* @param {String} [textOrHtml] The text or HTML content to be displayed inside the card.
* @param {String} [cardId] The unique identifier for the card. If not provided, an ID may be generated automatically.
* @param {String} [styleClass] A custom style class to apply to the card for styling purposes.
* @return {CustomType<servoyextra-collapse.card>} Returns a newly created card object with the specified content, ID, and style class.
*/
function createCard(textOrHtml, cardId, styleClass) {
}

/**
* Adds a new collapsible to the list of collapsibles of this Collapse component
*
* @param {CustomType<svy-collapse.collapsible>} collapsible
* @param {Number} [index] the index to insert the new collapsible at
* @param {CustomType<servoyextra-collapse.collapsible>} collapsible The collapsible object to be added to the Collapse component.
* @param {Number} [index] The 0-based index at which to insert the new collapsible. If not provided, the collapsible is added at the end.
*/
function addCollapsible(collapsible, index) {
}

/**
* Sets all collapsibles of this Collapse component
*
* @param {Array<CustomType<svy-collapse.collapsible>>} collapsibles
* @param {Array<CustomType<servoyextra-collapse.collapsible>>} collapsibles An array of collapsible objects to set as the complete list of collapsibles for the Collapse component.
*/
function setCollapsibles(collapsibles) {
}

/**
* Returns the card with the given ID
* @param {String} cardId
* @return {CustomType<svy-collapse.card>} the card or null when not found
* @param {String} cardId The unique identifier of the card to retrieve.
* @return {CustomType<servoyextra-collapse.card>} Returns the card object with the specified ID, or `null` if the card is not found.
*/
function getCardById(cardId) {
}
Expand All @@ -75,34 +75,34 @@ function getCardById(cardId) {
* @param {Number} cardIndex the index of the card to get (0 based)
* @param {Number} [collapsibleIndex] if not given, the first collapsible is used
*
* @return {CustomType<svy-collapse.card>} the card or null when not found
* @return {CustomType<servoyextra-collapse.card>} the card or null when not found
*/
function getCard(cardIndex, collapsibleIndex) {
}

/**
* Returns the collapsible with the given index (0 based)
* @param {Number} [collapsibleIndex] if not given, the first collapsible is used
* @param {Number} index if not given, the first collapsible is used
*
* @return {CustomType<svy-collapse.card>} the card or null when not found
* @return {CustomType<servoyextra-collapse.collapsible>} the collapsible or null when not found
*/
function getCollapsible(collapsibleIndex) {
function getCollapsible(index) {
}

/**
* Returns whether the collapsible at the given index (or the first one if no index is provided) is collapsed
* @param {Number} [collapsibleIndex]
*
* @return {Boolean}
* @param {Number} [index] The 0-based index of the collapsible to check. If omitted, the method checks the first collapsible.
* @return {Boolean} Returns `true` if the specified collapsible (or the first one by default) is collapsed, otherwise `false`.
*/
function isCollapsed(collapsibleIndex) {
function isCollapsed(index) {
}

/**
* Returns the collapsible with the given ID
* @param {String} [collapsibleId] if not given, the first collapsible is used
*
* @return {CustomType<svy-collapse.card>} the card or null when not found
* @return {CustomType<servoyextra-collapse.collapsible>} the card or null when not found
*/
function getCollapsibleById(collapsibleId) {
}
Expand All @@ -117,20 +117,20 @@ function removeCollapsibleById(collapsibleId) {
}

/**
* Remove the collapsible with the given index (the index is 0 based) or the first collapsible if no collapsibleIndex is given. If the collapsible was showing a form, it will hide that form as well.
* @param {Number} [collapsibleIndex] the index of the collapsible to remove; if not given, the first collapsible is used
* Remove the collapsible with the given index (the index is 0 based) or the first collapsible if no index is given. If the collapsible was showing a form, it will hide that form as well.
* @param {Number} [index] the index of the collapsible to remove; if not given, the first collapsible is used
*
* @return {Boolean} true if the collapsible at the give index (or 0 if not given) was removed; false if collapsibleIndex is out of bounds or if the form shown by this collapsible denied hide.
* @return {Boolean} true if the collapsible at the give index (or 0 if not given) was removed; false if index is out of bounds or if the form shown by this collapsible denied hide.
*/
function removeCollapsibleAt(collapsibleIndex) {
function removeCollapsibleAt(index) {
}

/**
* Removes all collapsibles. It will also hide the forms that are showing on any of the collpsibles.
*
* If one of the collapsibles has a form showing that denies hide, the removeAllCollapsibles operation will stop and return false. In this case, all collapsibles that had forms and were hidden so far will still be in the collapsible array but they will be 'collapsed'.
*
* @return {Boolean} true if all collapsibles were removed successfully; false if one of the collapsibles had a form which denied hide.
* @return {Boolean} `true` if all collapsibles were removed successfully; `false` if one of the collapsibles had a form which denied hide.
*/
function removeAllCollapsibles() {
}
3 changes: 2 additions & 1 deletion sidenav/sidenav.spec
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,8 @@
"parameters":
[
{ "name": "menuItemId", "type": "object" }
]
],
"deprecated": "use setSelectedMenuItem(id, false, false) instead"
},
"addMenuItem" :{
"parameters":[
Expand Down
Loading

0 comments on commit d9b3481

Please sign in to comment.