@nocobase/client 0.7.6-alpha.2 → 0.8.0-alpha.10
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/es/acl/ACLShortcut.d.ts +2 -0
- package/es/acl/ACLShortcut.js +31 -2
- package/es/api-client/APIClient.d.ts +1 -0
- package/es/api-client/APIClient.js +6 -1
- package/es/application/Application.d.ts +3 -1
- package/es/application/Application.js +131 -39
- package/es/block-provider/BlockProvider.js +12 -1
- package/es/block-provider/CalendarBlockProvider.d.ts +1 -0
- package/es/block-provider/CalendarBlockProvider.js +6 -3
- package/es/block-provider/TableSelectorProvider.js +21 -6
- package/es/block-provider/hooks/index.d.ts +6 -0
- package/es/block-provider/hooks/index.js +485 -115
- package/es/collection-manager/CollectionManagerProvider.js +26 -45
- package/es/collection-manager/CollectionManagerShortcut.d.ts +2 -0
- package/es/collection-manager/CollectionManagerShortcut.js +38 -3
- package/es/collection-manager/Configuration/AddFieldAction.d.ts +5 -1
- package/es/collection-manager/Configuration/AddFieldAction.js +48 -13
- package/es/collection-manager/Configuration/CollectionFieldsTable.d.ts +15 -0
- package/es/collection-manager/Configuration/CollectionFieldsTable.js +73 -0
- package/es/collection-manager/Configuration/CollectionFieldsTableArray.d.ts +8 -0
- package/es/collection-manager/Configuration/CollectionFieldsTableArray.js +250 -0
- package/es/collection-manager/Configuration/ConfigurationTable.js +6 -2
- package/es/collection-manager/Configuration/EditFieldAction.d.ts +1 -0
- package/es/collection-manager/Configuration/EditFieldAction.js +24 -11
- package/es/collection-manager/Configuration/index.d.ts +3 -0
- package/es/collection-manager/Configuration/index.js +3 -0
- package/es/collection-manager/Configuration/schemas/collectionFields.js +4 -4
- package/es/collection-manager/Configuration/schemas/collections.js +1 -1
- package/es/collection-manager/index.d.ts +1 -0
- package/es/collection-manager/index.js +2 -1
- package/es/collection-manager/interfaces/index.d.ts +1 -0
- package/es/collection-manager/interfaces/index.js +1 -0
- package/es/collection-manager/interfaces/json.d.ts +2 -0
- package/es/collection-manager/interfaces/json.js +48 -0
- package/es/collection-manager/interfaces/m2o.js +3 -3
- package/es/collection-manager/interfaces/o2m.js +5 -6
- package/es/collection-manager/interfaces/o2o.js +5 -5
- package/es/collection-manager/interfaces/properties/index.d.ts +14 -0
- package/es/collection-manager/interfaces/properties/index.js +24 -1
- package/es/collection-manager/interfaces/sequence.js +13 -9
- package/es/index.d.ts +1 -0
- package/es/index.js +1 -0
- package/es/locale/en_US.d.ts +24 -1
- package/es/locale/en_US.js +25 -2
- package/es/locale/ja_JP.d.ts +2 -1
- package/es/locale/ja_JP.js +2 -1
- package/es/locale/ru_RU.d.ts +2 -1
- package/es/locale/ru_RU.js +2 -1
- package/es/locale/tr_TR.d.ts +1 -1
- package/es/locale/tr_TR.js +1 -1
- package/es/locale/zh_CN.d.ts +50 -1
- package/es/locale/zh_CN.js +51 -2
- package/es/plugin-manager/PluginManager.js +35 -23
- package/es/pm/PluginManagerLink.d.ts +2 -0
- package/es/pm/PluginManagerLink.js +112 -0
- package/es/pm/index.d.ts +6 -0
- package/es/pm/index.js +422 -0
- package/es/route-switch/antd/admin-layout/index.js +1 -1
- package/es/schema-component/antd/action/Action.Designer.js +35 -12
- package/es/schema-component/antd/action/Action.Modal.js +4 -2
- package/es/schema-component/antd/action/Action.js +3 -3
- package/es/schema-component/antd/action/context.d.ts +2 -0
- package/es/schema-component/antd/action/hooks.d.ts +1 -0
- package/es/schema-component/antd/calendar/Calendar.Designer.js +19 -6
- package/es/schema-component/antd/calendar/Calendar.js +137 -23
- package/es/schema-component/antd/calendar/DeleteEvent.d.ts +3 -0
- package/es/schema-component/antd/calendar/DeleteEvent.js +147 -0
- package/es/schema-component/antd/calendar/Title.js +18 -3
- package/es/schema-component/antd/calendar/components/Header.d.ts +10 -0
- package/es/schema-component/antd/calendar/components/Header.js +43 -0
- package/es/schema-component/antd/calendar/index.js +2 -0
- package/es/schema-component/antd/calendar/style.less +53 -9
- package/es/schema-component/antd/calendar/types.d.ts +6 -0
- package/es/schema-component/antd/calendar/utils.d.ts +2 -0
- package/es/schema-component/antd/calendar/utils.js +7 -0
- package/es/schema-component/antd/checkbox/Checkbox.js +13 -4
- package/es/schema-component/antd/formula-input/FormulaInput.js +28 -37
- package/es/schema-component/antd/input/Input.d.ts +1 -0
- package/es/schema-component/antd/input/Input.js +2 -0
- package/es/schema-component/antd/input/Json.d.ts +6 -0
- package/es/schema-component/antd/input/Json.js +41 -0
- package/es/schema-component/antd/input/ReadPretty.d.ts +3 -0
- package/es/schema-component/antd/input/ReadPretty.js +15 -0
- package/es/schema-component/antd/input/index.d.ts +1 -0
- package/es/schema-component/antd/input/index.js +2 -1
- package/es/schema-component/antd/markdown/Markdown.Void.js +5 -2
- package/es/schema-component/antd/radio/Radio.js +2 -1
- package/es/schema-component/antd/select/ReadPretty.js +2 -1
- package/es/schema-component/antd/select/Select.js +25 -1
- package/es/schema-component/antd/table-v2/TableSelectorDesigner.js +16 -2
- package/es/schema-component/antd/upload/Upload.js +2 -1
- package/es/schema-component/antd/upload/shared.js +5 -6
- package/es/schema-component/antd/upload/type.d.ts +2 -0
- package/es/schema-initializer/buttons/BulkEditFormItemInitializers.d.ts +1 -0
- package/es/schema-initializer/buttons/BulkEditFormItemInitializers.js +50 -0
- package/es/schema-initializer/buttons/CalendarFormActionInitializers.d.ts +143 -0
- package/es/schema-initializer/buttons/CalendarFormActionInitializers.js +146 -0
- package/es/schema-initializer/buttons/CreateFormBulkEditBlockInitializers.d.ts +1 -0
- package/es/schema-initializer/buttons/CreateFormBulkEditBlockInitializers.js +35 -0
- package/es/schema-initializer/buttons/FormActionInitializers.d.ts +132 -0
- package/es/schema-initializer/buttons/FormActionInitializers.js +118 -0
- package/es/schema-initializer/buttons/RecordBlockInitializers.js +2 -1
- package/es/schema-initializer/buttons/TabPaneInitializers.d.ts +1 -0
- package/es/schema-initializer/buttons/TabPaneInitializers.js +13 -0
- package/es/schema-initializer/buttons/TableActionInitializers.d.ts +56 -2
- package/es/schema-initializer/buttons/TableActionInitializers.js +45 -0
- package/es/schema-initializer/buttons/index.d.ts +3 -0
- package/es/schema-initializer/buttons/index.js +3 -0
- package/es/schema-initializer/components/BulkEditField.d.ts +7 -0
- package/es/schema-initializer/components/BulkEditField.js +187 -0
- package/es/schema-initializer/components/index.d.ts +1 -0
- package/es/schema-initializer/components/index.js +2 -1
- package/es/schema-initializer/items/BlockInitializer.js +8 -8
- package/es/schema-initializer/items/BulkEditSubmitActionInitializer.d.ts +1 -0
- package/es/schema-initializer/items/BulkEditSubmitActionInitializer.js +24 -0
- package/es/schema-initializer/items/CreateFormBulkEditBlockInitializer.d.ts +1 -0
- package/es/schema-initializer/items/CreateFormBulkEditBlockInitializer.js +103 -0
- package/es/schema-initializer/items/CustomizeBulkEditActionInitializer.d.ts +1 -0
- package/es/schema-initializer/items/CustomizeBulkEditActionInitializer.js +61 -0
- package/es/schema-initializer/items/DeleteEventActionInitializer.d.ts +1 -0
- package/es/schema-initializer/items/DeleteEventActionInitializer.js +27 -0
- package/es/schema-initializer/items/RecordReadPrettyFormBlockInitializer.js +7 -7
- package/es/schema-initializer/items/index.d.ts +4 -0
- package/es/schema-initializer/items/index.js +4 -0
- package/es/schema-initializer/utils.d.ts +1 -0
- package/es/schema-initializer/utils.js +74 -15
- package/es/schema-settings/SchemaSettings.d.ts +6 -0
- package/es/schema-settings/SchemaSettings.js +4 -1
- package/es/schema-templates/BlockTemplatePage.d.ts +1 -0
- package/es/schema-templates/BlockTemplatePage.js +7 -0
- package/es/schema-templates/SchemaTemplateShortcut.js +1 -1
- package/es/system-settings/SystemSettingsShortcut.d.ts +2 -0
- package/es/system-settings/SystemSettingsShortcut.js +134 -5
- package/lib/acl/ACLShortcut.d.ts +2 -0
- package/lib/acl/ACLShortcut.js +41 -4
- package/lib/api-client/APIClient.d.ts +1 -0
- package/lib/api-client/APIClient.js +6 -1
- package/lib/application/Application.d.ts +3 -1
- package/lib/application/Application.js +139 -39
- package/lib/block-provider/BlockProvider.js +11 -0
- package/lib/block-provider/CalendarBlockProvider.d.ts +1 -0
- package/lib/block-provider/CalendarBlockProvider.js +6 -3
- package/lib/block-provider/TableSelectorProvider.js +21 -6
- package/lib/block-provider/hooks/index.d.ts +6 -0
- package/lib/block-provider/hooks/index.js +496 -115
- package/lib/collection-manager/CollectionManagerProvider.js +28 -47
- package/lib/collection-manager/CollectionManagerShortcut.d.ts +2 -0
- package/lib/collection-manager/CollectionManagerShortcut.js +47 -4
- package/lib/collection-manager/Configuration/AddFieldAction.d.ts +5 -1
- package/lib/collection-manager/Configuration/AddFieldAction.js +52 -12
- package/lib/collection-manager/Configuration/CollectionFieldsTable.d.ts +15 -0
- package/lib/collection-manager/Configuration/CollectionFieldsTable.js +92 -0
- package/lib/collection-manager/Configuration/CollectionFieldsTableArray.d.ts +8 -0
- package/lib/collection-manager/Configuration/CollectionFieldsTableArray.js +273 -0
- package/lib/collection-manager/Configuration/ConfigurationTable.js +7 -2
- package/lib/collection-manager/Configuration/EditFieldAction.d.ts +1 -0
- package/lib/collection-manager/Configuration/EditFieldAction.js +26 -10
- package/lib/collection-manager/Configuration/index.d.ts +3 -0
- package/lib/collection-manager/Configuration/index.js +39 -0
- package/lib/collection-manager/Configuration/schemas/collectionFields.js +4 -4
- package/lib/collection-manager/Configuration/schemas/collections.js +1 -1
- package/lib/collection-manager/index.d.ts +1 -0
- package/lib/collection-manager/index.js +14 -0
- package/lib/collection-manager/interfaces/index.d.ts +1 -0
- package/lib/collection-manager/interfaces/index.js +13 -0
- package/lib/collection-manager/interfaces/json.d.ts +2 -0
- package/lib/collection-manager/interfaces/json.js +58 -0
- package/lib/collection-manager/interfaces/m2o.js +2 -2
- package/lib/collection-manager/interfaces/o2m.js +4 -5
- package/lib/collection-manager/interfaces/o2o.js +4 -4
- package/lib/collection-manager/interfaces/properties/index.d.ts +14 -0
- package/lib/collection-manager/interfaces/properties/index.js +26 -2
- package/lib/collection-manager/interfaces/sequence.js +13 -9
- package/lib/index.d.ts +1 -0
- package/lib/index.js +13 -0
- package/lib/locale/en_US.d.ts +24 -1
- package/lib/locale/en_US.js +25 -2
- package/lib/locale/ja_JP.d.ts +2 -1
- package/lib/locale/ja_JP.js +2 -1
- package/lib/locale/ru_RU.d.ts +2 -1
- package/lib/locale/ru_RU.js +2 -1
- package/lib/locale/tr_TR.d.ts +1 -1
- package/lib/locale/tr_TR.js +1 -1
- package/lib/locale/zh_CN.d.ts +50 -1
- package/lib/locale/zh_CN.js +51 -2
- package/lib/plugin-manager/PluginManager.js +33 -21
- package/lib/pm/PluginManagerLink.d.ts +2 -0
- package/lib/pm/PluginManagerLink.js +139 -0
- package/lib/pm/index.d.ts +6 -0
- package/lib/pm/index.js +476 -0
- package/lib/route-switch/antd/admin-layout/index.js +1 -1
- package/lib/schema-component/antd/action/Action.Designer.js +35 -12
- package/lib/schema-component/antd/action/Action.Modal.js +4 -2
- package/lib/schema-component/antd/action/Action.js +3 -3
- package/lib/schema-component/antd/action/context.d.ts +2 -0
- package/lib/schema-component/antd/action/hooks.d.ts +1 -0
- package/lib/schema-component/antd/calendar/Calendar.Designer.js +19 -6
- package/lib/schema-component/antd/calendar/Calendar.js +139 -23
- package/lib/schema-component/antd/calendar/DeleteEvent.d.ts +3 -0
- package/lib/schema-component/antd/calendar/DeleteEvent.js +173 -0
- package/lib/schema-component/antd/calendar/Title.js +18 -2
- package/lib/schema-component/antd/calendar/components/Header.d.ts +10 -0
- package/lib/schema-component/antd/calendar/components/Header.js +57 -0
- package/lib/schema-component/antd/calendar/index.js +5 -0
- package/lib/schema-component/antd/calendar/style.less +53 -9
- package/lib/schema-component/antd/calendar/types.d.ts +6 -0
- package/lib/schema-component/antd/calendar/utils.d.ts +2 -0
- package/lib/schema-component/antd/calendar/utils.js +18 -2
- package/lib/schema-component/antd/checkbox/Checkbox.js +13 -4
- package/lib/schema-component/antd/formula-input/FormulaInput.js +28 -37
- package/lib/schema-component/antd/input/Input.d.ts +1 -0
- package/lib/schema-component/antd/input/Input.js +3 -0
- package/lib/schema-component/antd/input/Json.d.ts +6 -0
- package/lib/schema-component/antd/input/Json.js +53 -0
- package/lib/schema-component/antd/input/ReadPretty.d.ts +3 -0
- package/lib/schema-component/antd/input/ReadPretty.js +16 -0
- package/lib/schema-component/antd/input/index.d.ts +1 -0
- package/lib/schema-component/antd/input/index.js +13 -0
- package/lib/schema-component/antd/markdown/Markdown.Void.js +8 -2
- package/lib/schema-component/antd/radio/Radio.js +2 -1
- package/lib/schema-component/antd/select/ReadPretty.js +2 -1
- package/lib/schema-component/antd/select/Select.js +25 -1
- package/lib/schema-component/antd/table-v2/TableSelectorDesigner.js +17 -2
- package/lib/schema-component/antd/upload/Upload.js +2 -1
- package/lib/schema-component/antd/upload/shared.js +4 -5
- package/lib/schema-component/antd/upload/type.d.ts +2 -0
- package/lib/schema-initializer/buttons/BulkEditFormItemInitializers.d.ts +1 -0
- package/lib/schema-initializer/buttons/BulkEditFormItemInitializers.js +66 -0
- package/lib/schema-initializer/buttons/CalendarFormActionInitializers.d.ts +143 -0
- package/lib/schema-initializer/buttons/CalendarFormActionInitializers.js +153 -0
- package/lib/schema-initializer/buttons/CreateFormBulkEditBlockInitializers.d.ts +1 -0
- package/lib/schema-initializer/buttons/CreateFormBulkEditBlockInitializers.js +50 -0
- package/lib/schema-initializer/buttons/FormActionInitializers.d.ts +132 -0
- package/lib/schema-initializer/buttons/FormActionInitializers.js +121 -2
- package/lib/schema-initializer/buttons/RecordBlockInitializers.js +2 -1
- package/lib/schema-initializer/buttons/TabPaneInitializers.d.ts +1 -0
- package/lib/schema-initializer/buttons/TabPaneInitializers.js +18 -2
- package/lib/schema-initializer/buttons/TableActionInitializers.d.ts +56 -2
- package/lib/schema-initializer/buttons/TableActionInitializers.js +45 -0
- package/lib/schema-initializer/buttons/index.d.ts +3 -0
- package/lib/schema-initializer/buttons/index.js +39 -0
- package/lib/schema-initializer/components/BulkEditField.d.ts +7 -0
- package/lib/schema-initializer/components/BulkEditField.js +210 -0
- package/lib/schema-initializer/components/index.d.ts +1 -0
- package/lib/schema-initializer/components/index.js +13 -0
- package/lib/schema-initializer/items/BlockInitializer.js +8 -7
- package/lib/schema-initializer/items/BulkEditSubmitActionInitializer.d.ts +1 -0
- package/lib/schema-initializer/items/BulkEditSubmitActionInitializer.js +37 -0
- package/lib/schema-initializer/items/CreateFormBulkEditBlockInitializer.d.ts +1 -0
- package/lib/schema-initializer/items/CreateFormBulkEditBlockInitializer.js +121 -0
- package/lib/schema-initializer/items/CustomizeBulkEditActionInitializer.d.ts +1 -0
- package/lib/schema-initializer/items/CustomizeBulkEditActionInitializer.js +74 -0
- package/lib/schema-initializer/items/DeleteEventActionInitializer.d.ts +1 -0
- package/lib/schema-initializer/items/DeleteEventActionInitializer.js +40 -0
- package/lib/schema-initializer/items/RecordReadPrettyFormBlockInitializer.js +1 -1
- package/lib/schema-initializer/items/index.d.ts +4 -0
- package/lib/schema-initializer/items/index.js +52 -0
- package/lib/schema-initializer/utils.d.ts +1 -0
- package/lib/schema-initializer/utils.js +78 -16
- package/lib/schema-settings/SchemaSettings.d.ts +6 -0
- package/lib/schema-settings/SchemaSettings.js +3 -0
- package/lib/schema-templates/BlockTemplatePage.d.ts +1 -0
- package/lib/schema-templates/BlockTemplatePage.js +12 -2
- package/lib/schema-templates/SchemaTemplateShortcut.js +1 -1
- package/lib/system-settings/SystemSettingsShortcut.d.ts +2 -0
- package/lib/system-settings/SystemSettingsShortcut.js +145 -7
- package/package.json +6 -4
|
@@ -74,7 +74,6 @@ button.rbc-input::-moz-focus-inner {
|
|
|
74
74
|
text-overflow: ellipsis;
|
|
75
75
|
white-space: nowrap;
|
|
76
76
|
padding: 4px 12px;
|
|
77
|
-
text-align: right;
|
|
78
77
|
vertical-align: middle;
|
|
79
78
|
// font-weight: 500;
|
|
80
79
|
min-height: 32px;
|
|
@@ -338,24 +337,39 @@ button.rbc-input::-moz-focus-inner {
|
|
|
338
337
|
// cursor: pointer;
|
|
339
338
|
flex: 1 1 0;
|
|
340
339
|
min-width: 0;
|
|
341
|
-
padding-
|
|
340
|
+
padding-left: 12px;
|
|
342
341
|
padding-top: 4px;
|
|
343
|
-
text-align: right;
|
|
344
342
|
}
|
|
345
|
-
.rbc-date-cell.rbc-now
|
|
343
|
+
.rbc-date-cell.rbc-now span {
|
|
346
344
|
// font-weight: bold;
|
|
347
345
|
color: #1890ff;
|
|
348
346
|
}
|
|
349
|
-
.rbc-date-cell
|
|
350
|
-
.rbc-date-cell
|
|
351
|
-
.rbc-date-cell
|
|
347
|
+
.rbc-date-cell a,
|
|
348
|
+
.rbc-date-cell a:active,
|
|
349
|
+
.rbc-date-cell a:visited {
|
|
352
350
|
color: inherit;
|
|
353
351
|
text-decoration: none;
|
|
354
352
|
}
|
|
355
|
-
.rbc-date-cell
|
|
353
|
+
.rbc-date-cell a:hover {
|
|
356
354
|
color: #1890ff;
|
|
357
355
|
}
|
|
358
356
|
|
|
357
|
+
.rbc-date-cell .rbc-date-solar {
|
|
358
|
+
font-weight: 500;
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
.rbc-date-cell .rbc-date-lunar {
|
|
362
|
+
padding-left: 12px;
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
.rbc-date-cell:not(.rbc-off-range) .rbc-date-lunar {
|
|
366
|
+
color: #aaa
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
.rbc-date-cell .rbc-date-lunar:hover {
|
|
370
|
+
color: inherit
|
|
371
|
+
}
|
|
372
|
+
|
|
359
373
|
.rbc-row-bg {
|
|
360
374
|
display: flex;
|
|
361
375
|
flex-direction: row;
|
|
@@ -553,6 +567,36 @@ button.rbc-input::-moz-focus-inner {
|
|
|
553
567
|
.rbc-time-header-cell {
|
|
554
568
|
min-height: 32px !important;
|
|
555
569
|
}
|
|
570
|
+
.rbc-time-header-cell .rbc-header {
|
|
571
|
+
display: flex;
|
|
572
|
+
}
|
|
573
|
+
.rbc-time-header-cell .rbc-header.rbc-today {
|
|
574
|
+
border-color: #1890ff;
|
|
575
|
+
background-color: #e6f7ff;
|
|
576
|
+
color: #1890ff
|
|
577
|
+
}
|
|
578
|
+
|
|
579
|
+
.rbc-time-header-cell .rbc-header a {
|
|
580
|
+
display: flex;
|
|
581
|
+
flex-direction: column;
|
|
582
|
+
}
|
|
583
|
+
|
|
584
|
+
.rbc-time-header-cell .rbc-date-wrap {
|
|
585
|
+
display: flex;
|
|
586
|
+
align-items: center;
|
|
587
|
+
}
|
|
588
|
+
|
|
589
|
+
.rbc-time-header-cell .rbc-date-solar {
|
|
590
|
+
font-size: 18px;
|
|
591
|
+
}
|
|
592
|
+
.rbc-time-header-cell .rbc-date-lunar {
|
|
593
|
+
margin-left: 4px;
|
|
594
|
+
}
|
|
595
|
+
|
|
596
|
+
.rbc-time-header-cell .rbc-header:not(.rbc-today) .rbc-date-lunar {
|
|
597
|
+
color: #aaa;
|
|
598
|
+
}
|
|
599
|
+
|
|
556
600
|
.rbc-calendar.view-week {
|
|
557
601
|
.rbc-time-header-cell {
|
|
558
602
|
margin-top: -32px;
|
|
@@ -695,7 +739,7 @@ button.rbc-input::-moz-focus-inner {
|
|
|
695
739
|
|
|
696
740
|
.rbc-time-header-content {
|
|
697
741
|
flex: 1;
|
|
698
|
-
display: flex;
|
|
742
|
+
// display: flex;
|
|
699
743
|
min-width: 0;
|
|
700
744
|
flex-direction: column;
|
|
701
745
|
// border-left: 1px solid #f0f0f0;
|
|
@@ -3,12 +3,18 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.toEvents = void 0;
|
|
6
|
+
exports.toEvents = exports.getLunarDay = void 0;
|
|
7
7
|
|
|
8
8
|
var _lodash = require("lodash");
|
|
9
9
|
|
|
10
|
+
var _moment = _interopRequireDefault(require("moment"));
|
|
11
|
+
|
|
12
|
+
var _solarlunarEs = _interopRequireDefault(require("solarlunar-es"));
|
|
13
|
+
|
|
10
14
|
var _i18n = require("../../../i18n");
|
|
11
15
|
|
|
16
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
|
+
|
|
12
18
|
var toEvents = function toEvents(data, fieldNames) {
|
|
13
19
|
return data === null || data === void 0 ? void 0 : data.map(function (item) {
|
|
14
20
|
return {
|
|
@@ -20,4 +26,14 @@ var toEvents = function toEvents(data, fieldNames) {
|
|
|
20
26
|
});
|
|
21
27
|
};
|
|
22
28
|
|
|
23
|
-
exports.toEvents = toEvents;
|
|
29
|
+
exports.toEvents = toEvents;
|
|
30
|
+
|
|
31
|
+
var getLunarDay = function getLunarDay(date) {
|
|
32
|
+
var md = (0, _moment.default)(date);
|
|
33
|
+
|
|
34
|
+
var result = _solarlunarEs.default.solar2lunar(md.year(), md.month() + 1, md.date());
|
|
35
|
+
|
|
36
|
+
return typeof result !== 'number' ? result.lunarFestival || result.term || result.dayCn : result;
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
exports.getLunarDay = getLunarDay;
|
|
@@ -25,7 +25,15 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
25
25
|
|
|
26
26
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
27
27
|
|
|
28
|
-
var Checkbox = (0, _react.connect)(
|
|
28
|
+
var Checkbox = (0, _react.connect)(function (props) {
|
|
29
|
+
var changeHandler = function changeHandler(val) {
|
|
30
|
+
props === null || props === void 0 ? void 0 : props.onChange(val);
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
return /*#__PURE__*/_react2.default.createElement(_antd.Checkbox, _objectSpread(_objectSpread({}, props), {}, {
|
|
34
|
+
onChange: changeHandler
|
|
35
|
+
}));
|
|
36
|
+
}, (0, _react.mapProps)({
|
|
29
37
|
value: 'checked',
|
|
30
38
|
onInput: 'onChange'
|
|
31
39
|
}, function (props, field) {
|
|
@@ -33,7 +41,7 @@ var Checkbox = (0, _react.connect)(_antd.Checkbox, (0, _react.mapProps)({
|
|
|
33
41
|
return _objectSpread({}, props);
|
|
34
42
|
}), (0, _react.mapReadPretty)(function (props) {
|
|
35
43
|
if (!(0, _shared.isValid)(props.value)) {
|
|
36
|
-
return
|
|
44
|
+
return null;
|
|
37
45
|
}
|
|
38
46
|
|
|
39
47
|
return props.value ? /*#__PURE__*/_react2.default.createElement(_icons.CheckOutlined, {
|
|
@@ -48,7 +56,7 @@ Checkbox.Group = (0, _react.connect)(_antd.Checkbox.Group, (0, _react.mapProps)(
|
|
|
48
56
|
dataSource: 'options'
|
|
49
57
|
}), (0, _react.mapReadPretty)(function (props) {
|
|
50
58
|
if (!(0, _shared.isValid)(props.value)) {
|
|
51
|
-
return
|
|
59
|
+
return null;
|
|
52
60
|
}
|
|
53
61
|
|
|
54
62
|
var _props$options = props.options,
|
|
@@ -61,7 +69,8 @@ Checkbox.Group = (0, _react.connect)(_antd.Checkbox.Group, (0, _react.mapProps)(
|
|
|
61
69
|
}).map(function (option, key) {
|
|
62
70
|
return /*#__PURE__*/_react2.default.createElement(_antd.Tag, {
|
|
63
71
|
key: key,
|
|
64
|
-
color: option.color
|
|
72
|
+
color: option.color,
|
|
73
|
+
icon: option.icon
|
|
65
74
|
}, option.label);
|
|
66
75
|
}));
|
|
67
76
|
}));
|
|
@@ -63,13 +63,8 @@ var AntdFormulaInput = function AntdFormulaInput(props) {
|
|
|
63
63
|
|
|
64
64
|
var _useState3 = (0, _react2.useState)(null),
|
|
65
65
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
var _useState5 = (0, _react2.useState)(null),
|
|
70
|
-
_useState6 = _slicedToArray(_useState5, 2),
|
|
71
|
-
html = _useState6[0],
|
|
72
|
-
setHtml = _useState6[1];
|
|
66
|
+
html = _useState4[0],
|
|
67
|
+
setHtml = _useState4[1];
|
|
73
68
|
|
|
74
69
|
var numColumns = new Map();
|
|
75
70
|
var scope = {};
|
|
@@ -80,43 +75,38 @@ var AntdFormulaInput = function AntdFormulaInput(props) {
|
|
|
80
75
|
scope[field.name] = 1;
|
|
81
76
|
});
|
|
82
77
|
var keys = Array.from(numColumns.keys());
|
|
83
|
-
var initHtml;
|
|
84
|
-
|
|
85
|
-
if (value) {
|
|
86
|
-
initHtml = value;
|
|
87
|
-
numColumns.forEach(function (value, key) {
|
|
88
|
-
initHtml = initHtml.replaceAll(key, "<span contentEditable=\"false\" style=\"border: 1px solid #aaa; padding: 2px 5px;\">".concat(value, "</span>"));
|
|
89
|
-
});
|
|
90
|
-
}
|
|
91
|
-
|
|
92
78
|
(0, _react2.useEffect)(function () {
|
|
93
|
-
if (
|
|
94
|
-
var
|
|
79
|
+
if (value) {
|
|
80
|
+
var newHtml = value;
|
|
95
81
|
numColumns.forEach(function (value, key) {
|
|
96
|
-
|
|
82
|
+
newHtml = newHtml.replaceAll(key, "<span contentEditable=\"false\" ><input disabled=\"disabled\" style=\"width:".concat(18 * value.length, "px;max-width: 120px\" value=\"").concat(value, "\"/><span hidden>").concat(key, "</span></span>"));
|
|
97
83
|
});
|
|
84
|
+
newHtml = "".concat(newHtml, "<span style=\"padding-left: 5px\"></span>"); // set extra span for cursor focus on last position
|
|
98
85
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
86
|
+
setHtml(newHtml);
|
|
87
|
+
} else {
|
|
88
|
+
setHtml('');
|
|
102
89
|
}
|
|
103
|
-
}, [
|
|
90
|
+
}, [value]);
|
|
104
91
|
|
|
105
92
|
var menu = /*#__PURE__*/_react2.default.createElement(_antd.Menu, {
|
|
106
93
|
onClick: function () {
|
|
107
94
|
var _onClick = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(args) {
|
|
108
|
-
var replaceFormula
|
|
95
|
+
var replaceFormula;
|
|
109
96
|
return regeneratorRuntime.wrap(function _callee$(_context) {
|
|
110
97
|
while (1) {
|
|
111
98
|
switch (_context.prev = _context.next) {
|
|
112
99
|
case 0:
|
|
113
|
-
replaceFormula =
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
100
|
+
replaceFormula = field.value.replace('@', args.key);
|
|
101
|
+
|
|
102
|
+
if (onChange && replaceFormula != field.value) {
|
|
103
|
+
onChange(replaceFormula);
|
|
104
|
+
}
|
|
105
|
+
|
|
117
106
|
setDropdownVisible(false);
|
|
107
|
+
inputRef.current.focus();
|
|
118
108
|
|
|
119
|
-
case
|
|
109
|
+
case 4:
|
|
120
110
|
case "end":
|
|
121
111
|
return _context.stop();
|
|
122
112
|
}
|
|
@@ -137,12 +127,12 @@ var AntdFormulaInput = function AntdFormulaInput(props) {
|
|
|
137
127
|
}));
|
|
138
128
|
|
|
139
129
|
var handleChange = function handleChange(e) {
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
130
|
+
if (onChange) {
|
|
131
|
+
if (e.currentTarget.textContent == '') {
|
|
132
|
+
onChange(null);
|
|
133
|
+
} else {
|
|
134
|
+
onChange(e.currentTarget.textContent);
|
|
135
|
+
}
|
|
146
136
|
}
|
|
147
137
|
};
|
|
148
138
|
|
|
@@ -170,7 +160,8 @@ var AntdFormulaInput = function AntdFormulaInput(props) {
|
|
|
170
160
|
try {
|
|
171
161
|
math.evaluate(field.value, scope);
|
|
172
162
|
field.feedbacks = [];
|
|
173
|
-
} catch (
|
|
163
|
+
} catch (e) {
|
|
164
|
+
console.error(field.value, scope, e.message);
|
|
174
165
|
field.setFeedback({
|
|
175
166
|
type: 'error',
|
|
176
167
|
code: 'FormulaError',
|
|
@@ -187,7 +178,7 @@ var AntdFormulaInput = function AntdFormulaInput(props) {
|
|
|
187
178
|
className: "ant-input",
|
|
188
179
|
onChange: handleChange,
|
|
189
180
|
onKeyDown: handleKeyDown,
|
|
190
|
-
html: html ||
|
|
181
|
+
html: html || ''
|
|
191
182
|
}));
|
|
192
183
|
};
|
|
193
184
|
|
|
@@ -15,6 +15,8 @@ var _react2 = _interopRequireDefault(require("react"));
|
|
|
15
15
|
|
|
16
16
|
var _ReadPretty = require("./ReadPretty");
|
|
17
17
|
|
|
18
|
+
var _Json = require("./Json");
|
|
19
|
+
|
|
18
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
21
|
|
|
20
22
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
@@ -38,5 +40,6 @@ Input.TextArea = (0, _react.connect)(_antd.Input.TextArea, (0, _react.mapProps)(
|
|
|
38
40
|
}, props);
|
|
39
41
|
}), (0, _react.mapReadPretty)(_ReadPretty.ReadPretty.TextArea));
|
|
40
42
|
Input.URL = (0, _react.connect)(_antd.Input, (0, _react.mapReadPretty)(_ReadPretty.ReadPretty.URL));
|
|
43
|
+
Input.JSON = (0, _react.connect)(_Json.Json, (0, _react.mapReadPretty)(_ReadPretty.ReadPretty.JSON));
|
|
41
44
|
var _default = Input;
|
|
42
45
|
exports.default = _default;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.Json = Json;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
var _react2 = require("@formily/react");
|
|
11
|
+
|
|
12
|
+
var _antd = require("antd");
|
|
13
|
+
|
|
14
|
+
var _excluded = ["value", "onChange", "space"];
|
|
15
|
+
|
|
16
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
|
+
|
|
18
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
19
|
+
|
|
20
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
21
|
+
|
|
22
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
23
|
+
|
|
24
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
25
|
+
|
|
26
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
27
|
+
|
|
28
|
+
function Json(_ref) {
|
|
29
|
+
var value = _ref.value,
|
|
30
|
+
_onChange = _ref.onChange,
|
|
31
|
+
_ref$space = _ref.space,
|
|
32
|
+
space = _ref$space === void 0 ? 2 : _ref$space,
|
|
33
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
34
|
+
|
|
35
|
+
var field = (0, _react2.useField)();
|
|
36
|
+
return /*#__PURE__*/_react.default.createElement(_antd.Input.TextArea, _objectSpread(_objectSpread({}, props), {}, {
|
|
37
|
+
defaultValue: value != null ? JSON.stringify(value, null, space) : '',
|
|
38
|
+
onChange: function onChange(ev) {
|
|
39
|
+
try {
|
|
40
|
+
var v = ev.target.value.trim() !== '' ? JSON.parse(ev.target.value) : null;
|
|
41
|
+
field.setFeedback({});
|
|
42
|
+
|
|
43
|
+
_onChange(v);
|
|
44
|
+
} catch (err) {
|
|
45
|
+
field.setFeedback({
|
|
46
|
+
type: 'error',
|
|
47
|
+
code: 'JSONSyntaxError',
|
|
48
|
+
messages: [err.message]
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}));
|
|
53
|
+
}
|
|
@@ -17,8 +17,14 @@ var _EllipsisWithTooltip = require("./EllipsisWithTooltip");
|
|
|
17
17
|
|
|
18
18
|
var _shared = require("./shared");
|
|
19
19
|
|
|
20
|
+
var _css = require("@emotion/css");
|
|
21
|
+
|
|
22
|
+
var _templateObject;
|
|
23
|
+
|
|
20
24
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
25
|
|
|
26
|
+
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
27
|
+
|
|
22
28
|
var ReadPretty = function ReadPretty() {
|
|
23
29
|
return null;
|
|
24
30
|
};
|
|
@@ -115,4 +121,14 @@ ReadPretty.URL = function (props) {
|
|
|
115
121
|
className: (0, _classnames.default)(prefixCls, props.className),
|
|
116
122
|
style: props.style
|
|
117
123
|
}, props.addonBefore, props.prefix, content, props.suffix, props.addonAfter);
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
ReadPretty.JSON = function (props) {
|
|
127
|
+
var _props$space;
|
|
128
|
+
|
|
129
|
+
var prefixCls = (0, _builtins__.usePrefixCls)('json', props);
|
|
130
|
+
return /*#__PURE__*/_react.default.createElement("pre", {
|
|
131
|
+
className: (0, _css.cx)(prefixCls, props.className, (0, _css.css)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n margin-bottom: 0;\n "])))),
|
|
132
|
+
style: props.style
|
|
133
|
+
}, props.value != null ? JSON.stringify(props.value, null, (_props$space = props.space) !== null && _props$space !== void 0 ? _props$space : 2) : '');
|
|
118
134
|
};
|
|
@@ -28,4 +28,17 @@ Object.keys(_ReadPretty).forEach(function (key) {
|
|
|
28
28
|
return _ReadPretty[key];
|
|
29
29
|
}
|
|
30
30
|
});
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
var _Json = require("./Json");
|
|
34
|
+
|
|
35
|
+
Object.keys(_Json).forEach(function (key) {
|
|
36
|
+
if (key === "default" || key === "__esModule") return;
|
|
37
|
+
if (key in exports && exports[key] === _Json[key]) return;
|
|
38
|
+
Object.defineProperty(exports, key, {
|
|
39
|
+
enumerable: true,
|
|
40
|
+
get: function get() {
|
|
41
|
+
return _Json[key];
|
|
42
|
+
}
|
|
43
|
+
});
|
|
31
44
|
});
|
|
@@ -11,6 +11,8 @@ var _react = require("@formily/react");
|
|
|
11
11
|
|
|
12
12
|
var _antd = require("antd");
|
|
13
13
|
|
|
14
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
15
|
+
|
|
14
16
|
var _react2 = _interopRequireWildcard(require("react"));
|
|
15
17
|
|
|
16
18
|
var _reactI18next = require("react-i18next");
|
|
@@ -25,6 +27,8 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
25
27
|
|
|
26
28
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
27
29
|
|
|
30
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
31
|
+
|
|
28
32
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
29
33
|
|
|
30
34
|
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
@@ -93,7 +97,8 @@ var MarkdownEditor = function MarkdownEditor(props) {
|
|
|
93
97
|
};
|
|
94
98
|
|
|
95
99
|
var MarkdownVoid = (0, _react.observer)(function (props) {
|
|
96
|
-
var content = props.content
|
|
100
|
+
var content = props.content,
|
|
101
|
+
className = props.className;
|
|
97
102
|
var field = (0, _react.useField)();
|
|
98
103
|
var schema = (0, _react.useFieldSchema)();
|
|
99
104
|
|
|
@@ -103,6 +108,7 @@ var MarkdownVoid = (0, _react.observer)(function (props) {
|
|
|
103
108
|
var onSave = props.onSave,
|
|
104
109
|
_onCancel = props.onCancel;
|
|
105
110
|
return (field === null || field === void 0 ? void 0 : field.editable) ? /*#__PURE__*/_react2.default.createElement(MarkdownEditor, _objectSpread(_objectSpread({}, props), {}, {
|
|
111
|
+
className: true,
|
|
106
112
|
defaultValue: content,
|
|
107
113
|
onCancel: function onCancel() {
|
|
108
114
|
field.editable = false;
|
|
@@ -145,7 +151,7 @@ var MarkdownVoid = (0, _react.observer)(function (props) {
|
|
|
145
151
|
return onSubmit;
|
|
146
152
|
}()
|
|
147
153
|
})) : /*#__PURE__*/_react2.default.createElement("div", {
|
|
148
|
-
className: 'nb-markdown',
|
|
154
|
+
className: (0, _classnames.default)(['nb-markdown', className]),
|
|
149
155
|
dangerouslySetInnerHTML: {
|
|
150
156
|
__html: (0, _util.markdown)(content)
|
|
151
157
|
}
|
|
@@ -38,7 +38,8 @@ Radio.Group = (0, _react.connect)(_antd.Radio.Group, (0, _react.mapProps)({
|
|
|
38
38
|
}).map(function (option, key) {
|
|
39
39
|
return /*#__PURE__*/_react2.default.createElement(_antd.Tag, {
|
|
40
40
|
key: key,
|
|
41
|
-
color: option.color
|
|
41
|
+
color: option.color,
|
|
42
|
+
icon: option.icon
|
|
42
43
|
}, option.label);
|
|
43
44
|
}));
|
|
44
45
|
}));
|
|
@@ -45,7 +45,8 @@ var ReadPretty = (0, _react.observer)(function (props) {
|
|
|
45
45
|
return /*#__PURE__*/_react2.default.createElement("div", null, options.map(function (option, key) {
|
|
46
46
|
return /*#__PURE__*/_react2.default.createElement(_antd.Tag, {
|
|
47
47
|
key: key,
|
|
48
|
-
color: option[fieldNames.color]
|
|
48
|
+
color: option[fieldNames.color],
|
|
49
|
+
icon: option.icon
|
|
49
50
|
}, option[fieldNames.label]);
|
|
50
51
|
}));
|
|
51
52
|
});
|
|
@@ -80,6 +80,17 @@ var ObjectSelect = function ObjectSelect(props) {
|
|
|
80
80
|
labelInValue: true,
|
|
81
81
|
options: options,
|
|
82
82
|
fieldNames: fieldNames,
|
|
83
|
+
showSearch: true,
|
|
84
|
+
filterOption: function filterOption(input, option) {
|
|
85
|
+
var _option;
|
|
86
|
+
|
|
87
|
+
return ((_option = option === null || option === void 0 ? void 0 : option[fieldNames.label || 'label']) !== null && _option !== void 0 ? _option : '').includes(input);
|
|
88
|
+
},
|
|
89
|
+
filterSort: function filterSort(optionA, optionB) {
|
|
90
|
+
var _optionA, _optionB;
|
|
91
|
+
|
|
92
|
+
return ((_optionA = optionA === null || optionA === void 0 ? void 0 : optionA[fieldNames.label || 'label']) !== null && _optionA !== void 0 ? _optionA : '').toLowerCase().localeCompare(((_optionB = optionB === null || optionB === void 0 ? void 0 : optionB[fieldNames.label || 'label']) !== null && _optionB !== void 0 ? _optionB : '').toLowerCase());
|
|
93
|
+
},
|
|
83
94
|
onChange: function onChange(changed) {
|
|
84
95
|
var current = (0, _shared2.getCurrentOptions)((0, _shared.toArr)(changed).map(function (v) {
|
|
85
96
|
return v.value;
|
|
@@ -103,7 +114,20 @@ var Select = (0, _react.connect)(function (props) {
|
|
|
103
114
|
return /*#__PURE__*/_react2.default.createElement(ObjectSelect, _objectSpread({}, others));
|
|
104
115
|
}
|
|
105
116
|
|
|
106
|
-
return /*#__PURE__*/_react2.default.createElement(_antd.Select, _objectSpread(_objectSpread({
|
|
117
|
+
return /*#__PURE__*/_react2.default.createElement(_antd.Select, _objectSpread(_objectSpread({
|
|
118
|
+
showSearch: true,
|
|
119
|
+
filterOption: function filterOption(input, option) {
|
|
120
|
+
var _option$label;
|
|
121
|
+
|
|
122
|
+
return ((_option$label = option === null || option === void 0 ? void 0 : option.label) !== null && _option$label !== void 0 ? _option$label : '').includes(input);
|
|
123
|
+
},
|
|
124
|
+
filterSort: function filterSort(optionA, optionB) {
|
|
125
|
+
var _optionA$label, _optionB$label;
|
|
126
|
+
|
|
127
|
+
return ((_optionA$label = optionA === null || optionA === void 0 ? void 0 : optionA.label) !== null && _optionA$label !== void 0 ? _optionA$label : '').toLowerCase().localeCompare(((_optionB$label = optionB === null || optionB === void 0 ? void 0 : optionB.label) !== null && _optionB$label !== void 0 ? _optionB$label : '').toLowerCase());
|
|
128
|
+
},
|
|
129
|
+
allowClear: true
|
|
130
|
+
}, others), {}, {
|
|
107
131
|
value: others.value || undefined
|
|
108
132
|
}));
|
|
109
133
|
}, (0, _react.mapProps)({
|
|
@@ -25,6 +25,8 @@ var _schemaTemplates = require("../../../schema-templates");
|
|
|
25
25
|
|
|
26
26
|
var _hooks = require("../../hooks");
|
|
27
27
|
|
|
28
|
+
var _lodash = require("lodash");
|
|
29
|
+
|
|
28
30
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
29
31
|
|
|
30
32
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
@@ -46,7 +48,8 @@ var TableSelectorDesigner = function TableSelectorDesigner() {
|
|
|
46
48
|
var sortFields = (0, _actionHooks.useSortFields)(name);
|
|
47
49
|
|
|
48
50
|
var _useTableSelectorCont = (0, _blockProvider.useTableSelectorContext)(),
|
|
49
|
-
service = _useTableSelectorCont.service
|
|
51
|
+
service = _useTableSelectorCont.service,
|
|
52
|
+
extraFilter = _useTableSelectorCont.extraFilter;
|
|
50
53
|
|
|
51
54
|
var _useTranslation = (0, _reactI18next.useTranslation)(),
|
|
52
55
|
t = _useTranslation.t;
|
|
@@ -94,8 +97,20 @@ var TableSelectorDesigner = function TableSelectorDesigner() {
|
|
|
94
97
|
params.filter = filter;
|
|
95
98
|
field.decoratorProps.params = params;
|
|
96
99
|
fieldSchema['x-decorator-props']['params'] = params;
|
|
100
|
+
var serviceFilter = (0, _lodash.cloneDeep)(filter);
|
|
101
|
+
|
|
102
|
+
if (extraFilter) {
|
|
103
|
+
if (serviceFilter) {
|
|
104
|
+
serviceFilter = {
|
|
105
|
+
$and: [extraFilter, serviceFilter]
|
|
106
|
+
};
|
|
107
|
+
} else {
|
|
108
|
+
serviceFilter = extraFilter;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
97
112
|
service.run(_objectSpread(_objectSpread({}, (_service$params = service.params) === null || _service$params === void 0 ? void 0 : _service$params[0]), {}, {
|
|
98
|
-
filter:
|
|
113
|
+
filter: serviceFilter,
|
|
99
114
|
page: 1
|
|
100
115
|
}));
|
|
101
116
|
dn.emit('patch', {
|
|
@@ -262,9 +262,10 @@ Upload.Attachment = (0, _react.connect)(function (props) {
|
|
|
262
262
|
}));
|
|
263
263
|
}, (0, _react.mapReadPretty)(_ReadPretty.ReadPretty.Attachment));
|
|
264
264
|
Upload.Dragger = (0, _react.connect)(function (props) {
|
|
265
|
+
var tipContent = props.tipContent;
|
|
265
266
|
return /*#__PURE__*/_react2.default.createElement("div", {
|
|
266
267
|
className: (0, _builtins__.usePrefixCls)('upload-dragger')
|
|
267
|
-
}, /*#__PURE__*/_react2.default.createElement(_antd.Upload.Dragger, _objectSpread({}, (0, _shared.useUploadProps)(props))));
|
|
268
|
+
}, /*#__PURE__*/_react2.default.createElement(_antd.Upload.Dragger, _objectSpread({}, (0, _shared.useUploadProps)(props)), tipContent, props.children));
|
|
268
269
|
}, (0, _react.mapProps)({
|
|
269
270
|
value: 'fileList'
|
|
270
271
|
}));
|
|
@@ -251,9 +251,11 @@ function useUploadProps(_ref) {
|
|
|
251
251
|
(_props$onChange = props.onChange) === null || _props$onChange === void 0 ? void 0 : _props$onChange.call(props, normalizeFileList(_toConsumableArray(param.fileList)));
|
|
252
252
|
};
|
|
253
253
|
|
|
254
|
-
var form = (0, _react.useForm)();
|
|
255
254
|
var api = (0, _apiClient.useAPIClient)();
|
|
256
255
|
return _objectSpread(_objectSpread({}, props), {}, {
|
|
256
|
+
// in customRequest method can't modify form's status(e.g: form.disabled=true )
|
|
257
|
+
// that will be trigger Upload component(actual Underlying is AjaxUploader component )'s componentWillUnmount method
|
|
258
|
+
// which will cause multiple files upload fail
|
|
257
259
|
customRequest: function customRequest(_ref2) {
|
|
258
260
|
var action = _ref2.action,
|
|
259
261
|
data = _ref2.data,
|
|
@@ -273,7 +275,6 @@ function useUploadProps(_ref) {
|
|
|
273
275
|
}
|
|
274
276
|
|
|
275
277
|
formData.append(filename, file);
|
|
276
|
-
form.disabled = true;
|
|
277
278
|
api.axios.post(action, formData, {
|
|
278
279
|
withCredentials: withCredentials,
|
|
279
280
|
headers: headers,
|
|
@@ -287,9 +288,7 @@ function useUploadProps(_ref) {
|
|
|
287
288
|
}).then(function (_ref4) {
|
|
288
289
|
var data = _ref4.data;
|
|
289
290
|
onSuccess(data, file);
|
|
290
|
-
}).catch(onError).finally(function () {
|
|
291
|
-
form.disabled = false;
|
|
292
|
-
});
|
|
291
|
+
}).catch(onError).finally(function () {});
|
|
293
292
|
return {
|
|
294
293
|
abort: function abort() {
|
|
295
294
|
console.log('upload progress is aborted.');
|