@lambo-design/shared 1.0.0-beta.345 → 1.0.0-beta.349

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.
@@ -6,11 +6,77 @@
6
6
  height: 100%;
7
7
  border-radius: 4px;
8
8
  background: #ffffff;
9
+ &.mini-theme {
10
+ --input-height-table-self: 18px;
11
+ .ag-button {
12
+ .ivu-btn-small {
13
+ line-height: var(--input-height-table-self) !important;
14
+ height: var(--input-height-table-self) !important;
15
+ }
16
+ }
17
+ .ag-date {
18
+ input,
19
+ .ivu-input-suffix,
20
+ .ivu-input-prefix i,
21
+ .ivu-input-suffix i {
22
+ height: calc(var(--input-height-table-self) - 1px) !important;
23
+ line-height: calc(var(--input-height-table-self) - 1px) !important;
24
+ // top: -2px !important;
25
+ }
26
+ }
27
+ .ag-input {
28
+ input {
29
+ // text-align: right;
30
+ height: calc(var(--input-height-table-self) - 1px) !important;
31
+ line-height: calc(var(--input-height-table-self) - 1px) !important;
32
+ background-color: #dae8ff;
33
+ // top: -2px !important;
34
+ }
35
+ }
36
+ .ag-ind-select {
37
+ width: 100%;
38
+ .ivu-select-single,
39
+ .ivu-select-input,
40
+ .ivu-select-selection,
41
+ .ivu-select-selected-value,
42
+ .ivu-select-placeholder,
43
+ .ivu-select-default.ivu-select-multiple .ivu-select-selection {
44
+ width: 100%;
45
+ height: calc(var(--input-height-table-self) - 1px) !important;
46
+ min-height: calc(var(--input-height-table-self) - 1px) !important;
47
+ line-height: calc(var(--input-height-table-self) - 1px) !important;
48
+ // top: -2px !important;
49
+ }
50
+ .ivu-tag {
51
+ height: calc(var(--input-height-table-self) - 4px) !important;
52
+ line-height: calc(var(--input-height-table-self) - 4px) !important;
53
+ }
54
+ .ivu-select-selection > div .ivu-tag {
55
+ margin-top: 0 !important;
56
+ }
57
+ }
58
+ .ag-tree-select {
59
+ width: 100%;
60
+ .ivu-input-wrapper {
61
+ // top: -2px;
62
+ }
63
+ input {
64
+ width: 100%;
65
+ }
66
+ input,
67
+ .ivu-input-icon {
68
+ height: calc(var(--input-height-table-self) - 1px) !important;
69
+ min-height: calc(var(--input-height-table-self) - 1px) !important;
70
+ line-height: calc(var(--input-height-table-self) - 1px) !important;
71
+ // top: -2px !important;
72
+ }
73
+ }
74
+ }
9
75
 
10
76
  // 新主题样式
