pgo-ui 1.1.13 → 1.1.16
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.
- package/dist/Radio-C69Y0KPR.js +4 -0
- package/dist/index-DJX1IK1P.js +66771 -0
- package/dist/index.es.js +73 -66711
- package/dist/index.umd.js +75 -76
- package/dist/pgo-ui.css +1 -1
- package/package.json +1 -1
- package/src/components/pgo/AppBar.vue +1 -1
- package/src/components/pgo/DataTable.vue +15 -6
- package/src/components/pgo/forms/DynamicForm.vue +642 -442
- package/src/pgo-components/lib/componentConfig.js +100 -16
package/package.json
CHANGED
|
@@ -855,6 +855,16 @@ const initializeAllFunctions = () => {
|
|
|
855
855
|
|
|
856
856
|
if (props.settings?.functions) {
|
|
857
857
|
|
|
858
|
+
// Helper function to set a value on an item (DataTable equivalent of DynamicForm's setFieldValue)
|
|
859
|
+
const setFieldValue = (key, value) => {
|
|
860
|
+
// In DataTable context, this sets a value on tableVariables
|
|
861
|
+
tableVariables[key] = value
|
|
862
|
+
}
|
|
863
|
+
|
|
864
|
+
const getFieldValue = (key) => {
|
|
865
|
+
return tableVariables[key]
|
|
866
|
+
}
|
|
867
|
+
|
|
858
868
|
const functionContext = {
|
|
859
869
|
items: props.items,
|
|
860
870
|
headers: headers.value,
|
|
@@ -868,9 +878,8 @@ const initializeAllFunctions = () => {
|
|
|
868
878
|
console,
|
|
869
879
|
snackbar: snackbar,
|
|
870
880
|
api: api,
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
}
|
|
881
|
+
setFieldValue,
|
|
882
|
+
getFieldValue,
|
|
874
883
|
}
|
|
875
884
|
|
|
876
885
|
compiledFunctions.value = initializeFunctions(props.settings.functions, functionContext)
|
|
@@ -898,12 +907,12 @@ const executeFunction = (functionName, ...args) => {
|
|
|
898
907
|
const getCustomColumnData = (header, item) => {
|
|
899
908
|
|
|
900
909
|
if (header.columnData && (header.displayType === 'html' || header.displayType === 'custom')) {
|
|
901
|
-
// Extract function name from columnData (e.g., "customeColumnData(item)")
|
|
902
910
|
const functionMatch = header.columnData.match(/(\w+)\(/)
|
|
903
911
|
if (functionMatch) {
|
|
904
912
|
const functionName = functionMatch[1]
|
|
905
|
-
//
|
|
906
|
-
|
|
913
|
+
// Pass item as BOTH first arg (response) and second arg (item)
|
|
914
|
+
// so the function body can access it as 'item'
|
|
915
|
+
const result = executeFunction(functionName, item, item)
|
|
907
916
|
return result || ''
|
|
908
917
|
}
|
|
909
918
|
}
|