@ember-lattice/editing 0.0.0-stage → 1.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.
- package/CHANGELOG.md +51 -0
- package/LICENSE.md +21 -0
- package/NOTICE +30 -0
- package/README.md +108 -2
- package/addon-main.cjs +4 -0
- package/declarations/cell-editor.d.ts +28 -0
- package/declarations/cell-editor.d.ts.map +1 -0
- package/declarations/controller.d.ts +121 -0
- package/declarations/controller.d.ts.map +1 -0
- package/declarations/index.d.ts +61 -0
- package/declarations/index.d.ts.map +1 -0
- package/declarations/machine.d.ts +34 -0
- package/declarations/machine.d.ts.map +1 -0
- package/declarations/rich-select.d.ts +57 -0
- package/declarations/rich-select.d.ts.map +1 -0
- package/declarations/row-editor.d.ts +18 -0
- package/declarations/row-editor.d.ts.map +1 -0
- package/declarations/series.d.ts +3 -0
- package/declarations/series.d.ts.map +1 -0
- package/declarations/summary.d.ts +15 -0
- package/declarations/summary.d.ts.map +1 -0
- package/declarations/tsv.d.ts +3 -0
- package/declarations/tsv.d.ts.map +1 -0
- package/declarations/typed-editor.d.ts +32 -0
- package/declarations/typed-editor.d.ts.map +1 -0
- package/declarations/undo.d.ts +15 -0
- package/declarations/undo.d.ts.map +1 -0
- package/dist/index.js +890 -0
- package/dist/index.js.map +1 -0
- package/package.json +92 -3
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { ControlComponent, ControlName } from '@ember-formwright/ember';
|
|
2
|
+
import type { GridColumn } from '@ember-lattice/ember';
|
|
3
|
+
/** The part of a column type that editing reads. */
|
|
4
|
+
export interface EditColumnType {
|
|
5
|
+
readonly name: string;
|
|
6
|
+
format(value: unknown, locale?: string): string;
|
|
7
|
+
/** Reads a value from text. Bad text gives `undefined`. */
|
|
8
|
+
parse?(text: string, locale?: string): unknown;
|
|
9
|
+
/** Text of the value that is the same in all locales: ISO text for a date. */
|
|
10
|
+
plain?(value: unknown): string;
|
|
11
|
+
/** All the values of a closed type (an enum), in order. */
|
|
12
|
+
values?(): readonly unknown[];
|
|
13
|
+
}
|
|
14
|
+
export declare const columnTypeOf: (column: GridColumn) => EditColumnType | undefined;
|
|
15
|
+
/** The editor of a column: `meta.lattice.editor`, else the editor of its type when editable. */
|
|
16
|
+
export declare function editorOf(column: GridColumn): ControlName | ControlComponent | undefined;
|
|
17
|
+
/**
|
|
18
|
+
* A text (a typed key, a paste) as a value: `meta.lattice.parse`, else the type parse. Text that
|
|
19
|
+
* the type does not read stays text, as with no parse, so the schema can report it.
|
|
20
|
+
*/
|
|
21
|
+
export declare function parserOf(column: GridColumn, locale?: string): ((text: string) => unknown) | undefined;
|
|
22
|
+
/**
|
|
23
|
+
* The value for the control: the plain text of a date (ISO text) or of a value object (money,
|
|
24
|
+
* decimal, percent). Other values, and text, go to the control as they are.
|
|
25
|
+
*/
|
|
26
|
+
export declare function toControl(column: GridColumn, value: unknown): unknown;
|
|
27
|
+
/**
|
|
28
|
+
* The value from the control. Text from a plain-text control reads through the type parse when
|
|
29
|
+
* the row value is not text: the data keeps its form. Text that does not read stays text.
|
|
30
|
+
*/
|
|
31
|
+
export declare function fromControl(column: GridColumn, rowValue: unknown, value: unknown): unknown;
|
|
32
|
+
//# sourceMappingURL=typed-editor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typed-editor.d.ts","sourceRoot":"","sources":["../src/typed-editor.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAC5E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AAEtD,oDAAoD;AACpD,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,MAAM,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IAC/C,2DAA2D;IAC3D,KAAK,CAAC,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;IAC9C,8EAA8E;IAC9E,KAAK,CAAC,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAAA;IAC9B,2DAA2D;IAC3D,MAAM,CAAC,IAAI,SAAS,OAAO,EAAE,CAAA;CAC9B;AA0BD,eAAO,MAAM,YAAY,GAAI,QAAQ,UAAU,KAAG,cAAc,GAAG,SAChC,CAAA;AAEnC,gGAAgG;AAChG,wBAAgB,QAAQ,CAAC,MAAM,EAAE,UAAU,GAAG,WAAW,GAAG,gBAAgB,GAAG,SAAS,CAKvF;AAED;;;GAGG;AACH,wBAAgB,QAAQ,CACtB,MAAM,EAAE,UAAU,EAClB,MAAM,CAAC,EAAE,MAAM,GACd,CAAC,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,GAAG,SAAS,CAKzC;AAED;;;GAGG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,OAAO,GAAG,OAAO,CAKrE;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,GAAG,OAAO,CAK1F"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare class UndoStack<Op> {
|
|
2
|
+
private done;
|
|
3
|
+
private undone;
|
|
4
|
+
get canUndo(): boolean;
|
|
5
|
+
get canRedo(): boolean;
|
|
6
|
+
/** A new op. It clears the redo list. */
|
|
7
|
+
push(op: Op): void;
|
|
8
|
+
/** Removes an op that did not apply (a failed save). */
|
|
9
|
+
remove(op: Op): void;
|
|
10
|
+
/** The op to undo: apply its inverse. */
|
|
11
|
+
undo(): Op | undefined;
|
|
12
|
+
/** The op to do again. */
|
|
13
|
+
redo(): Op | undefined;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=undo.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"undo.d.ts","sourceRoot":"","sources":["../src/undo.ts"],"names":[],"mappings":"AAGA,qBAAa,SAAS,CAAC,EAAE;IACvB,OAAO,CAAC,IAAI,CAAW;IACvB,OAAO,CAAC,MAAM,CAAW;IAEzB,IAAI,OAAO,YAEV;IAED,IAAI,OAAO,YAEV;IAED,yCAAyC;IACzC,IAAI,CAAC,EAAE,EAAE,EAAE;IAKX,wDAAwD;IACxD,MAAM,CAAC,EAAE,EAAE,EAAE;IAKb,yCAAyC;IACzC,IAAI,IAAI,EAAE,GAAG,SAAS;IAMtB,0BAA0B;IAC1B,IAAI,IAAI,EAAE,GAAG,SAAS;CAKvB"}
|