@fieldia/designer 0.19.1 → 0.21.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/package.json +4 -4
- package/src/lib/canvas-head.d.mts +22 -0
- package/src/lib/canvas-head.d.ts +22 -0
- package/src/lib/canvas-head.js +121 -0
- package/src/lib/canvas-head.js.map +1 -0
- package/src/lib/canvas-head.mjs +118 -0
- package/src/lib/canvas-head.mjs.map +1 -0
- package/src/lib/canvas-header.js +7 -1
- package/src/lib/canvas-header.js.map +1 -1
- package/src/lib/canvas-header.mjs +7 -1
- package/src/lib/canvas-header.mjs.map +1 -1
- package/src/lib/choice-commands.d.mts +2 -1
- package/src/lib/choice-commands.d.ts +2 -1
- package/src/lib/choice-commands.js +3 -0
- package/src/lib/choice-commands.js.map +1 -1
- package/src/lib/choice-commands.mjs +3 -0
- package/src/lib/choice-commands.mjs.map +1 -1
- package/src/lib/chrome.js +11 -0
- package/src/lib/chrome.js.map +1 -1
- package/src/lib/chrome.mjs +11 -0
- package/src/lib/chrome.mjs.map +1 -1
- package/src/lib/date-setting.d.mts +49 -0
- package/src/lib/date-setting.d.ts +49 -0
- package/src/lib/date-setting.js +125 -0
- package/src/lib/date-setting.js.map +1 -0
- package/src/lib/date-setting.mjs +122 -0
- package/src/lib/date-setting.mjs.map +1 -0
- package/src/lib/designer.d.mts +16 -4
- package/src/lib/designer.d.ts +16 -4
- package/src/lib/designer.js +25 -2
- package/src/lib/designer.js.map +1 -1
- package/src/lib/designer.mjs +25 -2
- package/src/lib/designer.mjs.map +1 -1
- package/src/lib/group-fold.js +2 -0
- package/src/lib/group-fold.js.map +1 -1
- package/src/lib/group-fold.mjs +2 -0
- package/src/lib/group-fold.mjs.map +1 -1
- package/src/lib/head-commands.d.mts +116 -0
- package/src/lib/head-commands.d.ts +116 -0
- package/src/lib/head-commands.js +504 -0
- package/src/lib/head-commands.js.map +1 -0
- package/src/lib/head-commands.mjs +497 -0
- package/src/lib/head-commands.mjs.map +1 -0
- package/src/lib/head-parts.d.mts +15 -0
- package/src/lib/head-parts.d.ts +15 -0
- package/src/lib/head-parts.js +69 -0
- package/src/lib/head-parts.js.map +1 -0
- package/src/lib/head-parts.mjs +64 -0
- package/src/lib/head-parts.mjs.map +1 -0
- package/src/lib/head-properties.d.mts +25 -0
- package/src/lib/head-properties.d.ts +25 -0
- package/src/lib/head-properties.js +383 -0
- package/src/lib/head-properties.js.map +1 -0
- package/src/lib/head-properties.mjs +376 -0
- package/src/lib/head-properties.mjs.map +1 -0
- package/src/lib/header-commands.js +7 -0
- package/src/lib/header-commands.js.map +1 -1
- package/src/lib/header-commands.mjs +7 -0
- package/src/lib/header-commands.mjs.map +1 -1
- package/src/lib/header-properties.js +5 -1
- package/src/lib/header-properties.js.map +1 -1
- package/src/lib/header-properties.mjs +5 -1
- package/src/lib/header-properties.mjs.map +1 -1
- package/src/lib/inline-settings.js +19 -11
- package/src/lib/inline-settings.js.map +1 -1
- package/src/lib/inline-settings.mjs +19 -11
- package/src/lib/inline-settings.mjs.map +1 -1
- package/src/lib/input-commands.js +3 -2
- package/src/lib/input-commands.js.map +1 -1
- package/src/lib/input-commands.mjs +3 -2
- package/src/lib/input-commands.mjs.map +1 -1
- package/src/lib/kind-settings-choices.js +16 -7
- package/src/lib/kind-settings-choices.js.map +1 -1
- package/src/lib/kind-settings-choices.mjs +16 -7
- package/src/lib/kind-settings-choices.mjs.map +1 -1
- package/src/lib/kind-settings-inputs.js +116 -58
- package/src/lib/kind-settings-inputs.js.map +1 -1
- package/src/lib/kind-settings-inputs.mjs +116 -58
- package/src/lib/kind-settings-inputs.mjs.map +1 -1
- package/src/lib/kind-settings-picker.d.mts +4 -0
- package/src/lib/kind-settings-picker.d.ts +4 -0
- package/src/lib/kind-settings-picker.js +115 -0
- package/src/lib/kind-settings-picker.js.map +1 -0
- package/src/lib/kind-settings-picker.mjs +112 -0
- package/src/lib/kind-settings-picker.mjs.map +1 -0
- package/src/lib/kind-settings-structures.js +35 -16
- package/src/lib/kind-settings-structures.js.map +1 -1
- package/src/lib/kind-settings-structures.mjs +36 -17
- package/src/lib/kind-settings-structures.mjs.map +1 -1
- package/src/lib/kind-settings.js +47 -43
- package/src/lib/kind-settings.js.map +1 -1
- package/src/lib/kind-settings.mjs +47 -43
- package/src/lib/kind-settings.mjs.map +1 -1
- package/src/lib/layout-settings.d.mts +7 -0
- package/src/lib/layout-settings.d.ts +7 -0
- package/src/lib/layout-settings.js +15 -2
- package/src/lib/layout-settings.js.map +1 -1
- package/src/lib/layout-settings.mjs +15 -2
- package/src/lib/layout-settings.mjs.map +1 -1
- package/src/lib/list-canvas.js +18 -7
- package/src/lib/list-canvas.js.map +1 -1
- package/src/lib/list-canvas.mjs +18 -7
- package/src/lib/list-canvas.mjs.map +1 -1
- package/src/lib/list-commands.d.mts +24 -1
- package/src/lib/list-commands.d.ts +24 -1
- package/src/lib/list-commands.js +105 -2
- package/src/lib/list-commands.js.map +1 -1
- package/src/lib/list-commands.mjs +102 -1
- package/src/lib/list-commands.mjs.map +1 -1
- package/src/lib/list-properties.js +248 -28
- package/src/lib/list-properties.js.map +1 -1
- package/src/lib/list-properties.mjs +248 -28
- package/src/lib/list-properties.mjs.map +1 -1
- package/src/lib/locales/ar/head.d.mts +2 -0
- package/src/lib/locales/ar/head.d.ts +2 -0
- package/src/lib/locales/ar/head.js +97 -0
- package/src/lib/locales/ar/head.js.map +1 -0
- package/src/lib/locales/ar/head.mjs +94 -0
- package/src/lib/locales/ar/head.mjs.map +1 -0
- package/src/lib/locales/ar/index.js +4 -1
- package/src/lib/locales/ar/index.js.map +1 -1
- package/src/lib/locales/ar/index.mjs +4 -1
- package/src/lib/locales/ar/index.mjs.map +1 -1
- package/src/lib/locales/ar/inputs.d.mts +2 -0
- package/src/lib/locales/ar/inputs.d.ts +2 -0
- package/src/lib/locales/ar/inputs.js +20 -0
- package/src/lib/locales/ar/inputs.js.map +1 -0
- package/src/lib/locales/ar/inputs.mjs +17 -0
- package/src/lib/locales/ar/inputs.mjs.map +1 -0
- package/src/lib/locales/ar/list.js +31 -0
- package/src/lib/locales/ar/list.js.map +1 -1
- package/src/lib/locales/ar/list.mjs +31 -0
- package/src/lib/locales/ar/list.mjs.map +1 -1
- package/src/lib/locales/ar/panel.js +38 -0
- package/src/lib/locales/ar/panel.js.map +1 -1
- package/src/lib/locales/ar/panel.mjs +38 -0
- package/src/lib/locales/ar/panel.mjs.map +1 -1
- package/src/lib/locales/ar/questions.js +8 -0
- package/src/lib/locales/ar/questions.js.map +1 -1
- package/src/lib/locales/ar/questions.mjs +8 -0
- package/src/lib/locales/ar/questions.mjs.map +1 -1
- package/src/lib/locales/ar/refusals.js +11 -0
- package/src/lib/locales/ar/refusals.js.map +1 -1
- package/src/lib/locales/ar/refusals.mjs +11 -0
- package/src/lib/locales/ar/refusals.mjs.map +1 -1
- package/src/lib/locales/ar/work-text.d.mts +3 -0
- package/src/lib/locales/ar/work-text.d.ts +3 -0
- package/src/lib/locales/ar/work-text.js +58 -0
- package/src/lib/locales/ar/work-text.js.map +1 -0
- package/src/lib/locales/ar/work-text.mjs +55 -0
- package/src/lib/locales/ar/work-text.mjs.map +1 -0
- package/src/lib/locales/en/head.d.mts +101 -0
- package/src/lib/locales/en/head.d.ts +101 -0
- package/src/lib/locales/en/head.js +106 -0
- package/src/lib/locales/en/head.js.map +1 -0
- package/src/lib/locales/en/head.mjs +103 -0
- package/src/lib/locales/en/head.mjs.map +1 -0
- package/src/lib/locales/en/index.d.mts +237 -0
- package/src/lib/locales/en/index.d.ts +237 -0
- package/src/lib/locales/en/index.js +4 -1
- package/src/lib/locales/en/index.js.map +1 -1
- package/src/lib/locales/en/index.mjs +4 -1
- package/src/lib/locales/en/index.mjs.map +1 -1
- package/src/lib/locales/en/inputs.d.mts +26 -0
- package/src/lib/locales/en/inputs.d.ts +26 -0
- package/src/lib/locales/en/inputs.js +30 -0
- package/src/lib/locales/en/inputs.js.map +1 -0
- package/src/lib/locales/en/inputs.mjs +27 -0
- package/src/lib/locales/en/inputs.mjs.map +1 -0
- package/src/lib/locales/en/list.d.mts +48 -0
- package/src/lib/locales/en/list.d.ts +48 -0
- package/src/lib/locales/en/list.js +33 -0
- package/src/lib/locales/en/list.js.map +1 -1
- package/src/lib/locales/en/list.mjs +33 -0
- package/src/lib/locales/en/list.mjs.map +1 -1
- package/src/lib/locales/en/panel.d.mts +6 -0
- package/src/lib/locales/en/panel.d.ts +6 -0
- package/src/lib/locales/en/panel.js +3 -0
- package/src/lib/locales/en/panel.js.map +1 -1
- package/src/lib/locales/en/panel.mjs +3 -0
- package/src/lib/locales/en/panel.mjs.map +1 -1
- package/src/lib/locales/en/questions.d.mts +8 -0
- package/src/lib/locales/en/questions.d.ts +8 -0
- package/src/lib/locales/en/questions.js +9 -0
- package/src/lib/locales/en/questions.js.map +1 -1
- package/src/lib/locales/en/questions.mjs +9 -0
- package/src/lib/locales/en/questions.mjs.map +1 -1
- package/src/lib/locales/en/refusals.d.mts +11 -0
- package/src/lib/locales/en/refusals.d.ts +11 -0
- package/src/lib/locales/en/refusals.js +11 -0
- package/src/lib/locales/en/refusals.js.map +1 -1
- package/src/lib/locales/en/refusals.mjs +11 -0
- package/src/lib/locales/en/refusals.mjs.map +1 -1
- package/src/lib/locales/en/work-text.d.mts +58 -0
- package/src/lib/locales/en/work-text.d.ts +58 -0
- package/src/lib/locales/en/work-text.js +67 -0
- package/src/lib/locales/en/work-text.js.map +1 -0
- package/src/lib/locales/en/work-text.mjs +64 -0
- package/src/lib/locales/en/work-text.mjs.map +1 -0
- package/src/lib/number-box.d.mts +66 -0
- package/src/lib/number-box.d.ts +66 -0
- package/src/lib/number-box.js +153 -0
- package/src/lib/number-box.js.map +1 -0
- package/src/lib/number-box.mjs +149 -0
- package/src/lib/number-box.mjs.map +1 -0
- package/src/lib/page-json.d.mts +3 -1
- package/src/lib/page-json.d.ts +3 -1
- package/src/lib/page-json.js +5 -3
- package/src/lib/page-json.js.map +1 -1
- package/src/lib/page-json.mjs +5 -3
- package/src/lib/page-json.mjs.map +1 -1
- package/src/lib/page-tree.js +11 -1
- package/src/lib/page-tree.js.map +1 -1
- package/src/lib/page-tree.mjs +11 -1
- package/src/lib/page-tree.mjs.map +1 -1
- package/src/lib/panel-block.js +22 -6
- package/src/lib/panel-block.js.map +1 -1
- package/src/lib/panel-block.mjs +22 -6
- package/src/lib/panel-block.mjs.map +1 -1
- package/src/lib/panel-field.js +5 -1
- package/src/lib/panel-field.js.map +1 -1
- package/src/lib/panel-field.mjs +5 -1
- package/src/lib/panel-field.mjs.map +1 -1
- package/src/lib/panel-group.js +7 -3
- package/src/lib/panel-group.js.map +1 -1
- package/src/lib/panel-group.mjs +7 -3
- package/src/lib/panel-group.mjs.map +1 -1
- package/src/lib/panel-layout.js +20 -15
- package/src/lib/panel-layout.js.map +1 -1
- package/src/lib/panel-layout.mjs +20 -15
- package/src/lib/panel-layout.mjs.map +1 -1
- package/src/lib/panel-look.js +28 -14
- package/src/lib/panel-look.js.map +1 -1
- package/src/lib/panel-look.mjs +28 -14
- package/src/lib/panel-look.mjs.map +1 -1
- package/src/lib/panel-map.js +53 -20
- package/src/lib/panel-map.js.map +1 -1
- package/src/lib/panel-map.mjs +53 -20
- package/src/lib/panel-map.mjs.map +1 -1
- package/src/lib/panel-page.js +5 -1
- package/src/lib/panel-page.js.map +1 -1
- package/src/lib/panel-page.mjs +5 -1
- package/src/lib/panel-page.mjs.map +1 -1
- package/src/lib/panel-parts.js +5 -1
- package/src/lib/panel-parts.js.map +1 -1
- package/src/lib/panel-parts.mjs +5 -1
- package/src/lib/panel-parts.mjs.map +1 -1
- package/src/lib/picker-commands.d.mts +16 -0
- package/src/lib/picker-commands.d.ts +16 -0
- package/src/lib/picker-commands.js +61 -0
- package/src/lib/picker-commands.js.map +1 -0
- package/src/lib/picker-commands.mjs +58 -0
- package/src/lib/picker-commands.mjs.map +1 -0
- package/src/lib/rules-answers.d.mts +1 -1
- package/src/lib/rules-answers.d.ts +1 -1
- package/src/lib/rules-answers.js +45 -21
- package/src/lib/rules-answers.js.map +1 -1
- package/src/lib/rules-answers.mjs +45 -21
- package/src/lib/rules-answers.mjs.map +1 -1
- package/src/lib/rules-formula-box.d.mts +7 -3
- package/src/lib/rules-formula-box.d.ts +7 -3
- package/src/lib/rules-formula-box.js +26 -6
- package/src/lib/rules-formula-box.js.map +1 -1
- package/src/lib/rules-formula-box.mjs +26 -6
- package/src/lib/rules-formula-box.mjs.map +1 -1
- package/src/lib/rules-formula.js +7 -5
- package/src/lib/rules-formula.js.map +1 -1
- package/src/lib/rules-formula.mjs +8 -6
- package/src/lib/rules-formula.mjs.map +1 -1
- package/src/lib/rules-worked-out.js +66 -12
- package/src/lib/rules-worked-out.js.map +1 -1
- package/src/lib/rules-worked-out.mjs +66 -12
- package/src/lib/rules-worked-out.mjs.map +1 -1
- package/src/lib/screen-properties.js +9 -2
- package/src/lib/screen-properties.js.map +1 -1
- package/src/lib/screen-properties.mjs +9 -2
- package/src/lib/screen-properties.mjs.map +1 -1
- package/src/lib/setting-refusals.d.mts +3 -0
- package/src/lib/setting-refusals.d.ts +3 -0
- package/src/lib/setting-refusals.js +25 -0
- package/src/lib/setting-refusals.js.map +1 -0
- package/src/lib/setting-refusals.mjs +22 -0
- package/src/lib/setting-refusals.mjs.map +1 -0
- package/src/lib/styles-head.d.mts +7 -0
- package/src/lib/styles-head.d.ts +7 -0
- package/src/lib/styles-head.js +28 -0
- package/src/lib/styles-head.js.map +1 -0
- package/src/lib/styles-head.mjs +25 -0
- package/src/lib/styles-head.mjs.map +1 -0
- package/src/lib/styles.d.mts +1 -1
- package/src/lib/styles.d.ts +1 -1
- package/src/lib/styles.js +9 -2
- package/src/lib/styles.js.map +1 -1
- package/src/lib/styles.mjs +9 -2
- package/src/lib/styles.mjs.map +1 -1
- package/src/lib/table-panel.js +16 -5
- package/src/lib/table-panel.js.map +1 -1
- package/src/lib/table-panel.mjs +16 -5
- package/src/lib/table-panel.mjs.map +1 -1
- package/src/lib/work-text.d.mts +43 -0
- package/src/lib/work-text.d.ts +43 -0
- package/src/lib/work-text.js +235 -0
- package/src/lib/work-text.js.map +1 -0
- package/src/lib/work-text.mjs +227 -0
- package/src/lib/work-text.mjs.map +1 -0
|
@@ -5,8 +5,10 @@ exports.columnProperties = columnProperties;
|
|
|
5
5
|
exports.listActionProperties = listActionProperties;
|
|
6
6
|
const core_1 = require("@fieldia/core");
|
|
7
7
|
const kinds_1 = require("./kinds");
|
|
8
|
+
const list_commands_1 = require("./list-commands");
|
|
8
9
|
const menu_1 = require("./menu");
|
|
9
10
|
const steps_panel_1 = require("./steps-panel");
|
|
11
|
+
const number_box_1 = require("./number-box");
|
|
10
12
|
/**
|
|
11
13
|
* The panels of a list page: the list's own — the rows a page holds, its
|
|
12
14
|
* order, where the search looks, its named filters and its groupings — a
|
|
@@ -94,7 +96,12 @@ function filterRow(el, designer, id) {
|
|
|
94
96
|
const field = fieldOf(current.field);
|
|
95
97
|
save({ op: test.value, ...(current.value === undefined && field ? { value: firstValue(field) } : {}) });
|
|
96
98
|
});
|
|
99
|
+
/** The value the filter holds now, as the page last drew it. */
|
|
100
|
+
let heldValue;
|
|
101
|
+
/** Its number box, drawn again when the page changes. */
|
|
102
|
+
let numberShown = null;
|
|
97
103
|
function valueControl(field, condition) {
|
|
104
|
+
numberShown = null;
|
|
98
105
|
if (field.type === 'selection' || field.type === 'boolean') {
|
|
99
106
|
const options = field.type === 'boolean' ? [['true', w.yes], ['false', w.no]] : field.options.map((o) => [String(o.value), o.label]);
|
|
100
107
|
const box = select(el, w.filterValue, options);
|
|
@@ -105,15 +112,21 @@ function filterRow(el, designer, id) {
|
|
|
105
112
|
});
|
|
106
113
|
return box;
|
|
107
114
|
}
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
115
|
+
if (['integer', 'float', 'monetary'].includes(field.type)) {
|
|
116
|
+
// A number read as every box reads one, kept as it is left; a whole number for a whole-number field.
|
|
117
|
+
const number = (0, number_box_1.settingNumber)(el, designer, {
|
|
118
|
+
label: w.filterValue,
|
|
119
|
+
integer: field.type === 'integer',
|
|
120
|
+
saved: () => (typeof heldValue === 'number' ? heldValue : null),
|
|
121
|
+
commit: (n) => save({ value: n }),
|
|
122
|
+
});
|
|
123
|
+
numberShown = number;
|
|
124
|
+
number.refresh();
|
|
125
|
+
return number.input;
|
|
126
|
+
}
|
|
127
|
+
const box = el('input', { class: 'fd-input', type: field.type === 'date' || field.type === 'datetime' ? 'date' : 'text', 'aria-label': w.filterValue });
|
|
111
128
|
box.value = String(condition.value ?? '');
|
|
112
|
-
box.addEventListener('input', () => {
|
|
113
|
-
if (numeric && box.value.trim() === '')
|
|
114
|
-
return;
|
|
115
|
-
save({ value: numeric ? Number(box.value) : box.value });
|
|
116
|
-
});
|
|
129
|
+
box.addEventListener('input', () => save({ value: box.value }));
|
|
117
130
|
return box;
|
|
118
131
|
}
|
|
119
132
|
return {
|
|
@@ -134,11 +147,13 @@ function filterRow(el, designer, id) {
|
|
|
134
147
|
which.value = single.field;
|
|
135
148
|
test.replaceChildren(...testsFor(field, designer.words).map(([op, words]) => el('option', { value: op }, words)));
|
|
136
149
|
test.value = single.op;
|
|
150
|
+
heldValue = single.value;
|
|
137
151
|
const key = `${single.field}:${single.op}`;
|
|
138
152
|
if (key !== valueKey) {
|
|
139
153
|
valueKey = key;
|
|
140
154
|
valueBox.replaceChildren(...(single.op === 'set' || single.op === 'notset' ? [] : [valueControl(field, single)]));
|
|
141
155
|
}
|
|
156
|
+
numberShown?.refresh();
|
|
142
157
|
},
|
|
143
158
|
focus() {
|
|
144
159
|
name.focus();
|
|
@@ -190,7 +205,23 @@ function mapSection(el, designer) {
|
|
|
190
205
|
// How the map sits in its page: its height, the gestures it takes, the closest it zooms to show its records.
|
|
191
206
|
const height = el('select', { class: 'fd-input fd-select', 'aria-label': w.mapHeight });
|
|
192
207
|
const allGestures = el('input', { type: 'checkbox' });
|
|
193
|
-
|
|
208
|
+
// A whole number, 1 to 22, refused with its range rather than brought into it in silence; emptied, the usual 16.
|
|
209
|
+
let zoomHeld = null;
|
|
210
|
+
const fitZoom = (0, number_box_1.settingNumber)(el, designer, {
|
|
211
|
+
label: w.fitZoom,
|
|
212
|
+
attrs: { class: 'fd-input', placeholder: '16' },
|
|
213
|
+
integer: true,
|
|
214
|
+
min: 1,
|
|
215
|
+
max: 22,
|
|
216
|
+
optional: true,
|
|
217
|
+
saved: () => zoomHeld,
|
|
218
|
+
commit: (n) => change((map) => {
|
|
219
|
+
if (n === null)
|
|
220
|
+
delete map.fitZoom;
|
|
221
|
+
else
|
|
222
|
+
map.fitZoom = n;
|
|
223
|
+
}),
|
|
224
|
+
});
|
|
194
225
|
const rows = {
|
|
195
226
|
lat: prop(el, w.latitude, lat),
|
|
196
227
|
lng: prop(el, w.longitude, lng),
|
|
@@ -203,7 +234,7 @@ function mapSection(el, designer) {
|
|
|
203
234
|
areaField: prop(el, w.areaField, areaField),
|
|
204
235
|
areas: prop(el, w.areas, areas),
|
|
205
236
|
};
|
|
206
|
-
const details = el('div', { class: 'fd-props' }, prop(el, w.where, where), rows.lat, rows.lng, prop(el, w.pinShows, label), prop(el, w.pinLook, look), rows.photo, rows.icon, rows.iconFrom, rows.turn, rows.home, prop(el, w.cardTitle, title), prop(el, w.cardPicture, picture), el('div', { class: 'fd-prop' }, el('span', { class: 'fd-prop-name' }, w.cardShows), cardFields, addToCard), el('label', { class: 'fd-q-required' }, cardLabels, el('span', {}, w.cardLabels)), el('label', { class: 'fd-q-required' }, cardLead, el('span', {}, w.cardLead)), prop(el, w.cardLink, cardLink), el('label', { class: 'fd-q-required' }, cardChoose, el('span', {}, w.cardChoose)), prop(el, w.opensAs, opens), el('label', { class: 'fd-q-required' }, bubbles, el('span', {}, w.bubbles)), el('div', { class: 'fd-prop' }, el('span', { class: 'fd-prop-name' }, w.mapTools), tools), el('label', { class: 'fd-q-required' }, heat, el('span', {}, w.heat)), rows.weight, rows.areas, rows.areaField, areaWhy, prop(el, w.mapHeight, height), el('label', { class: 'fd-q-required' }, allGestures, el('span', {}, w.allGestures)), prop(el, w.fitZoom, fitZoom), el('p', { class: 'fd-properties-hint' }, w.mapNote));
|
|
237
|
+
const details = el('div', { class: 'fd-props' }, prop(el, w.where, where), rows.lat, rows.lng, prop(el, w.pinShows, label), prop(el, w.pinLook, look), rows.photo, rows.icon, rows.iconFrom, rows.turn, rows.home, prop(el, w.cardTitle, title), prop(el, w.cardPicture, picture), el('div', { class: 'fd-prop' }, el('span', { class: 'fd-prop-name' }, w.cardShows), cardFields, addToCard), el('label', { class: 'fd-q-required' }, cardLabels, el('span', {}, w.cardLabels)), el('label', { class: 'fd-q-required' }, cardLead, el('span', {}, w.cardLead)), prop(el, w.cardLink, cardLink), el('label', { class: 'fd-q-required' }, cardChoose, el('span', {}, w.cardChoose)), prop(el, w.opensAs, opens), el('label', { class: 'fd-q-required' }, bubbles, el('span', {}, w.bubbles)), el('div', { class: 'fd-prop' }, el('span', { class: 'fd-prop-name' }, w.mapTools), tools), el('label', { class: 'fd-q-required' }, heat, el('span', {}, w.heat)), rows.weight, rows.areas, rows.areaField, areaWhy, prop(el, w.mapHeight, height), el('label', { class: 'fd-q-required' }, allGestures, el('span', {}, w.allGestures)), prop(el, w.fitZoom, fitZoom.input), el('p', { class: 'fd-properties-hint' }, w.mapNote));
|
|
207
238
|
const element = el('div', { class: 'fd-prop', 'data-part': 'map' }, el('span', { class: 'fd-prop-name' }, w.map), onRow, noPlace, details);
|
|
208
239
|
const fieldsOf = (page, kinds) => everyField(page, designer).filter(({ field }) => kinds(field));
|
|
209
240
|
const fill = (box, choices, none) => box.replaceChildren(...(none === undefined ? [] : [el('option', { value: '' }, none)]), ...choices.map(({ name, field }) => el('option', { value: name }, field.label)));
|
|
@@ -236,7 +267,7 @@ function mapSection(el, designer) {
|
|
|
236
267
|
delete map.pin;
|
|
237
268
|
if (card && !Object.keys(card).length)
|
|
238
269
|
delete map.card;
|
|
239
|
-
designer.setListOptions({ map });
|
|
270
|
+
return designer.setListOptions({ map });
|
|
240
271
|
};
|
|
241
272
|
const pinOf = (map) => (map.pin ??= {});
|
|
242
273
|
/** Where a new map puts its records: the first point, or the two numbers named for latitude and longitude. */
|
|
@@ -334,13 +365,6 @@ function mapSection(el, designer) {
|
|
|
334
365
|
else
|
|
335
366
|
delete map.gestures;
|
|
336
367
|
}));
|
|
337
|
-
fitZoom.addEventListener('change', () => change((map) => {
|
|
338
|
-
const zoom = Math.round(Number(fitZoom.value));
|
|
339
|
-
if (fitZoom.value.trim() === '' || !Number.isFinite(zoom))
|
|
340
|
-
delete map.fitZoom;
|
|
341
|
-
else
|
|
342
|
-
map.fitZoom = Math.min(22, Math.max(1, zoom));
|
|
343
|
-
}));
|
|
344
368
|
addToCard.addEventListener('click', () => {
|
|
345
369
|
const page = designer.getPage();
|
|
346
370
|
const lines = current()?.card?.fields ?? [];
|
|
@@ -436,18 +460,24 @@ function mapSection(el, designer) {
|
|
|
436
460
|
height.replaceChildren(...heights.map(([value, text]) => el('option', { value }, text)));
|
|
437
461
|
height.value = own;
|
|
438
462
|
allGestures.checked = map.gestures === 'all';
|
|
439
|
-
|
|
440
|
-
|
|
463
|
+
zoomHeld = map.fitZoom ?? null;
|
|
464
|
+
fitZoom.refresh();
|
|
441
465
|
},
|
|
442
466
|
};
|
|
443
467
|
}
|
|
444
468
|
// ---- the list --------------------------------------------------------------------------------
|
|
445
469
|
function listProperties(el, designer) {
|
|
446
470
|
const w = designer.words.list;
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
471
|
+
// A whole number, 1 to 500, kept as it is left: never the 60 that "600" passes on its way.
|
|
472
|
+
let pageSize = 40;
|
|
473
|
+
const size = (0, number_box_1.settingNumber)(el, designer, {
|
|
474
|
+
label: w.rowsOnPage,
|
|
475
|
+
attrs: { class: 'fd-input', placeholder: '40' },
|
|
476
|
+
integer: true,
|
|
477
|
+
min: 1,
|
|
478
|
+
max: 500,
|
|
479
|
+
saved: () => pageSize,
|
|
480
|
+
commit: (n) => n !== null && designer.setListOptions({ pageSize: n }),
|
|
451
481
|
});
|
|
452
482
|
const sortBy = el('select', { class: 'fd-input fd-select', 'aria-label': w.sortedBy });
|
|
453
483
|
const direction = select(el, w.direction, [['asc', w.ascending], ['desc', w.descending]]);
|
|
@@ -480,14 +510,35 @@ function listProperties(el, designer) {
|
|
|
480
510
|
onPick: (name) => designer.setListOptions({ groupBy: [...taken, name] }),
|
|
481
511
|
});
|
|
482
512
|
});
|
|
513
|
+
// A box to choose each row; the search bar, or a keyword and each field's values; rows under their parent.
|
|
514
|
+
const choose = el('input', { type: 'checkbox', 'aria-label': w.choose });
|
|
515
|
+
choose.addEventListener('change', () => {
|
|
516
|
+
if (!designer.setListOptions({ choose: choose.checked }))
|
|
517
|
+
choose.checked = !choose.checked;
|
|
518
|
+
});
|
|
519
|
+
const chooseRow = el('div', { class: 'fd-prop', 'data-part': 'choose' }, el('label', { class: 'fd-q-required' }, choose, el('span', {}, w.choose)), el('p', { class: 'fd-properties-hint' }, w.chooseHint));
|
|
520
|
+
const sorts = el('input', { type: 'checkbox', 'aria-label': w.sortable });
|
|
521
|
+
sorts.addEventListener('change', () => {
|
|
522
|
+
if (!designer.setListOptions({ sortable: sorts.checked }))
|
|
523
|
+
sorts.checked = !sorts.checked;
|
|
524
|
+
});
|
|
525
|
+
const sortsRow = el('div', { class: 'fd-prop', 'data-part': 'sortable' }, el('label', { class: 'fd-q-required' }, sorts, el('span', {}, w.sortable)), el('p', { class: 'fd-properties-hint' }, w.sortableHint));
|
|
526
|
+
const searchWay = select(el, w.searchWay, [['bar', w.searchWays.bar], ['fields', w.searchWays.fields]]);
|
|
527
|
+
searchWay.addEventListener('change', () => designer.setListOptions({ search: searchWay.value }));
|
|
528
|
+
const filterBox = el('div', { class: 'fd-list-filter-fields' });
|
|
529
|
+
const filterFieldsRow = el('div', { class: 'fd-prop', 'data-part': 'filter-fields' }, el('span', { class: 'fd-prop-name' }, w.filterFields), filterBox, el('p', { class: 'fd-properties-hint' }, w.filterFieldsNote), el('p', { class: 'fd-properties-hint' }, w.filterLabelsNote));
|
|
530
|
+
const parent = el('select', { class: 'fd-input fd-select', 'aria-label': w.parentField });
|
|
531
|
+
parent.addEventListener('change', () => designer.setListOptions({ parentField: parent.value || null }));
|
|
532
|
+
const parentWhy = el('p', { class: 'fd-properties-hint', hidden: '' }, w.noParentField);
|
|
533
|
+
const parentRow = el('label', { class: 'fd-prop', 'data-part': 'parent' }, el('span', { class: 'fd-prop-name' }, w.parentField), parent, parentWhy);
|
|
483
534
|
const onMap = mapSection(el, designer);
|
|
484
|
-
const element = el('div', { class: 'fd-props' }, prop(el, w.rowsOnPage, size), prop(el, w.sortedBy, sortBy), directionRow, el('div', { class: 'fd-prop' }, el('span', { class: 'fd-prop-name' }, w.searchLooksIn), searchBox, el('p', { class: 'fd-properties-hint' }, w.noneTicked)), el('div', { class: 'fd-prop fd-prop-filters', 'data-part': 'filters' }, el('span', { class: 'fd-prop-name' }, w.filters), filtersBox, addFilter), el('div', { class: 'fd-prop' }, el('span', { class: 'fd-prop-name' }, w.groupBy), groupsBox, addGroup), onMap.element, el('p', { class: 'fd-properties-hint' }, w.rowOpens));
|
|
535
|
+
const element = el('div', { class: 'fd-props' }, prop(el, w.rowsOnPage, size.input), prop(el, w.sortedBy, sortBy), directionRow, chooseRow, sortsRow, prop(el, w.searchWay, searchWay), filterFieldsRow, parentRow, el('div', { class: 'fd-prop' }, el('span', { class: 'fd-prop-name' }, w.searchLooksIn), searchBox, el('p', { class: 'fd-properties-hint' }, w.noneTicked)), el('div', { class: 'fd-prop fd-prop-filters', 'data-part': 'filters' }, el('span', { class: 'fd-prop-name' }, w.filters), filtersBox, addFilter), el('div', { class: 'fd-prop' }, el('span', { class: 'fd-prop-name' }, w.groupBy), groupsBox, addGroup), onMap.element, el('p', { class: 'fd-properties-hint' }, w.rowOpens));
|
|
485
536
|
return {
|
|
486
537
|
element,
|
|
487
538
|
update(page) {
|
|
488
539
|
const list = listOf(page);
|
|
489
|
-
|
|
490
|
-
|
|
540
|
+
pageSize = list.pageSize ?? 40;
|
|
541
|
+
size.refresh();
|
|
491
542
|
const sortable = everyField(page, designer).filter(({ field }) => !UNSORTABLE.has(field.type));
|
|
492
543
|
sortBy.replaceChildren(el('option', { value: '' }, w.appOrder), ...sortable.map(({ name, field }) => el('option', { value: name }, field.label)));
|
|
493
544
|
const order = list.sort?.[0];
|
|
@@ -524,6 +575,37 @@ function listProperties(el, designer) {
|
|
|
524
575
|
});
|
|
525
576
|
while (filtersBox.children.length > drawn.length)
|
|
526
577
|
filtersBox.lastElementChild?.remove();
|
|
578
|
+
choose.checked = list.choose !== false;
|
|
579
|
+
sorts.checked = list.sortable !== false;
|
|
580
|
+
searchWay.value = list.search ?? 'bar';
|
|
581
|
+
// The filter bar's fields: those whose values it can list, ticked in the order the page keeps them.
|
|
582
|
+
filterFieldsRow.hidden = list.search !== 'fields';
|
|
583
|
+
const offered = list.filterFields ?? [];
|
|
584
|
+
const filterable = [...new Set([...offered, ...everyField(page, designer).filter(({ field }) => list_commands_1.FILTERABLE.has(field.type)).map(({ name }) => name)])];
|
|
585
|
+
// Each one offered has a name of its own on the bar, its label unless one is written; kept while it is being typed in.
|
|
586
|
+
const typing = filterBox.querySelector('.fd-list-filter-name:focus');
|
|
587
|
+
if (!typing || !filterable.includes(typing.dataset['field'] ?? '')) {
|
|
588
|
+
filterBox.replaceChildren(...filterable.map((name) => {
|
|
589
|
+
const label = page.fields[name]?.label ?? designer.modelFields().find((m) => m.name === name)?.field.label ?? name;
|
|
590
|
+
const box = el('input', { type: 'checkbox', 'aria-label': w.filterFieldNamed(label) });
|
|
591
|
+
box.checked = offered.includes(name);
|
|
592
|
+
box.addEventListener('change', () => designer.setListOptions({ filterFields: box.checked ? [...offered, name] : offered.filter((n) => n !== name) }));
|
|
593
|
+
const choice = el('label', { class: 'fd-q-required' }, box, el('span', {}, label));
|
|
594
|
+
if (!offered.includes(name))
|
|
595
|
+
return choice;
|
|
596
|
+
const own = el('input', { class: 'fd-input fd-list-filter-name', 'data-field': name, 'aria-label': w.filterLabelOf(label), title: w.filterLabelOf(label), placeholder: label });
|
|
597
|
+
own.value = list.filterLabels?.[name] ?? '';
|
|
598
|
+
own.addEventListener('change', () => designer.setListOptions({ filterLabel: { field: name, label: own.value } }));
|
|
599
|
+
return el('div', { class: 'fd-list-filter-field' }, choice, own);
|
|
600
|
+
}));
|
|
601
|
+
}
|
|
602
|
+
// Rows under their parent: a link to the list's own records.
|
|
603
|
+
const own = page.data.kind === 'record' ? page.data.model : '';
|
|
604
|
+
const links = everyField(page, designer).filter(({ field }) => field.type === 'many2one' && field.relation === own);
|
|
605
|
+
parent.replaceChildren(el('option', { value: '' }, w.noParent), ...links.map(({ name, field }) => el('option', { value: name }, field.label)));
|
|
606
|
+
parent.value = list.parentField ?? '';
|
|
607
|
+
parentWhy.hidden = links.length > 0;
|
|
608
|
+
parentRow.hidden = !links.length && !list.parentField;
|
|
527
609
|
const groups = list.groupBy ?? [];
|
|
528
610
|
groupsBox.replaceChildren(...groups.map((name) => {
|
|
529
611
|
const label = page.fields[name]?.label ?? name;
|
|
@@ -556,7 +638,8 @@ function columnProperties(el, designer, name) {
|
|
|
556
638
|
left.addEventListener('click', () => designer.moveColumn(name, at() - 1));
|
|
557
639
|
right.addEventListener('click', () => designer.moveColumn(name, at() + 1));
|
|
558
640
|
remove.addEventListener('click', () => designer.removeColumn(name));
|
|
559
|
-
const
|
|
641
|
+
const cells = cellSettings(el, designer, name);
|
|
642
|
+
const element = el('div', { class: 'fd-props' }, about, orderRow, ...cells.rows, el('div', { class: 'fd-props-actions' }, left, right, remove));
|
|
560
643
|
return {
|
|
561
644
|
element,
|
|
562
645
|
update(page) {
|
|
@@ -568,6 +651,7 @@ function columnProperties(el, designer, name) {
|
|
|
568
651
|
orderRow.hidden = UNSORTABLE.has(field.type);
|
|
569
652
|
const first = list.sort?.[0];
|
|
570
653
|
order.value = first?.field === name ? (first.desc ? 'desc' : 'asc') : '';
|
|
654
|
+
cells.update(page);
|
|
571
655
|
const index = list.columns.indexOf(name);
|
|
572
656
|
left.hidden = index <= 0;
|
|
573
657
|
right.hidden = index === list.columns.length - 1;
|
|
@@ -575,6 +659,142 @@ function columnProperties(el, designer, name) {
|
|
|
575
659
|
},
|
|
576
660
|
};
|
|
577
661
|
}
|
|
662
|
+
// ---- a column's cells ------------------------------------------------------------------------------
|
|
663
|
+
/**
|
|
664
|
+
* How a column draws its cells, as a work tracker's backlog does: a state's
|
|
665
|
+
* dot in each value's colour, an icon before the words by another field's
|
|
666
|
+
* value (a bug's, a task's), a width in characters, the side its words keep to.
|
|
667
|
+
*/
|
|
668
|
+
function cellSettings(el, designer, name) {
|
|
669
|
+
const w = designer.words.list;
|
|
670
|
+
const cellNow = () => ({ ...listOf(designer.getPage()).cells?.[name] });
|
|
671
|
+
const save = (cell) => {
|
|
672
|
+
for (const key of Object.keys(cell))
|
|
673
|
+
if (cell[key] === undefined)
|
|
674
|
+
delete cell[key];
|
|
675
|
+
return designer.setListCell(name, Object.keys(cell).length ? cell : null);
|
|
676
|
+
};
|
|
677
|
+
const widget = select(el, w.cellWidget, [['', w.cellWidgets.words], ['dot', w.cellWidgets.dot]]);
|
|
678
|
+
widget.addEventListener('change', () => save({ ...cellNow(), widget: widget.value || undefined, ...(widget.value ? {} : { options: undefined }) }));
|
|
679
|
+
const widgetRow = prop(el, w.cellWidget, widget);
|
|
680
|
+
const dots = el('div', { class: 'fd-list-cell-looks' });
|
|
681
|
+
const dotsRow = el('div', { class: 'fd-prop', 'data-part': 'dots' }, dots);
|
|
682
|
+
const lead = el('select', { class: 'fd-input fd-select', 'aria-label': w.leadFrom });
|
|
683
|
+
lead.addEventListener('change', () => save({ ...cellNow(), lead: lead.value ? { field: lead.value, looks: {} } : undefined }));
|
|
684
|
+
const leadLooks = el('div', { class: 'fd-list-cell-looks' });
|
|
685
|
+
const leadRow = el('div', { class: 'fd-prop', 'data-part': 'lead' }, el('span', { class: 'fd-prop-name' }, w.leadFrom), lead, leadLooks);
|
|
686
|
+
// Its width, in characters of its words or in pixels for the whole column: a number and its unit.
|
|
687
|
+
// A whole number: 1 to 200 characters, or 8 to 4000 pixels; kept as it is left, refused with its range; emptied, as its words need.
|
|
688
|
+
const unit = select(el, w.cellWidthUnit, [['ch', w.cellWidthUnits.characters], ['px', w.cellWidthUnits.pixels]]);
|
|
689
|
+
const widthIn = (n) => (unit.value === 'px' ? `${n}px` : n);
|
|
690
|
+
const sizing = {
|
|
691
|
+
label: w.cellWidth,
|
|
692
|
+
integer: true,
|
|
693
|
+
min: 1,
|
|
694
|
+
max: 200,
|
|
695
|
+
optional: true,
|
|
696
|
+
saved: () => {
|
|
697
|
+
const now = cellNow().width;
|
|
698
|
+
return now === undefined ? null : Number.parseInt(String(now), 10);
|
|
699
|
+
},
|
|
700
|
+
commit: (n) => save({ ...cellNow(), width: n === null ? undefined : widthIn(n) }),
|
|
701
|
+
};
|
|
702
|
+
const width = (0, number_box_1.settingNumber)(el, designer, sizing);
|
|
703
|
+
const unitRange = () => {
|
|
704
|
+
sizing.min = unit.value === 'px' ? 8 : 1;
|
|
705
|
+
sizing.max = unit.value === 'px' ? 4000 : 200;
|
|
706
|
+
};
|
|
707
|
+
unit.addEventListener('change', () => {
|
|
708
|
+
unitRange();
|
|
709
|
+
// The same number in the other unit, when it is a width in that one too.
|
|
710
|
+
const n = sizing.saved();
|
|
711
|
+
if (typeof n === 'number' && (0, list_commands_1.widthIsGood)(widthIn(n)))
|
|
712
|
+
save({ ...cellNow(), width: widthIn(n) });
|
|
713
|
+
});
|
|
714
|
+
const widthRow = el('div', { class: 'fd-prop', 'data-part': 'width' }, el('span', { class: 'fd-prop-name' }, w.cellWidth), el('div', { class: 'fd-list-width' }, width.input, unit), el('p', { class: 'fd-properties-hint' }, w.cellWidthHint));
|
|
715
|
+
const side = select(el, w.cellSide, [['', w.cellSides.auto], ['start', w.cellSides.start], ['end', w.cellSides.end]]);
|
|
716
|
+
side.addEventListener('change', () => save({ ...cellNow(), align: (side.value || undefined) }));
|
|
717
|
+
// Its header's rule: at its end, none, or set in from its end by some pixels.
|
|
718
|
+
const rule = select(el, w.cellRule, [['', w.cellRules.end], ['none', w.cellRules.none], ['in', w.cellRules.in]]);
|
|
719
|
+
// Pixels in from the column's end, a whole number 0 to 400, kept as it is left: letters never become 0px.
|
|
720
|
+
const ruleNow = () => {
|
|
721
|
+
const now = cellNow().rule;
|
|
722
|
+
return typeof now === 'string' ? Number.parseInt(now, 10) : null;
|
|
723
|
+
};
|
|
724
|
+
const ruleIn = (0, number_box_1.settingNumber)(el, designer, {
|
|
725
|
+
label: w.cellRuleIn,
|
|
726
|
+
integer: true,
|
|
727
|
+
min: 0,
|
|
728
|
+
max: 400,
|
|
729
|
+
saved: ruleNow,
|
|
730
|
+
commit: (n) => n !== null && (0, list_commands_1.ruleIsGood)(`${n}px`) && save({ ...cellNow(), rule: `${n}px` }),
|
|
731
|
+
});
|
|
732
|
+
rule.addEventListener('change', () => {
|
|
733
|
+
if (rule.value === 'none')
|
|
734
|
+
return void save({ ...cellNow(), rule: false });
|
|
735
|
+
if (rule.value === '')
|
|
736
|
+
return void save({ ...cellNow(), rule: undefined });
|
|
737
|
+
save({ ...cellNow(), rule: `${ruleNow() ?? 0}px` });
|
|
738
|
+
});
|
|
739
|
+
const ruleInRow = prop(el, w.cellRuleIn, ruleIn.input);
|
|
740
|
+
const ruleRow = el('div', { class: 'fd-prop', 'data-part': 'rule' }, el('span', { class: 'fd-prop-name' }, w.cellRule), rule, el('p', { class: 'fd-properties-hint' }, w.cellRuleHint));
|
|
741
|
+
/** A value's colour, and its icon for a lead: a row for each option of a choice. */
|
|
742
|
+
const optionRows = (field, row) => field?.type === 'selection' ? field.options.map((option) => el('div', { class: 'fd-list-cell-look' }, el('span', { class: 'fd-list-cell-look-name' }, option.label), ...row(String(option.value), option.label))) : [];
|
|
743
|
+
return {
|
|
744
|
+
rows: [widgetRow, dotsRow, leadRow, widthRow, prop(el, w.cellSide, side), ruleRow, ruleInRow],
|
|
745
|
+
update(page) {
|
|
746
|
+
const field = page.fields[name];
|
|
747
|
+
const cell = page.layout.type === 'list' ? (page.layout.cells?.[name] ?? {}) : {};
|
|
748
|
+
widget.value = cell.widget === 'dot' ? 'dot' : '';
|
|
749
|
+
widgetRow.hidden = field?.type !== 'selection';
|
|
750
|
+
// Each state's dot colour, when the column draws its dot.
|
|
751
|
+
dotsRow.hidden = cell.widget !== 'dot';
|
|
752
|
+
const colours = (cell.options?.['colours'] ?? {});
|
|
753
|
+
dots.replaceChildren(...optionRows(field, (value, label) => {
|
|
754
|
+
const colour = el('input', { type: 'color', class: 'fd-insp-colour', 'aria-label': w.dotColour(label) });
|
|
755
|
+
colour.value = colours[value] ?? '#7e7e7e';
|
|
756
|
+
colour.addEventListener('input', () => save({ ...cellNow(), options: { ...cellNow().options, colours: { ...(cellNow().options?.['colours'] ?? {}), [value]: colour.value } } }));
|
|
757
|
+
return [colour];
|
|
758
|
+
}));
|
|
759
|
+
// An icon before the words: by a choice's value, each with its icon and colour.
|
|
760
|
+
const choices = everyField(page, designer).filter(({ field: f }) => f.type === 'selection');
|
|
761
|
+
lead.replaceChildren(el('option', { value: '' }, w.noLead), ...choices.map(({ name: n, field: f }) => el('option', { value: n }, f.label)));
|
|
762
|
+
lead.value = cell.lead?.field ?? '';
|
|
763
|
+
const from = cell.lead ? page.fields[cell.lead.field] : undefined;
|
|
764
|
+
leadLooks.replaceChildren(...optionRows(from, (value, label) => {
|
|
765
|
+
const look = cell.lead?.looks[value];
|
|
766
|
+
const icon = el('input', { class: 'fd-input', 'aria-label': w.leadIcon(label), placeholder: 'bug' });
|
|
767
|
+
icon.value = look?.icon ?? '';
|
|
768
|
+
const colour = el('input', { type: 'color', class: 'fd-insp-colour', 'aria-label': w.leadColour(label) });
|
|
769
|
+
colour.value = look?.colour ?? '#7e7e7e';
|
|
770
|
+
const write = () => {
|
|
771
|
+
const now = cellNow();
|
|
772
|
+
if (!now.lead)
|
|
773
|
+
return;
|
|
774
|
+
const looks = { ...now.lead.looks };
|
|
775
|
+
if (icon.value.trim())
|
|
776
|
+
looks[value] = { icon: icon.value.trim(), ...(look?.colour || colour.value !== '#7e7e7e' ? { colour: colour.value } : {}) };
|
|
777
|
+
else
|
|
778
|
+
delete looks[value];
|
|
779
|
+
save({ ...now, lead: { field: now.lead.field, looks } });
|
|
780
|
+
};
|
|
781
|
+
icon.addEventListener('change', write);
|
|
782
|
+
colour.addEventListener('input', write);
|
|
783
|
+
return [icon, colour];
|
|
784
|
+
}));
|
|
785
|
+
const inPixels = typeof cell.width === 'string';
|
|
786
|
+
if (!focused(unit) && cell.width !== undefined)
|
|
787
|
+
unit.value = inPixels ? 'px' : 'ch';
|
|
788
|
+
unitRange();
|
|
789
|
+
width.refresh();
|
|
790
|
+
side.value = cell.align ?? '';
|
|
791
|
+
if (!focused(rule))
|
|
792
|
+
rule.value = cell.rule === false ? 'none' : cell.rule ? 'in' : '';
|
|
793
|
+
ruleIn.refresh();
|
|
794
|
+
ruleInRow.hidden = rule.value !== 'in';
|
|
795
|
+
},
|
|
796
|
+
};
|
|
797
|
+
}
|
|
578
798
|
// ---- a button for the rows chosen ----------------------------------------------------------------
|
|
579
799
|
function listActionProperties(el, designer, id) {
|
|
580
800
|
const w = designer.words.list;
|