mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) Custom Widget column mapping feature.
Summary: Exposing new API in CustomSectionAPI for column mapping. The custom widget can call configure method (or use a ready method) with additional parameter "columns". This parameter is a list of column names that should be mapped by the user. Mapping configuration is exposed through an additional method in the CustomSectionAPI "mappings". It is also available through the onRecord(s) event. This DIFF is connected with PR for grist-widgets repository https://github.com/gristlabs/grist-widget/pull/15 Design document and discussion: https://grist.quip.com/Y2waA8h8Zuzu/Custom-Widget-field-mapping Test Plan: browser tests Reviewers: paulfitz Reviewed By: paulfitz Differential Revision: https://phab.getgrist.com/D3241
This commit is contained in:
@@ -18,12 +18,12 @@ import {colors, vars} from 'app/client/ui2018/cssVars';
|
||||
import {cssDragger} from 'app/client/ui2018/draggableList';
|
||||
import {icon} from 'app/client/ui2018/icons';
|
||||
import {linkSelect, menu, menuItem, menuText, select} from 'app/client/ui2018/menus';
|
||||
import {nativeCompare} from 'app/common/gutil';
|
||||
import {nativeCompare, unwrap} from 'app/common/gutil';
|
||||
import {BaseFormatter} from 'app/common/ValueFormatter';
|
||||
import {decodeObject} from 'app/plugin/objtypes';
|
||||
import {Events as BackboneEvents} from 'backbone';
|
||||
import {Computed, dom, DomContents, DomElementArg, fromKo, Disposable as GrainJSDisposable,
|
||||
IDisposable, IOption, ISubscribable, makeTestId, Observable, styled, UseCB} from 'grainjs';
|
||||
IDisposable, IOption, makeTestId, Observable, styled, UseCB} from 'grainjs';
|
||||
import * as ko from 'knockout';
|
||||
import clamp = require('lodash/clamp');
|
||||
import debounce = require('lodash/debounce');
|
||||
@@ -1133,11 +1133,3 @@ const cssSpinners = styled('input', `
|
||||
opacity: 1;
|
||||
}
|
||||
`);
|
||||
|
||||
// Returns the value of both granjs and knockout observable without creating a dependency.
|
||||
const unwrap: UseCB = (obs: ISubscribable) => {
|
||||
if ('_getDepItem' in obs) {
|
||||
return obs.get();
|
||||
}
|
||||
return (obs as ko.Observable).peek();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user