native-document 1.0.139 → 1.0.141
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/components.js +1 -1
- package/devtools/ComponentRegistry.js +3 -2
- package/dist/native-document.components.min.css +1 -0
- package/dist/native-document.components.min.js +11639 -8757
- package/dist/native-document.dev.js +2645 -2166
- package/dist/native-document.dev.js.map +1 -1
- package/dist/native-document.min.js +1 -1
- package/index.js +1 -0
- package/package.json +5 -2
- package/rollup.config.js +5 -2
- package/src/components/$traits/has-draggable/HasDraggable.js +69 -0
- package/src/components/$traits/has-draggable/has-draggable.css +8 -0
- package/src/components/$traits/{HasItems.js → has-items/HasItems.js} +2 -11
- package/src/components/$traits/has-position/HasFullPosition.js +51 -0
- package/src/components/$traits/has-position/HasPosition.js +23 -0
- package/src/components/$traits/has-resizable/HasResizable.js +113 -0
- package/src/components/$traits/has-resizable/has-resizable.css +121 -0
- package/src/components/$traits/has-validation/HasValidation.js +86 -0
- package/src/components/BaseComponent.js +82 -7
- package/src/components/accordion/Accordion.js +37 -31
- package/src/components/accordion/AccordionItem.js +14 -21
- package/src/components/alert/Alert.js +48 -40
- package/src/components/avatar/Avatar.js +4 -3
- package/src/components/avatar/AvatarGroup.js +8 -2
- package/src/components/badge/Badge.js +7 -7
- package/src/components/base-component.css +0 -0
- package/src/components/breadcrumb/BreadCrumb.js +30 -21
- package/src/components/button/Button.js +3 -14
- package/src/components/context-menu/ContextMenu.js +49 -26
- package/src/components/dropdown/Dropdown.js +172 -34
- package/src/components/dropdown/DropdownDivider.js +4 -3
- package/src/components/dropdown/DropdownGroup.js +19 -19
- package/src/components/dropdown/DropdownItem.js +24 -18
- package/src/components/dropdown/helpers.js +52 -0
- package/src/components/form/FormControl.js +207 -108
- package/src/components/form/field/Field.js +106 -174
- package/src/components/form/field/FieldCollection.js +110 -203
- package/src/components/form/field/types/AutocompleteField.js +26 -5
- package/src/components/form/field/types/CheckboxField.js +4 -4
- package/src/components/form/field/types/CheckboxGroupField.js +11 -5
- package/src/components/form/field/types/ColorField.js +4 -4
- package/src/components/form/field/types/DateField.js +110 -18
- package/src/components/form/field/types/EmailField.js +2 -2
- package/src/components/form/field/types/FileField.js +87 -21
- package/src/components/form/field/types/HiddenField.js +4 -4
- package/src/components/form/field/types/ImageField.js +4 -4
- package/src/components/form/field/types/NumberField.js +5 -5
- package/src/components/form/field/types/PasswordField.js +28 -6
- package/src/components/form/field/types/RadioField.js +12 -8
- package/src/components/form/field/types/RangeField.js +29 -5
- package/src/components/form/field/types/SearchField.js +4 -4
- package/src/components/form/field/types/SelectField.js +75 -8
- package/src/components/form/field/types/StringField.js +4 -4
- package/src/components/form/field/types/TelField.js +4 -4
- package/src/components/form/field/types/TextAreaField.js +7 -5
- package/src/components/form/field/types/TimeField.js +52 -6
- package/src/components/form/field/types/UrlField.js +4 -5
- package/src/components/form/field/types/file-field-mode/FileAvatarMode.js +104 -0
- package/src/components/form/field/types/file-field-mode/FileDropzoneMode.js +59 -0
- package/src/components/form/field/types/file-field-mode/FileItemPreview.js +74 -0
- package/src/components/form/field/types/file-field-mode/FileNativeMode.js +21 -0
- package/src/components/form/field/types/file-field-mode/FileUploadButtonMode.js +59 -0
- package/src/components/form/field/types/file-field-mode/FileWallMode.js +53 -0
- package/src/components/form/index.js +14 -2
- package/src/components/form/validation/Validation.js +9 -0
- package/src/components/list/List.js +1 -1
- package/src/components/list/ListGroup.js +1 -1
- package/src/components/menu/HasMenuItem.js +133 -0
- package/src/components/menu/Menu.js +47 -56
- package/src/components/menu/MenuGroup.js +36 -8
- package/src/components/menu/MenuItem.js +24 -10
- package/src/components/menu/MenuLink.js +2 -0
- package/src/components/modal/Modal.js +153 -23
- package/src/components/pagination/Pagination.js +55 -21
- package/src/components/popover/Popover.js +127 -40
- package/src/components/progress/Progress.js +14 -24
- package/src/components/skeleton/Skeleton.js +36 -13
- package/src/components/slider/Slider.js +96 -70
- package/src/components/spinner/Spinner.js +4 -2
- package/src/components/splitter/Splitter.js +15 -8
- package/src/components/splitter/SplitterGutter.js +28 -7
- package/src/components/splitter/SplitterPanel.js +9 -15
- package/src/components/splitter/index.js +3 -1
- package/src/components/stacks/AbsoluteStack.js +33 -0
- package/src/components/stacks/FixedStack.js +33 -0
- package/src/components/stacks/PositionStack.js +146 -0
- package/src/components/stacks/RelativeStack.js +33 -0
- package/src/components/{layouts → stacks}/Stack.js +22 -3
- package/src/components/{layouts → stacks}/index.js +6 -4
- package/src/components/stepper/Stepper.js +159 -67
- package/src/components/stepper/StepperStep.js +49 -12
- package/src/components/switch/Switch.js +59 -29
- package/src/components/switch/index.js +6 -0
- package/src/components/table/Column.js +26 -24
- package/src/components/table/ColumnGroup.js +4 -13
- package/src/components/table/DataTable.js +388 -103
- package/src/components/table/SimpleTable.js +31 -140
- package/src/components/tabs/Tabs.js +142 -44
- package/src/components/toast/Toast.js +40 -35
- package/src/components/tooltip/Tooltip.js +152 -35
- package/src/core/data/ObservableArray.js +94 -30
- package/src/core/data/ObservableChecker.js +20 -75
- package/src/core/data/ObservableItem.js +35 -3
- package/src/core/data/observable-helpers/computed.js +2 -1
- package/src/core/data/observable-helpers/object.js +13 -8
- package/src/core/data/observable-helpers/observable.is-to.js +196 -0
- package/src/core/elements/anchor/anchor.js +3 -2
- package/src/core/elements/control/for-each-array.js +44 -30
- package/src/core/elements/control/for-each.js +6 -3
- package/src/core/elements/control/show-if.js +11 -6
- package/src/core/elements/control/switch.js +2 -1
- package/src/core/elements/index.js +1 -1
- package/src/core/elements/svg.js +61 -0
- package/src/core/utils/HasEventEmitter.js +6 -0
- package/src/core/utils/debug-manager.js +2 -5
- package/src/core/utils/filters/standard.js +2 -1
- package/src/core/utils/property-accumulator.js +35 -6
- package/src/core/utils/shortcut-manager.js +242 -0
- package/src/core/utils/validator.js +1 -1
- package/src/core/wrappers/AttributesWrapper.js +41 -4
- package/src/core/wrappers/DocumentObserver.js +0 -1
- package/src/core/wrappers/HtmlElementWrapper.js +1 -1
- package/src/core/wrappers/NDElement.js +15 -2
- package/src/core/wrappers/SvgElementWrapper.js +15 -0
- package/src/core/wrappers/prototypes/attributes-extensions.js +4 -1
- package/src/core/wrappers/prototypes/nd-element-extensions.js +8 -1
- package/src/router/Router.js +0 -1
- package/src/ui/components/accordion/AccordionItemRender.js +63 -0
- package/src/ui/components/accordion/AccordionRender.js +34 -0
- package/src/ui/components/accordion/accordion.css +121 -0
- package/src/ui/components/alert/AlertRender.js +80 -0
- package/src/ui/components/alert/alert.css +163 -0
- package/src/ui/components/avatar/avata-group/AvatarGroupRender.js +49 -0
- package/src/ui/components/avatar/avata-group/avatar-group.css +38 -0
- package/src/ui/components/avatar/avatar/AvatarRender.js +87 -0
- package/src/ui/components/avatar/avatar/avatar.css +189 -0
- package/src/ui/components/badge/BadgeRender.js +24 -0
- package/src/ui/components/badge/badge.css +168 -0
- package/src/ui/components/breadcrumb/BreadcrumbRender.js +43 -0
- package/src/ui/components/breadcrumb/breadcrumb.css +55 -0
- package/src/ui/components/button/ButtonRender.js +65 -0
- package/src/ui/components/button/button.css +288 -354
- package/src/ui/components/contextmenu/ContextmenuRender.js +70 -0
- package/src/ui/components/contextmenu/contextmenu.css +36 -0
- package/src/ui/components/divider/DividerRender.js +70 -0
- package/src/ui/components/divider/divider.css +70 -0
- package/src/ui/components/dropdown/DropdownRender.js +92 -0
- package/src/ui/components/dropdown/divider/DropdownDividerRender.js +9 -0
- package/src/ui/components/dropdown/divider/dropdown-divider.css +0 -0
- package/src/ui/components/dropdown/dropdown.css +179 -0
- package/src/ui/components/dropdown/group/DropdownGroupRender.js +23 -0
- package/src/ui/components/dropdown/group/dropdown-group.css +0 -0
- package/src/ui/components/dropdown/item/DropdownItemRender.js +29 -0
- package/src/ui/components/dropdown/item/dropdown-item.css +0 -0
- package/src/ui/components/form/FieldCollectionRender.js +110 -0
- package/src/ui/components/form/FormControlRender.js +84 -0
- package/src/ui/components/form/field-collection.css +55 -0
- package/src/ui/components/form/fields/AutocompleteFieldRender.js +143 -0
- package/src/ui/components/form/fields/CheckboxFieldRender.js +59 -0
- package/src/ui/components/form/fields/CheckboxGroupFieldRender.js +92 -0
- package/src/ui/components/form/fields/ColorFieldRender.js +30 -0
- package/src/ui/components/form/fields/DateFieldRender.js +154 -0
- package/src/ui/components/form/fields/EmailFieldRender.js +5 -0
- package/src/ui/components/form/fields/FieldRender.js +117 -0
- package/src/ui/components/form/fields/FileFieldRender.js +41 -0
- package/src/ui/components/form/fields/HiddenFieldRender.js +14 -0
- package/src/ui/components/form/fields/ImageFieldRender.js +0 -0
- package/src/ui/components/form/fields/NumberFieldRender.js +52 -0
- package/src/ui/components/form/fields/PasswordFieldRender.js +65 -0
- package/src/ui/components/form/fields/RadioFieldRender.js +77 -0
- package/src/ui/components/form/fields/RangeFieldRender.js +121 -0
- package/src/ui/components/form/fields/SelectFieldRender.js +248 -0
- package/src/ui/components/form/fields/SliderFieldRender.js +359 -0
- package/src/ui/components/form/fields/StringFieldRender.js +6 -0
- package/src/ui/components/form/fields/TelFieldRender.js +6 -0
- package/src/ui/components/form/fields/TextAreaFieldRender.js +96 -0
- package/src/ui/components/form/fields/TimeFieldRender.js +141 -0
- package/src/ui/components/form/fields/UrlFieldRender.js +6 -0
- package/src/ui/components/form/fields/date-field.css +32 -0
- package/src/ui/components/form/fields/field.css +402 -0
- package/src/ui/components/form/fields/file-field.css +79 -0
- package/src/ui/components/form/fields/password-field.css +50 -0
- package/src/ui/components/form/fields/range-field.css +120 -0
- package/src/ui/components/form/fields/slider.css +195 -0
- package/src/ui/components/form/file-upload-mode/FileAvatarModeRender.js +143 -0
- package/src/ui/components/form/file-upload-mode/FileDropzoneModeRender.js +108 -0
- package/src/ui/components/form/file-upload-mode/FileNativeModeRender.js +22 -0
- package/src/ui/components/form/file-upload-mode/FileUploadButtonModeRender.js +89 -0
- package/src/ui/components/form/file-upload-mode/FileWallModeRender.js +91 -0
- package/src/ui/components/form/file-upload-mode/file-avatar-mode.css +139 -0
- package/src/ui/components/form/file-upload-mode/file-dropzone-mode.css +88 -0
- package/src/ui/components/form/file-upload-mode/file-upload-button-mode.css +44 -0
- package/src/ui/components/form/file-upload-mode/file-wall-mode.css +88 -0
- package/src/ui/components/form/form-control.css +40 -0
- package/src/ui/components/form/helpers.js +112 -0
- package/src/ui/components/form/index.js +61 -0
- package/src/ui/components/menu/MenuDividerRender.js +12 -0
- package/src/ui/components/menu/MenuGroupRender.js +60 -0
- package/src/ui/components/menu/MenuItemRender.js +57 -0
- package/src/ui/components/menu/MenuLinkRender.js +55 -0
- package/src/ui/components/menu/MenuRender.js +21 -0
- package/src/ui/components/menu/helpers.js +121 -0
- package/src/ui/components/menu/menu.css +308 -0
- package/src/ui/components/modal/ModalRender.js +119 -0
- package/src/ui/components/modal/modal.css +156 -0
- package/src/ui/components/pagination/PaginationRender.js +112 -0
- package/src/ui/components/pagination/pagination.css +63 -0
- package/src/ui/components/popover/PopoverRender.js +234 -0
- package/src/ui/components/popover/popover.css +139 -0
- package/src/ui/components/progress/ProgressRender.js +168 -0
- package/src/ui/components/progress/progress.css +197 -0
- package/src/ui/components/skeleton/SkeletonRender.js +79 -0
- package/src/ui/components/skeleton/skeleton.css +154 -0
- package/src/ui/components/spinner/SpinnerRender.js +46 -0
- package/src/ui/components/spinner/spinner.css +152 -0
- package/src/ui/components/splitter/SplitterGutterRender.js +94 -0
- package/src/ui/components/splitter/SplitterPanelRender.js +38 -0
- package/src/ui/components/splitter/SplitterRender.js +74 -0
- package/src/ui/components/splitter/splitter.css +128 -0
- package/src/ui/components/stacks/PositionStackRender.js +38 -0
- package/src/ui/components/stacks/StackRender.js +42 -0
- package/src/ui/components/stacks/absolute-stack/AbsoluteStackRender.js +5 -0
- package/src/ui/components/stacks/fixed-stack/FixedStackRender.js +5 -0
- package/src/ui/components/stacks/h-stack/HStackRender.js +7 -0
- package/src/ui/components/stacks/h-stack/h-stack.css +4 -0
- package/src/ui/components/stacks/index.js +15 -0
- package/src/ui/components/stacks/position-stack.css +62 -0
- package/src/ui/components/stacks/relative-stack/RelativeStackRender.js +7 -0
- package/src/ui/components/stacks/relative-stack/relative-stack.css +3 -0
- package/src/ui/components/stacks/stack.css +78 -0
- package/src/ui/components/stacks/v-stack/VStackRender.js +5 -0
- package/src/ui/components/stacks/v-stack/v-stack.css +4 -0
- package/src/ui/components/stepper/StepperRender.js +70 -0
- package/src/ui/components/stepper/StepperStepRender.js +67 -0
- package/src/ui/components/stepper/stepper.css +359 -0
- package/src/ui/components/switch/SwitchRender.js +82 -0
- package/src/ui/components/switch/switch.css +143 -0
- package/src/ui/components/table/data-table/DataTableRender.js +49 -0
- package/src/ui/components/table/data-table/bulk-actions.js +35 -0
- package/src/ui/components/table/data-table/data-table.css +246 -0
- package/src/ui/components/table/data-table/pagination.js +56 -0
- package/src/ui/components/table/data-table/tables.js +367 -0
- package/src/ui/components/table/data-table/toolbar.js +67 -0
- package/src/ui/components/table/simple-table/SimpleTableRender.js +191 -0
- package/src/ui/components/table/simple-table/simple-table.css +50 -0
- package/src/ui/components/tabs/TabsRender.js +226 -0
- package/src/ui/components/tabs/tabs.css +253 -0
- package/src/ui/components/toast/ToastRender.js +98 -0
- package/src/ui/components/toast/toast.css +201 -0
- package/src/ui/components/tooltip/TooltipRender.js +8 -0
- package/src/ui/components/tooltip/tooltip.css +113 -0
- package/src/ui/index.js +82 -0
- package/src/ui/tokens/colors-dark.scss +2 -1
- package/src/ui/tokens/reset.scss +3 -0
- package/types/control-flow.d.ts +2 -2
- package/src/components/layouts/ZStack.js +0 -41
- package/src/ui/components/button/button.render.js +0 -63
- /package/src/components/{layouts → stacks}/HStack.js +0 -0
- /package/src/components/{layouts → stacks}/VStack.js +0 -0
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import {Div, ShowIf} from "../../../core/elements";
|
|
2
|
+
import {createPortal} from "../../../core/elements/anchor/anchor";
|
|
3
|
+
import { $ } from '../../../../index';
|
|
4
|
+
import {computePosition, flip, shift} from '@floating-ui/dom';
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
import './contextmenu.css';
|
|
8
|
+
|
|
9
|
+
export default function ContextMenuRender($desc, instance) {
|
|
10
|
+
const $positionX = instance.$description.positionX, $positionY = instance.$description.positionY;
|
|
11
|
+
const format = (value) => value + 'px';
|
|
12
|
+
|
|
13
|
+
const contextBox = Div({
|
|
14
|
+
class: 'context-menu',
|
|
15
|
+
style: {position: 'fixed', left: $positionX.transform(format), top: $positionY.transform(format)},
|
|
16
|
+
}, $desc.menu);
|
|
17
|
+
instance.$description.contextContainer = contextBox;
|
|
18
|
+
|
|
19
|
+
const container = ShowIf($desc.isOpen, () => contextBox);
|
|
20
|
+
|
|
21
|
+
createPortal(container, {name: 'context-menu'});
|
|
22
|
+
|
|
23
|
+
if($desc.trigger) {
|
|
24
|
+
contextMenuHandler($desc.trigger, instance);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
document.addEventListener('click', () => instance.hide());
|
|
28
|
+
document.addEventListener('keydown', (e) => {
|
|
29
|
+
if(e.key === 'Escape') instance.hide();
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
return $desc.trigger || container;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export const contextMenuHandler = (trigger, instance, data = null) => {
|
|
36
|
+
if(!instance.$element) {
|
|
37
|
+
instance.toNdElement();
|
|
38
|
+
}
|
|
39
|
+
const $positionX = instance.$description.positionX, $positionY = instance.$description.positionY;
|
|
40
|
+
const contextBox = instance.$description.contextContainer;
|
|
41
|
+
|
|
42
|
+
trigger.nd.onContextMenu((e) => {
|
|
43
|
+
e.preventDefault();
|
|
44
|
+
instance.$description.data = data;
|
|
45
|
+
|
|
46
|
+
const virtualEl = {
|
|
47
|
+
getBoundingClientRect: () => ({
|
|
48
|
+
width: 0, height: 0,
|
|
49
|
+
x: e.clientX, y: e.clientY,
|
|
50
|
+
top: e.clientY, left: e.clientX,
|
|
51
|
+
right: e.clientX, bottom: e.clientY,
|
|
52
|
+
}),
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
instance.show();
|
|
56
|
+
|
|
57
|
+
requestAnimationFrame(() => {
|
|
58
|
+
computePosition(virtualEl, contextBox, {
|
|
59
|
+
placement: 'bottom-start',
|
|
60
|
+
middleware: [
|
|
61
|
+
flip(),
|
|
62
|
+
shift({padding: 8})
|
|
63
|
+
],
|
|
64
|
+
}).then(({x, y}) => {
|
|
65
|
+
$positionX.set(x);
|
|
66
|
+
$positionY.set(y);
|
|
67
|
+
});
|
|
68
|
+
});
|
|
69
|
+
})
|
|
70
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
--context-menu-bg: var(--background);
|
|
3
|
+
--context-menu-border: var(--gray-lite-3);
|
|
4
|
+
--context-menu-radius: var(--radius-card);
|
|
5
|
+
--context-menu-shadow: var(--shadow-lg);
|
|
6
|
+
--context-menu-z-index: 99999;
|
|
7
|
+
--context-menu-min-width: 180px;
|
|
8
|
+
--context-menu-animation-duration: 0.12s;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.context-menu {
|
|
12
|
+
z-index: var(--context-menu-z-index);
|
|
13
|
+
background: var(--context-menu-bg);
|
|
14
|
+
border: 1px solid var(--context-menu-border);
|
|
15
|
+
border-radius: var(--context-menu-radius);
|
|
16
|
+
box-shadow: var(--context-menu-shadow);
|
|
17
|
+
min-width: var(--context-menu-min-width);
|
|
18
|
+
box-sizing: border-box;
|
|
19
|
+
animation: context-menu-in var(--context-menu-animation-duration) ease forwards;
|
|
20
|
+
|
|
21
|
+
.menu {
|
|
22
|
+
flex-direction: column;
|
|
23
|
+
padding: var(--space-cozy) 0;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
@keyframes context-menu-in {
|
|
28
|
+
from {
|
|
29
|
+
opacity: 0;
|
|
30
|
+
transform: scale(0.97);
|
|
31
|
+
}
|
|
32
|
+
to {
|
|
33
|
+
opacity: 1;
|
|
34
|
+
transform: scale(1);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import {Div, Span} from '../../../core/elements';
|
|
2
|
+
import './divider.css';
|
|
3
|
+
|
|
4
|
+
const toUnit = (value) => {
|
|
5
|
+
if(typeof value === 'number') {
|
|
6
|
+
return value + 'px';
|
|
7
|
+
}
|
|
8
|
+
if(value?.__$Observable) {
|
|
9
|
+
return value.transform(v => typeof v === 'number' ? v + 'px' : v);
|
|
10
|
+
}
|
|
11
|
+
return value;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export default function DividerRender($desc, instance) {
|
|
15
|
+
const props = instance.getEditableProps();
|
|
16
|
+
|
|
17
|
+
const orientation = $desc.orientation || 'horizontal';
|
|
18
|
+
|
|
19
|
+
props.class.add('divider');
|
|
20
|
+
props.class.add('is-' + orientation);
|
|
21
|
+
|
|
22
|
+
const style = {};
|
|
23
|
+
|
|
24
|
+
if($desc.thickness) {
|
|
25
|
+
style['--divider-thickness'] = toUnit($desc.thickness);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
if($desc.color) {
|
|
29
|
+
style['--divider-color'] = $desc.color;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
if($desc.spacing) {
|
|
33
|
+
const val = toUnit($desc.spacing);
|
|
34
|
+
style.margin = orientation === 'horizontal' ? val + ' 0' : '0 ' + val;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
if(Object.keys(style).length) {
|
|
38
|
+
props.style.add(style);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const lineClass = 'divider-line is-' + ($desc.variant || 'solid');
|
|
42
|
+
const lineStyle = {};
|
|
43
|
+
|
|
44
|
+
if($desc.leading) {
|
|
45
|
+
lineStyle['margin-left'] = toUnit($desc.leading);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
if($desc.trailing) {
|
|
49
|
+
lineStyle['margin-right'] = toUnit($desc.trailing);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
if(!$desc.label) {
|
|
53
|
+
return Div(instance.resolveProps(), Span({class: lineClass, style: lineStyle}));
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const position = $desc.labelPosition || 'center';
|
|
57
|
+
const content = [];
|
|
58
|
+
|
|
59
|
+
if(position === 'center' || position === 'trailing') {
|
|
60
|
+
content.push(Span({class: lineClass, style: lineStyle}));
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
content.push(Span({class: 'divider-label'}, $desc.label));
|
|
64
|
+
|
|
65
|
+
if(position === 'center' || position === 'leading') {
|
|
66
|
+
content.push(Span({class: lineClass}));
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
return Div(instance.resolveProps(), content);
|
|
70
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
--divider-color: var(--gray-lite-3);
|
|
3
|
+
--divider-label-color: var(--gray);
|
|
4
|
+
--divider-label-size: var(--note-size);
|
|
5
|
+
--divider-label-gap: var(--space-comfortable);
|
|
6
|
+
--divider-thickness: 1px;
|
|
7
|
+
--divider-spacing: 16px;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.divider {
|
|
11
|
+
display: flex;
|
|
12
|
+
align-items: center;
|
|
13
|
+
width: 100%;
|
|
14
|
+
|
|
15
|
+
&.is-vertical {
|
|
16
|
+
flex-direction: column;
|
|
17
|
+
width: auto;
|
|
18
|
+
height: auto;
|
|
19
|
+
align-self: stretch;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.divider-line {
|
|
24
|
+
flex: 1;
|
|
25
|
+
border: none;
|
|
26
|
+
background: var(--divider-color);
|
|
27
|
+
|
|
28
|
+
&.is-solid {
|
|
29
|
+
background: var(--divider-color);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
&.is-dashed {
|
|
33
|
+
background: none;
|
|
34
|
+
border-top: var(--divider-thickness, 1px) dashed var(--divider-color);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
&.is-dotted {
|
|
38
|
+
background: none;
|
|
39
|
+
border-top: var(--divider-thickness, 1px) dotted var(--divider-color);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.divider.is-horizontal .divider-line {
|
|
44
|
+
height: var(--divider-thickness, 1px);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.divider.is-vertical .divider-line {
|
|
48
|
+
width: var(--divider-thickness, 1px);
|
|
49
|
+
height: auto;
|
|
50
|
+
border-top: none;
|
|
51
|
+
|
|
52
|
+
&.is-dashed {
|
|
53
|
+
background: none;
|
|
54
|
+
border-top: none;
|
|
55
|
+
border-left: var(--divider-thickness, 1px) dashed var(--divider-color);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
&.is-dotted {
|
|
59
|
+
background: none;
|
|
60
|
+
border-top: none;
|
|
61
|
+
border-left: var(--divider-thickness, 1px) dotted var(--divider-color);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.divider-label {
|
|
66
|
+
flex-shrink: 0;
|
|
67
|
+
font-size: var(--divider-label-size);
|
|
68
|
+
color: var(--divider-label-color);
|
|
69
|
+
padding: 0 var(--divider-label-gap);
|
|
70
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import {Div, Input, ForEachArray} from '../../../core/elements';
|
|
2
|
+
import PopoverRender from '../popover/PopoverRender';
|
|
3
|
+
import {createFilter} from "../../../core/utils/filters";
|
|
4
|
+
|
|
5
|
+
import './dropdown.css';
|
|
6
|
+
import {normalizeDropdownItem} from "../../../components/dropdown/helpers";
|
|
7
|
+
|
|
8
|
+
export default function DropdownRender($desc, instance) {
|
|
9
|
+
$desc.content = buildDropdownContent($desc, instance);
|
|
10
|
+
|
|
11
|
+
return PopoverRender($desc, instance, 'dropdown');
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const buildDropdownContent = ($desc, instance) => {
|
|
15
|
+
const content = [];
|
|
16
|
+
|
|
17
|
+
if($desc.searchable) {
|
|
18
|
+
content.push(buildSearch($desc, instance));
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
if($desc.renderContent) {
|
|
22
|
+
content.push(Div({class: 'dropdown-content'}, $desc.renderContent($desc, instance)));
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
let items = $desc.items;
|
|
26
|
+
|
|
27
|
+
if($desc.filter) {
|
|
28
|
+
if($desc.filterDependencies) {
|
|
29
|
+
items = items.where({
|
|
30
|
+
_: createFilter($desc.filterDependencies, (...args) => {
|
|
31
|
+
return $desc.filter(...args);
|
|
32
|
+
})
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
items = items.where({
|
|
37
|
+
_: createFilter($desc.searchValue, (item, key) => {
|
|
38
|
+
return $desc.filter(item, key);
|
|
39
|
+
})
|
|
40
|
+
})
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const itemsContainer = Div({class: 'dropdown-items'},
|
|
45
|
+
ForEachArray(items, (item) => {
|
|
46
|
+
item = normalizeDropdownItem($desc.mapper ? $desc.mapper(item) : item);
|
|
47
|
+
$desc.renderItem ? item.renderContent($desc.renderItem) : null;
|
|
48
|
+
|
|
49
|
+
return item.nd.onClick(() => {
|
|
50
|
+
const desc = item.$description;
|
|
51
|
+
const emittedValue = desc.data ?? desc.value ?? desc;
|
|
52
|
+
|
|
53
|
+
instance.emit('itemClick', item, emittedValue);
|
|
54
|
+
instance.emit('change', emittedValue);
|
|
55
|
+
|
|
56
|
+
if($desc.closeOnSelect) {
|
|
57
|
+
instance.close();
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
})
|
|
61
|
+
);
|
|
62
|
+
content.push(itemsContainer);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
return content;
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
const buildSearch = ($desc, instance) => {
|
|
69
|
+
if(!$desc.filter) {
|
|
70
|
+
$desc.filter = (item, key) => {
|
|
71
|
+
const description = item.$description;
|
|
72
|
+
if(!description) {
|
|
73
|
+
const content = item.content ?? item.label ?? item.label;
|
|
74
|
+
const value = item.value;
|
|
75
|
+
|
|
76
|
+
return content?.toLowerCase().includes(key.toLowerCase())
|
|
77
|
+
|| value?.toLowerCase().includes(key.toLowerCase());
|
|
78
|
+
}
|
|
79
|
+
return description.value?.toLowerCase().includes(key.toLowerCase())
|
|
80
|
+
|| description.content?.toLowerCase().includes(key.toLowerCase());
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
return Div({class: 'dropdown-search'},
|
|
85
|
+
Input({
|
|
86
|
+
class: 'dropdown-search-input',
|
|
87
|
+
type: 'text',
|
|
88
|
+
placeholder: $desc.searchPlaceholder || 'Search...',
|
|
89
|
+
value: $desc.searchValue,
|
|
90
|
+
}).nd.onInput((e) => instance.emit('search', e.target.value))
|
|
91
|
+
);
|
|
92
|
+
};
|
|
File without changes
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
--dropdown-bg: var(--background);
|
|
3
|
+
--dropdown-border: var(--gray-lite-3);
|
|
4
|
+
--dropdown-radius: var(--radius-card);
|
|
5
|
+
--dropdown-shadow: var(--shadow-lg);
|
|
6
|
+
--dropdown-min-width: 180px;
|
|
7
|
+
--dropdown-max-width: 320px;
|
|
8
|
+
--dropdown-z-index: 100001;
|
|
9
|
+
--dropdown-font-size: var(--description-size);
|
|
10
|
+
--dropdown-animation-duration: 0.15s;
|
|
11
|
+
--dropdown-arrow-size: 8px;
|
|
12
|
+
|
|
13
|
+
--dropdown-item-padding: var(--space-cozy) var(--space-comfortable);
|
|
14
|
+
--dropdown-item-radius: var(--radius-button);
|
|
15
|
+
--dropdown-item-gap: var(--space-cozy);
|
|
16
|
+
--dropdown-item-color: var(--text-color);
|
|
17
|
+
--dropdown-item-color-hover: var(--text-color);
|
|
18
|
+
--dropdown-item-bg-hover: var(--gray-lite-5);
|
|
19
|
+
--dropdown-item-bg-active: var(--gray-lite-4);
|
|
20
|
+
--dropdown-item-color-disabled: var(--gray-lite-2);
|
|
21
|
+
|
|
22
|
+
--dropdown-group-label-size: var(--note-size);
|
|
23
|
+
--dropdown-group-label-color: var(--gray);
|
|
24
|
+
--dropdown-group-label-padding: var(--space-cozy) var(--space-comfortable);
|
|
25
|
+
|
|
26
|
+
--dropdown-search-padding: var(--space-cozy) var(--space-comfortable);
|
|
27
|
+
--dropdown-search-border: var(--gray-lite-3);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.dropdown {
|
|
31
|
+
position: absolute;
|
|
32
|
+
z-index: var(--dropdown-z-index);
|
|
33
|
+
background: var(--dropdown-bg);
|
|
34
|
+
border: 1px solid var(--dropdown-border);
|
|
35
|
+
border-radius: var(--dropdown-radius);
|
|
36
|
+
box-shadow: var(--dropdown-shadow);
|
|
37
|
+
min-width: var(--dropdown-min-width);
|
|
38
|
+
max-width: var(--dropdown-max-width);
|
|
39
|
+
font-size: var(--dropdown-font-size);
|
|
40
|
+
box-sizing: border-box;
|
|
41
|
+
margin: 0;
|
|
42
|
+
padding: var(--space-cozy) 0;
|
|
43
|
+
inset: unset;
|
|
44
|
+
overflow: hidden;
|
|
45
|
+
|
|
46
|
+
&:popover-open {
|
|
47
|
+
animation: dropdown-in var(--dropdown-animation-duration) ease forwards;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
&.has-max-height {
|
|
51
|
+
overflow-y: auto;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.dropdown-search {
|
|
56
|
+
padding: var(--dropdown-search-padding);
|
|
57
|
+
border-bottom: 1px solid var(--dropdown-search-border);
|
|
58
|
+
|
|
59
|
+
input {
|
|
60
|
+
width: 100%;
|
|
61
|
+
border: none;
|
|
62
|
+
outline: none;
|
|
63
|
+
background: none;
|
|
64
|
+
font-size: var(--dropdown-font-size);
|
|
65
|
+
color: var(--text-color);
|
|
66
|
+
font-family: var(--font);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.dropdown-header {
|
|
71
|
+
padding: var(--dropdown-group-label-padding);
|
|
72
|
+
border-bottom: 1px solid var(--dropdown-border);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.dropdown-footer {
|
|
76
|
+
padding: var(--dropdown-group-label-padding);
|
|
77
|
+
border-top: 1px solid var(--dropdown-border);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.dropdown-item {
|
|
81
|
+
display: flex;
|
|
82
|
+
align-items: center;
|
|
83
|
+
gap: var(--dropdown-item-gap);
|
|
84
|
+
padding: var(--dropdown-item-padding);
|
|
85
|
+
color: var(--dropdown-item-color);
|
|
86
|
+
cursor: pointer;
|
|
87
|
+
border-radius: var(--dropdown-item-radius);
|
|
88
|
+
margin: 0 var(--space-cozy);
|
|
89
|
+
box-sizing: border-box;
|
|
90
|
+
user-select: none;
|
|
91
|
+
transition: background 0.1s ease;
|
|
92
|
+
|
|
93
|
+
&:hover {
|
|
94
|
+
background: var(--dropdown-item-bg-hover);
|
|
95
|
+
color: var(--dropdown-item-color-hover);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
&:active {
|
|
99
|
+
background: var(--dropdown-item-bg-active);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
&.is-disabled {
|
|
103
|
+
color: var(--dropdown-item-color-disabled);
|
|
104
|
+
cursor: not-allowed;
|
|
105
|
+
pointer-events: none;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
&.is-selected {
|
|
109
|
+
background: color-mix(in srgb, var(--color-primary) 8%, transparent);
|
|
110
|
+
color: var(--color-primary);
|
|
111
|
+
font-weight: 500;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
&.is-active {
|
|
115
|
+
background: var(--dropdown-item-bg-hover);
|
|
116
|
+
font-weight: 500;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.dropdown-item-icon {
|
|
121
|
+
display: inline-flex;
|
|
122
|
+
align-items: center;
|
|
123
|
+
flex-shrink: 0;
|
|
124
|
+
width: 16px;
|
|
125
|
+
height: 16px;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.dropdown-item-label {
|
|
129
|
+
flex: 1;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.dropdown-item-shortcut {
|
|
133
|
+
font-size: var(--note-size);
|
|
134
|
+
color: var(--gray);
|
|
135
|
+
margin-left: auto;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.dropdown-group-label {
|
|
139
|
+
padding: var(--dropdown-group-label-padding);
|
|
140
|
+
font-size: var(--dropdown-group-label-size);
|
|
141
|
+
color: var(--dropdown-group-label-color);
|
|
142
|
+
font-weight: 500;
|
|
143
|
+
text-transform: uppercase;
|
|
144
|
+
letter-spacing: 0.04em;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.dropdown-divider {
|
|
148
|
+
height: 1px;
|
|
149
|
+
background: var(--dropdown-border);
|
|
150
|
+
margin: var(--space-cozy) 0;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
.dropdown-trigger {
|
|
154
|
+
display: inline-flex;
|
|
155
|
+
align-items: center;
|
|
156
|
+
gap: var(--space-cozy);
|
|
157
|
+
cursor: pointer;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.dropdown-trigger-chevron {
|
|
161
|
+
display: inline-flex;
|
|
162
|
+
align-items: center;
|
|
163
|
+
transition: transform 0.2s ease;
|
|
164
|
+
|
|
165
|
+
&.is-open {
|
|
166
|
+
transform: rotate(180deg);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
@keyframes dropdown-in {
|
|
171
|
+
from {
|
|
172
|
+
opacity: 0;
|
|
173
|
+
transform: scale(0.97) translateY(-4px);
|
|
174
|
+
}
|
|
175
|
+
to {
|
|
176
|
+
opacity: 1;
|
|
177
|
+
transform: scale(1) translateY(0);
|
|
178
|
+
}
|
|
179
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
|
|
2
|
+
import {Div, ForEachArray} from '../../../../core/elements';
|
|
3
|
+
|
|
4
|
+
export default function DropdownGroupRender($desc, instance) {
|
|
5
|
+
const props = instance.getEditableProps();
|
|
6
|
+
props.class.add('dropdown-group');
|
|
7
|
+
|
|
8
|
+
const content = [];
|
|
9
|
+
|
|
10
|
+
if($desc.content) {
|
|
11
|
+
content.push(Div({class: 'dropdown-group-label'}, $desc.content));
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const items = $desc.filter ? $desc.items.where($desc.filter) : $desc.items;
|
|
15
|
+
|
|
16
|
+
content.push(
|
|
17
|
+
Div({class: 'dropdown-group-items'},
|
|
18
|
+
ForEachArray(items, (item) => item)
|
|
19
|
+
)
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
return Div(instance.resolveProps(), content);
|
|
23
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import {Div, Span} from "../../../../core/elements";
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
export default function DropdownItemRender($desc, instance) {
|
|
5
|
+
const props = instance.getEditableProps();
|
|
6
|
+
|
|
7
|
+
props.class.add('dropdown-item');
|
|
8
|
+
// props.class.add({ 'is-disabled': $desc.disabled, 'is-selected': $desc.selected });
|
|
9
|
+
|
|
10
|
+
const content = [];
|
|
11
|
+
if($desc.renderContent) {
|
|
12
|
+
content.push($desc.renderContent($desc, instance));
|
|
13
|
+
} else {
|
|
14
|
+
if($desc.icon) {
|
|
15
|
+
content.push(Span({ class: 'dropdown-item-icon' }, $desc.icon));
|
|
16
|
+
}
|
|
17
|
+
content.push(Span({ class: 'dropdown-item-label' }, $desc.content));
|
|
18
|
+
if($desc.shortcut) {
|
|
19
|
+
content.push(Span({ class: 'dropdown-item-shortcut' }, $desc.shortcut));
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const el = Div(instance.resolveProps(), content);
|
|
24
|
+
el.nd.onClick(() => {
|
|
25
|
+
$desc.action && $desc.action($desc.data || $desc.value || $desc);
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
return el;
|
|
29
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import {Div, Button, ForEachArray} from '../../../../elements';
|
|
2
|
+
import { $ } from '../../../../index';
|
|
3
|
+
|
|
4
|
+
import './field-collection.css';
|
|
5
|
+
|
|
6
|
+
export default function FieldCollectionRender($desc, instance) {
|
|
7
|
+
const props = instance.getEditableProps();
|
|
8
|
+
|
|
9
|
+
props.class.add('field-collection');
|
|
10
|
+
|
|
11
|
+
const $items = $desc.value;
|
|
12
|
+
const $itemsMap = new WeakMap();
|
|
13
|
+
|
|
14
|
+
const buildItemFields = (item) => {
|
|
15
|
+
if(!$desc.fieldBuilder) return {};
|
|
16
|
+
const fields = $desc.fieldBuilder();
|
|
17
|
+
|
|
18
|
+
// Binder chaque field à la propriété correspondante de l'item
|
|
19
|
+
Object.entries(fields).forEach(([key, field]) => {
|
|
20
|
+
const prop = item[key];
|
|
21
|
+
if(prop?.__$isObservable) {
|
|
22
|
+
field.model(prop);
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
return fields;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
const buildActions = (item, $index) => {
|
|
30
|
+
const $isFirst = $index.transform(i => i === 0);
|
|
31
|
+
const $isLast = $.computed(() => ($index.val() === $items.val().length - 1), [$index, $items]);
|
|
32
|
+
|
|
33
|
+
return {
|
|
34
|
+
index: $index,
|
|
35
|
+
isFirst: $isFirst,
|
|
36
|
+
isLast: $isLast,
|
|
37
|
+
item,
|
|
38
|
+
remove: () => {
|
|
39
|
+
instance.removeItem(item);
|
|
40
|
+
},
|
|
41
|
+
moveUp: () => {
|
|
42
|
+
const i = $items.indexOf(item);
|
|
43
|
+
if(i <= 0) {
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
$items.swap(i-1, i);
|
|
47
|
+
},
|
|
48
|
+
moveDown: () => {
|
|
49
|
+
const i = $items.indexOf(item);
|
|
50
|
+
if(i >= $items.length - 1) {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
$items.swap(i, i+1);
|
|
54
|
+
},
|
|
55
|
+
duplicate: () => {
|
|
56
|
+
const newItem = item.clone();
|
|
57
|
+
$items.push(newItem);
|
|
58
|
+
instance.emit('add', newItem);
|
|
59
|
+
},
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
const buildItem = (item, $index) => {
|
|
64
|
+
if(!$itemsMap.has(item)) {
|
|
65
|
+
const fields = buildItemFields(item);
|
|
66
|
+
const actions = buildActions(item, $index);
|
|
67
|
+
$itemsMap.set(item, { fields, actions });
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
const { fields, actions } = $itemsMap.get(item);
|
|
71
|
+
|
|
72
|
+
let el;
|
|
73
|
+
if($desc.renderItem) {
|
|
74
|
+
el = $desc.renderItem(fields, actions);
|
|
75
|
+
} else {
|
|
76
|
+
el = Div({class: 'field-collection-item'}, [
|
|
77
|
+
...Object.values(fields),
|
|
78
|
+
Button('×')
|
|
79
|
+
.small()
|
|
80
|
+
.danger()
|
|
81
|
+
.nd
|
|
82
|
+
.onClick(actions.remove),
|
|
83
|
+
]);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
if($desc.transition) {
|
|
87
|
+
el.nd.transition($desc.transition);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
return el;
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
const buildAddButton = () => {
|
|
94
|
+
if(!$desc.renderAdd) {
|
|
95
|
+
return null;
|
|
96
|
+
}
|
|
97
|
+
return Div({ class: 'field-collection-actions'},
|
|
98
|
+
$desc.renderAdd()
|
|
99
|
+
.nd
|
|
100
|
+
.onClick(() => instance.add())
|
|
101
|
+
);
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
return Div(instance.resolveProps(), [
|
|
105
|
+
Div({class: 'field-collection-list'},
|
|
106
|
+
ForEachArray($items, buildItem)
|
|
107
|
+
),
|
|
108
|
+
buildAddButton(),
|
|
109
|
+
]);
|
|
110
|
+
}
|