11
77
  &.new-theme {
12
78
  .new-theme-search {
13
- border: 2px solid var(--ind-search-border-color, #BD444C);
79
+ border: 2px solid var(--ind-search-border-color, #bd444c);
14
80
  //border-radius: 4px;
15
81
  margin-bottom: 10px;
16
82
  padding: 10px;
@@ -21,7 +87,7 @@
21
87
  display: block;
22
88
  height: var(--ind-search-header-height, 30px);
23
89
  line-height: var(--ind-search-header-height, 30px);
24
- background-color: var(--ind-search-border-color, #BD444C);
90
+ background-color: var(--ind-search-border-color, #bd444c);
25
91
  color: white;
26
92
  padding: 0 10px;
27
93
  margin: -10px -10px 10px -10px;
@@ -32,12 +98,14 @@
32
98
  }
33
99
 
34
100
  .black-table-wrapper {
35
- .ag-header, .ag-header-cell {
101
+ .ag-header,
102
+ .ag-header-cell {
36
103
  background-color: black !important;
37
104
  color: white !important;
38
105
  }
39
106
 
40
- .ag-header-cell-text, .ag-header-group-text {
107
+ .ag-header-cell-text,
108
+ .ag-header-group-text {
41
109
  color: white !important;
42
110
  }
43
111
 
@@ -60,7 +128,7 @@
60
128
  }
61
129
 
62
130
  .new-theme-table-wrapper {
63
- border: 2px solid var(--ind-table-border-color, #1048AF);
131
+ border: 2px solid var(--ind-table-border-color, #1048af);
64
132
  //border-radius: 4px;
65
133
  padding: 0;
66
134
  height: 100%;
@@ -73,7 +141,7 @@
73
141
  display: block;
74
142
  height: var(--ind-table-header-height, 30px);
75
143
  line-height: var(--ind-table-header-height, 30px);
76
- background-color: var(--ind-table-border-color, #1048AF);
144
+ background-color: var(--ind-table-border-color, #1048af);
77
145
  color: white;
78
146
  padding: 0 10px;
79
147
  //border-radius: 4px 4px 0 0;
@@ -85,9 +153,10 @@
85
153
  & > div {
86
154
  flex: 1;
87
155
  // 减去横条高度和边框
88
- height: calc(100% - (var(--ind-table-header-height, 30px) + 4px)); // 横条高度 + 边框
156
+ height: calc(
157
+ 100% - (var(--ind-table-header-height, 30px) + 4px)
158
+ ); // 横条高度 + 边框
89
159
  }
90
-
91
160
  }
92
161
 
93
162
  .new-theme-buttons {
@@ -104,7 +173,9 @@
104
173
  }
105
174
 
106
175
  .other-button {
107
- margin-top: var(--ind-other-button-top); // var(--ind-unit-switch-bottom); // 10px;
176
+ margin-top: var(
177
+ --ind-other-button-top
178
+ ); // var(--ind-unit-switch-bottom); // 10px;
108
179
  .ivu-btn-small {
109
180
  height: var(--ind-button-height-md);
110
181
  }
@@ -123,11 +194,17 @@
123
194
  // overflow: unset;
124
195
  // }
125
196
  // .ag-cell.ag-wrap-cell {
126
- // overflow: visible;
197
+ // overflow: visible;
127
198
  // }
128
199
 
129
- .ag-theme-balham .ag-ltr .ag-has-focus .ag-cell-focus:not(.ag-cell-range-selected),
130
- .ag-theme-balham .ag-ltr .ag-context-menu-open .ag-cell-focus:not(.ag-cell-range-selected),
200
+ .ag-theme-balham
201
+ .ag-ltr
202
+ .ag-has-focus
203
+ .ag-cell-focus:not(.ag-cell-range-selected),
204
+ .ag-theme-balham
205
+ .ag-ltr
206
+ .ag-context-menu-open
207
+ .ag-cell-focus:not(.ag-cell-range-selected),
131
208
  .ag-theme-balham
132
209
  .ag-ltr
133
210
  .ag-has-focus
@@ -135,8 +212,14 @@
135
212
  .ag-cell-wrapper.ag-row-group,
136
213
  .ag-theme-balham .ag-ltr .ag-cell-range-single-cell,
137
214
  .ag-theme-balham .ag-ltr .ag-cell-range-single-cell.ag-cell-range-handle,
138
- .ag-theme-balham .ag-rtl .ag-has-focus .ag-cell-focus:not(.ag-cell-range-selected),
139
- .ag-theme-balham .ag-rtl .ag-context-menu-open .ag-cell-focus:not(.ag-cell-range-selected),
215
+ .ag-theme-balham
216
+ .ag-rtl
217
+ .ag-has-focus
218
+ .ag-cell-focus:not(.ag-cell-range-selected),
219
+ .ag-theme-balham
220
+ .ag-rtl
221
+ .ag-context-menu-open
222
+ .ag-cell-focus:not(.ag-cell-range-selected),
140
223
  .ag-theme-balham
141
224
  .ag-rtl
142
225
  .ag-has-focus
@@ -145,7 +228,10 @@
145
228
  .ag-theme-balham .ag-rtl .ag-cell-range-single-cell,
146
229
  .ag-theme-balham .ag-rtl .ag-cell-range-single-cell.ag-cell-range-handle {
147
230
  border-right: 1px solid
148
- var(--ag-range-selection-border-color, var(--ag-balham-active-color, #0091ea)) !important;
231
+ var(
232
+ --ag-range-selection-border-color,
233
+ var(--ag-balham-active-color, #0091ea)
234
+ ) !important;
149
235
  }
150
236
 
151
237
  .ag-theme-balham .ag-ltr .ag-cell {
@@ -183,7 +269,8 @@
183
269
  box-shadow: unset !important;
184
270
  }
185
271
  .ag-button {
186
- .ivu-btn-small,.ivu-btn {
272
+ .ivu-btn-small,
273
+ .ivu-btn {
187
274
  line-height: var(--input-height-table) !important;
188
275
  height: var(--input-height-table) !important;
189
276
  }
@@ -355,9 +442,9 @@
355
442
  }
356
443
  }
357
444
 
358
- .index-manager-preset{
445
+ .index-manager-preset {
359
446
  .ag-wrapper.ag-input-wrapper.ag-checkbox-input-wrapper.ag-disabled:after {
360
- content: '\f106';
447
+ content: "\f106";
361
448
  }
362
449
  }
363
450
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lambo-design/shared",
3
- "version": "1.0.0-beta.345",
3
+ "version": "1.0.0-beta.349",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "author": "lambo",
@@ -54,8 +54,10 @@ export function enableRightClick(element = document) {
54
54
  */
55
55
  function preventRightClick(e) {
56
56
  // 统一配置读取
57
- const currentWin = e.currentTarget.ownerDocument?.defaultView || e.currentTarget;
58
- const contextMenuConfig = currentWin.contextMenu || currentWin.top?.contextMenu;
57
+ const ownerDocument = e.currentTarget.ownerDocument;
58
+ const currentWin = (ownerDocument != null ? ownerDocument.defaultView : undefined) || e.currentTarget;
59
+ const top = currentWin.top;
60
+ const contextMenuConfig = currentWin.contextMenu || (top != null ? top.contextMenu : undefined);
59
61
 
60
62
  if (contextMenuConfig !== '0') return;
61
63
 
@@ -71,8 +73,10 @@ function preventRightClick(e) {
71
73
  function preventRightClickByMouseUp(e) {
72
74
  if (e.button !== 2) return;
73
75
 
74
- const currentWin = e.currentTarget.ownerDocument?.defaultView || e.currentTarget;
75
- const contextMenuConfig = currentWin.contextMenu || currentWin.top?.contextMenu;
76
+ const ownerDocument = e.currentTarget.ownerDocument;
77
+ const currentWin = (ownerDocument != null ? ownerDocument.defaultView : undefined) || e.currentTarget;
78
+ const top = currentWin.top;
79
+ const contextMenuConfig = currentWin.contextMenu || (top != null ? top.contextMenu : undefined);
76
80
 
77
81
  if (contextMenuConfig === '0') {
78
82
  e.preventDefault();
@@ -103,7 +107,9 @@ export function enableShortcutKeys() {
103
107
 
104
108
  function preventConfiguredShortcuts(e) {
105
109
  const currentWin = e.currentTarget;
106
- const shortcutKeyConfig = currentWin.shortcutKey || currentWin.top?.shortcutKey;
110
+
111
+ const top = currentWin.top;
112
+ const shortcutKeyConfig = currentWin.shortcutKey || (top != null ? top.shortcutKey : undefined);
107
113
 
108
114
  if (shortcutKeyConfig !== '0') return;
109
115
 
@@ -143,8 +149,12 @@ export function enableF12(element = document) {
143
149
 
144
150
  // F12拦截函数
145
151
  function preventF12(e) {
146
- const currentWin = e.currentTarget.ownerDocument?.defaultView || e.currentTarget;
147
- const shortcutF12Config = currentWin.shortcutF12 || currentWin.top?.shortcutF12;
152
+
153
+ const ownerDocument = e.currentTarget.ownerDocument;
154
+ const currentWin = (ownerDocument != null ? ownerDocument.defaultView : undefined) || e.currentTarget;
155
+
156
+ const top = currentWin.top;
157
+ const shortcutF12Config = currentWin.shortcutF12 || (top != null ? top.shortcutF12 : undefined);
148
158
 
149
159
  if (shortcutF12Config !== '0') return;
150
160
 
@@ -197,8 +207,12 @@ export function enableTextSelection(element = document) {
197
207
  * 文字选中拦截
198
208
  */
199
209
  function preventTextSelection(e) {
200
- const currentWin = e.currentTarget.ownerDocument?.defaultView || e.currentTarget;
201
- const textSelectedConfig = currentWin.textSelected || currentWin.top?.textSelected;
210
+
211
+ const ownerDocument = e.currentTarget.ownerDocument;
212
+ const currentWin = (ownerDocument != null ? ownerDocument.defaultView : undefined) || e.currentTarget;
213
+
214
+ const top = currentWin.top;
215
+ const textSelectedConfig = currentWin.textSelected || (top != null ? top.textSelected : undefined);
202
216
 
203
217
  if (textSelectedConfig !== '0') return;
204
218
 
@@ -209,13 +223,16 @@ function preventTextSelection(e) {
209
223
  }
210
224
 
211
225
  /**
212
- * 兼容Firefox的文字选中
226
+ * 适配一些其他浏览器的文字选中
213
227
  */
214
228
  function preventTextSelectionByMouseDown(e) {
215
229
  if (e.button !== 0) return;
216
230
 
217
- const currentWin = e.currentTarget.ownerDocument?.defaultView || e.currentTarget;
218
- const textSelectedConfig = currentWin.textSelected || currentWin.top?.textSelected;
231
+ const ownerDocument = e.currentTarget.ownerDocument;
232
+ const currentWin = (ownerDocument != null ? ownerDocument.defaultView : undefined) || e.currentTarget;
233
+
234
+ const top = currentWin.top;
235
+ const textSelectedConfig = currentWin.textSelected || (top != null ? top.textSelected : undefined);
219
236
 
220
237
  if (textSelectedConfig !== '0') return;
221
238
 
@@ -224,7 +241,6 @@ function preventTextSelectionByMouseDown(e) {
224
241
  return false;
225
242
  }
226
243
 
227
-
228
244
  function showNotification(message) {
229
245
  const notification = document.createElement('div');
230
246
  notification.className = 'notification';
@@ -238,7 +254,6 @@ function showNotification(message) {
238
254
  notification.classList.add('show');
239
255
  }, 10);
240
256
 
241
-
242
257
  setTimeout(() => {
243
258
  notification.classList.remove('show');
244
259
  setTimeout(() => {
@@ -246,5 +261,4 @@ function showNotification(message) {
246
261
  }, 500);
247
262
  }, 2000);
248
263
  }
249
-
250
264
  }
package/utils/style.js CHANGED
@@ -1,24 +1,24 @@
1
- const SPECIAL_CHARS_REGEXP = /([\:\-\_]+(.))/g
2
- const MOZ_HACK_REGEXP = /^moz([A-Z])/
3
-
4
- function camelCase(name) {
5
- return name
6
- .replace(SPECIAL_CHARS_REGEXP, function (_, separator, letter, offset) {
7
- return offset ? letter.toUpperCase() : letter
8
- })
9
- .replace(MOZ_HACK_REGEXP, 'Moz$1')
10
- }
11
- // getStyle
12
- export function getStyle(element, styleName) {
13
- if (!element || !styleName) return null
14
- styleName = camelCase(styleName)
15
- if (styleName === 'float') {
16
- styleName = 'cssFloat'
17
- }
18
- try {
19
- const computed = document.defaultView.getComputedStyle(element, '')
20
- return element.style[styleName] || computed ? computed[styleName] : null
21
- } catch (e) {
22
- return element.style[styleName]
23
- }
24
- }
1
+ const SPECIAL_CHARS_REGEXP = /([\:\-\_]+(.))/g
2
+ const MOZ_HACK_REGEXP = /^moz([A-Z])/
3
+
4
+ function camelCase(name) {
5
+ return name
6
+ .replace(SPECIAL_CHARS_REGEXP, function (_, separator, letter, offset) {
7
+ return offset ? letter.toUpperCase() : letter
8
+ })
9
+ .replace(MOZ_HACK_REGEXP, 'Moz$1')
10
+ }
11
+ // getStyle
12
+ export function getStyle(element, styleName) {
13
+ if (!element || !styleName) return null
14
+ styleName = camelCase(styleName)
15
+ if (styleName === 'float') {
16
+ styleName = 'cssFloat'
17
+ }
18
+ try {
19
+ const computed = document.defaultView.getComputedStyle(element, '')
20
+ return element.style[styleName] || computed ? computed[styleName] : null
21
+ } catch (e) {
22
+ return element.style[styleName]
23
+ }
24
+ }
@@ -1,7 +1,7 @@
1
- let transferIndex = 1000
2
-
3
- function transferIncrease() {
4
- transferIndex++
5
- }
6
-
7
- export { transferIndex, transferIncrease }
1
+ let transferIndex = 1000
2
+
3
+ function transferIncrease() {
4
+ transferIndex++
5
+ }
6
+
7
+ export { transferIndex, transferIncrease }