Skip to content

Commit

Permalink
chore: split listbox to new api
Browse files Browse the repository at this point in the history
  • Loading branch information
T-Wizard committed Apr 26, 2023
1 parent 9ab7b43 commit d26e374
Show file tree
Hide file tree
Showing 8 changed files with 217 additions and 216 deletions.
2 changes: 1 addition & 1 deletion apis/nucleus/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ function nuked(configuration = {}) {
* @param {boolean=} [options.checkboxes=false] Show values as checkboxes instead of as fields (not applicable for existing objects)
* @param {boolean=} [options.dense=false] Reduces padding and text size (not applicable for existing objects)
* @param {string=} [options.stateName="$"] Sets the state to make selections in (not applicable for existing objects)
* @param {ListboxProperties=} [options.properties={}] Properties object to extend default properties with
* @param {object=} [options.properties={}] Properties object to extend default properties with
* @returns {Promise<void>} A promise that resolves when the data is fetched.
*
* @since 1.1.0
Expand Down
24 changes: 24 additions & 0 deletions apis/stardust/api-spec/listbox-spec.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
module.exports = {
fromJsdoc: {
glob: ['../nucleus/src/components/listbox/default-properties.js'],
api: {
stability: 'experimental',
name: '@nebula.js/stardust:listbox',
description: 'nebula listbox properties definition',
},
output: {
sort: {
alpha: true,
},
file: './api-spec/listbox-spec.json',
},
parse: {
types: {
undefined: {},
'EngineAPI.IListObjectDef': {
url: 'https://qlik.dev/apis/json-rpc/qix/schemas#%23%2Fdefinitions%2Fschemas%2Fentries%2FListObjectDef',
},
},
},
},
};
185 changes: 185 additions & 0 deletions apis/stardust/api-spec/listbox-spec.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,185 @@
{
"scriptappy": "1.1.0",
"info": {
"name": "@nebula.js/stardust:listbox",
"description": "nebula listbox properties definition",
"version": "4.0.0-alpha.9",
"license": "MIT",
"stability": "experimental"
},
"entries": {},
"definitions": {
"ListboxProperties": {
"entries": {
"checkboxes": {
"description": "Show values as checkboxes instead of as fields.",
"optional": true,
"defaultValue": false,
"type": "boolean"
},
"frequencyMax": {
"description": "frequencyMax calculation\nneeded for histogram when not using qListObjectDef.qFrequencyMode: 'P'\nuse an expression in the form `Max(AGGR(Count([field]), [field]))` (when needed)\nor 'fetch' that triggers an extra engine call but needed for library dimension that could change field when using the object",
"optional": true,
"kind": "union",
"items": [
{
"kind": "literal",
"value": "'fetch'"
},
{
"type": "#/definitions/ValueExpression"
}
]
},
"histogram": {
"description": "Show histogram bar.\nalso requires (qListObjectDef.qFrequencyMode 'V' and frequencyMax) or qListObjectDef.qFrequencyMode 'P'",
"optional": true,
"defaultValue": false,
"type": "boolean"
},
"layoutOptions": {
"description": "Layout settings.",
"optional": true,
"entries": {
"dataLayout": {
"description": "Layout mode.",
"optional": true,
"defaultValue": "singleColumn",
"kind": "union",
"items": [
{
"kind": "literal",
"value": "'singleColumn'"
},
{
"kind": "literal",
"value": "'grid'"
}
]
},
"dense": {
"description": "Dense mode.",
"optional": true,
"defaultValue": false,
"type": "boolean"
},
"layoutOrder": {
"description": "Layout order.\nOnly used when dataLayout is 'grid'",
"optional": true,
"defaultValue": "row",
"kind": "union",
"items": [
{
"kind": "literal",
"value": "'row'"
},
{
"kind": "literal",
"value": "'column'"
}
]
},
"maxVisibleColumns": {
"description": "Max visible columns.\nOnly used when dataLayout is 'grid'\nand layoutOrder is 'row'",
"optional": true,
"entries": {
"auto": {
"description": "Automatically fit as many columns as possible.\nOnly used when dataLayout is 'grid'\nand layoutOrder is 'row'",
"optional": true,
"defaultValue": true,
"type": "boolean"
},
"maxColumns": {
"description": "Fixed number of max visible columns.\nOnly used when dataLayout is 'grid'\nlayoutOrder is 'row'\nand auto is false",
"optional": true,
"defaultValue": 3,
"type": "number"
}
},
"kind": "object"
},
"maxVisibleRows": {
"description": "Max visible rows.\nOnly used when dataLayout is 'grid'\nand layoutOrder is 'column'",
"optional": true,
"entries": {
"auto": {
"description": "Automatically fits as many rows as possible.\nOnly used when dataLayout is 'grid'\nand layoutOrder is 'column'",
"optional": true,
"defaultValue": true,
"type": "boolean"
},
"maxRows": {
"description": "Fixed number of max visible rows.\nOnly used when dataLayout is 'grid'\nlayoutOrder is 'column'\nand auto is false",
"optional": true,
"defaultValue": 3,
"type": "number"
}
},
"kind": "object"
}
},
"kind": "object"
},
"qListObjectDef": {
"type": "#/definitions/ListObjectDef"
},
"searchEnabled": {
"description": "Enables search.",
"optional": true,
"defaultValue": true,
"type": "boolean"
},
"showTitle": {
"description": "Show title.",
"optional": true,
"defaultValue": true,
"type": "boolean"
},
"title": {
"description": "Listbox title",
"optional": true,
"defaultValue": "",
"type": "string"
},
"wildCardSearch": {
"description": "Pre-fill search input field with wildcard characters.",
"optional": true,
"defaultValue": false,
"type": "boolean"
}
},
"kind": "object"
},
"ListObjectDef": {
"description": "Extends `ListObjectDef`, see Engine API: `ListObjectDef`.",
"extends": [
{
"type": "EngineAPI.IListObjectDef"
}
],
"kind": "interface",
"entries": {
"frequencyEnabled": {
"description": "Show frequency count. also requires qListObjectDef.qFrequencyMode to be set",
"optional": true,
"defaultValue": false,
"type": "boolean"
}
}
},
"ValueExpression": {
"description": "see: https://qlik.dev/apis/json-rpc/qix/schemas#%23%2Fdefinitions%2Fschemas%2Fentries%2FValueExpression",
"kind": "object",
"entries": {
"qValueExpression": {
"kind": "object",
"entries": {
"qExpr": {
"type": "string"
}
}
}
}
}
}
}
4 changes: 1 addition & 3 deletions apis/stardust/api-spec/spec.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ module.exports = {
'../theme/src/**/*.js',
'../conversion/src/**/*.js',
'../enigma-mocker/src/**/*.js',
'!../nucleus/src/components/listbox/default-properties.js',
],
api: {
stability: 'stable',
Expand Down Expand Up @@ -40,9 +41,6 @@ module.exports = {
'EngineAPI.INxMeasure': {
url: 'https://qlik.dev/apis/json-rpc/qix/schemas#%23%2Fdefinitions%2Fschemas%2Fentries%2FNxMeasure',
},
'EngineAPI.IListObjectDef': {
url: 'https://qlik.dev/apis/json-rpc/qix/schemas#%23%2Fdefinitions%2Fschemas%2Fentries%2FListObjectDef',
},
Emitter: {
url: 'https://nodejs.org/api/events.html#class-eventemitter',
},
Expand Down
Loading

0 comments on commit d26e374

Please sign in to comment.